-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(llm-observability): Sleek(ish) dashboard (#27510)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
dff31cb
commit 0220d54
Showing
21 changed files
with
381 additions
and
136 deletions.
There are no files selected for viewing
Binary file modified
BIN
-5.13 KB
(90%)
frontend/__snapshots__/scenes-app-insights--trends-number--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.05 KB
(89%)
frontend/__snapshots__/scenes-app-insights--trends-number--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.01 KB
(90%)
frontend/__snapshots__/scenes-app-insights--trends-number--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.97 KB
(90%)
frontend/__snapshots__/scenes-app-insights--trends-number--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.71 KB
(92%)
frontend/__snapshots__/scenes-app-insights--trends-number-edit--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.57 KB
(92%)
frontend/__snapshots__/scenes-app-insights--trends-number-edit--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.62 KB
(92%)
frontend/__snapshots__/scenes-app-insights--trends-number-edit--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.42 KB
(92%)
frontend/__snapshots__/scenes-app-insights--trends-number-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
frontend/src/lib/components/Cards/InsightCard/QueryCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import clsx from 'clsx' | ||
import { useValues } from 'kea' | ||
import { CardMeta } from 'lib/components/Cards/CardMeta' | ||
import { LemonMenuItemList } from 'lib/lemon-ui/LemonMenu/LemonMenu' | ||
import React, { useState } from 'react' | ||
import { urls } from 'scenes/urls' | ||
|
||
import { ErrorBoundary } from '~/layout/ErrorBoundary' | ||
import { themeLogic } from '~/layout/navigation-3000/themeLogic' | ||
import { Query } from '~/queries/Query/Query' | ||
import { Node } from '~/queries/schema' | ||
|
||
import { InsightCardProps } from './InsightCard' | ||
import { InsightDetails } from './InsightDetails' | ||
import { InsightMetaContent } from './InsightMeta' | ||
import { TopHeading } from './TopHeading' | ||
|
||
export interface QueryCardProps extends Pick<InsightCardProps, 'highlighted' | 'ribbonColor' | 'className' | 'style'> { | ||
query: Node | ||
title: string | ||
description?: string | ||
} | ||
|
||
/** This is like InsightCard, except for presentation of queries that aren't saved insights. */ | ||
export const QueryCard = React.forwardRef<HTMLDivElement, QueryCardProps>(function QueryCard( | ||
{ query, title, description, highlighted, ribbonColor, className, ...divProps }, | ||
ref | ||
): JSX.Element { | ||
const { theme } = useValues(themeLogic) | ||
|
||
const [areDetailsShown, setAreDetailsShown] = useState(false) | ||
|
||
return ( | ||
<div | ||
className={clsx('InsightCard border', highlighted && 'InsightCard--highlighted', className)} | ||
data-attr="insight-card" | ||
{...divProps} | ||
// eslint-disable-next-line react/forbid-dom-props | ||
style={{ ...(divProps?.style ?? {}), ...(theme?.boxStyle ?? {}) }} | ||
ref={ref} | ||
> | ||
<ErrorBoundary tags={{ feature: 'insight' }}> | ||
<CardMeta | ||
ribbonColor={ribbonColor} | ||
setAreDetailsShown={setAreDetailsShown} | ||
areDetailsShown={areDetailsShown} | ||
topHeading={<TopHeading query={query} />} | ||
content={<InsightMetaContent title={title} description={description} />} | ||
metaDetails={<InsightDetails query={query} />} | ||
samplingFactor={ | ||
'samplingFactor' in query && typeof query.samplingFactor === 'number' | ||
? query.samplingFactor | ||
: undefined | ||
} | ||
moreButtons={ | ||
<LemonMenuItemList | ||
items={[ | ||
{ | ||
label: 'Open as new insight', | ||
to: urls.insightNew(undefined, undefined, query), | ||
}, | ||
]} | ||
/> | ||
} | ||
showEditingControls | ||
/> | ||
<div className="InsightCard__viz"> | ||
<Query query={query} readOnly embedded /> | ||
</div> | ||
</ErrorBoundary> | ||
</div> | ||
) | ||
}) |
Oops, something went wrong.