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esVisibilityConfigFactory.ts","webpack://grafana/./.yarn/__virtual__/react-use-virtual-ca2705900f/3/opt/drone/yarncache/react-use-npm-17.2.4-c702db5427-3c885c3798.zip/node_modules/react-use/esm/useInterval.js","webpack://grafana/./public/app/features/explore/Time.tsx","webpack://grafana/./public/app/features/explore/ElapsedTime.tsx","webpack://grafana/./public/app/features/explore/LiveLogs.tsx","webpack://grafana/./public/app/features/explore/MetaInfoText.tsx","webpack://grafana/./public/app/features/explore/LogsMetaRow.tsx","webpack://grafana/./public/app/features/explore/LogsNavigationPages.tsx","webpack://grafana/./public/app/features/explore/LogsNavigation.tsx","webpack://grafana/./public/app/features/explore/ExploreGraph.tsx","webpack://grafana/./public/app/features/explore/exploreGraphStyleUtils.ts","webpack://grafana/./public/app/features/explore/Logs.tsx","webpack://grafana/./public/app/features/explore/utils/LogsCrossFadeTransition.tsx","webpack://grafana/./public/app/features/explore/useLiveTailControls.ts","webpack://grafana/./public/app/features/explore/LogsContainer.tsx","webpack://grafana/./public/app/features/explore/state/selectors.ts","webpack://grafana/./public/app/features/explore/QueryRows.tsx","webpack://grafana/./public/app/features/explore/TableContainer.tsx","webpack://grafana/./public/app/features/explore/RichHistory/RichHistorySettings.tsx","webpack://grafana/./public/app/features/explore/RichHistory/RichHistoryCard.tsx","webpack://grafana/./public/app/features/explore/RichHistory/RichHistoryQueriesTab.tsx","webpack://grafana/./public/app/features/explore/RichHistory/RichHistoryStarredTab.tsx","webpack://grafana/./public/app/features/explore/RichHistory/RichHistory.tsx","webpack://grafana/./.yarn/__virtual__/re-resizable-virtual-ea246c6580/3/opt/drone/yarncache/re-resizable-npm-6.9.1-79ca365a45-b164f6b956.zip/node_modules/re-resizable/lib/resizer.js","webpack://grafana/./.yarn/__virtual__/re-resizable-virtual-ea246c6580/3/opt/drone/yarncache/re-resizable-npm-6.9.1-79ca365a45-b164f6b956.zip/node_modules/re-resizable/lib/index.js","webpack://grafana/./public/app/features/explore/ExploreDrawer.tsx","webpack://grafana/./public/app/features/explore/RichHistory/RichHistoryContainer.tsx","webpack://grafana/./public/app/features/explore/ExploreQueryInspector.tsx","webpack://grafana/./public/app/features/explore/TimeSyncButton.tsx","webpack://grafana/./public/app/features/explore/ExploreTimeControls.tsx","webpack://grafana/./public/app/features/explore/LiveTailButton.tsx","webpack://grafana/./public/app/features/explore/RunButton.tsx","webpack://grafana/./public/app/features/explore/ReturnToDashboardButton.tsx","webpack://grafana/./public/app/features/explore/ExploreToolbar.tsx","webpack://grafana/./public/app/features/explore/NoDataSourceCallToAction.tsx","webpack://grafana/./public/app/features/explore/SecondaryActions.tsx","webpack://grafana/./public/app/features/explore/NodeGraphContainer.tsx","webpack://grafana/./public/app/core/components/Animations/FadeIn.tsx","webpack://grafana/./public/app/features/explore/ErrorContainer.tsx","webpack://grafana/./public/app/features/explore/ResponseErrorContainer.tsx","webpack://grafana/./public/app/features/explore/TraceView/createSpanLink.tsx","webpack://grafana/./public/app/features/explore/TraceView/uiElements.tsx","webpack://grafana/./public/app/features/explore/TraceView/useChildrenState.ts","webpack://grafana/./public/app/features/explore/TraceView/useDetailState.ts","webpack://grafana/./public/app/features/explore/TraceView/TraceView.tsx","webpack://grafana/./public/app/features/explore/TraceView/useHoverIndentGuide.ts","webpack://grafana/./public/app/features/explore/TraceView/useViewRange.ts","webpack://grafana/./public/app/features/explore/TraceView/useSearch.ts","webpack://grafana/./public/app/features/explore/TraceView/TraceViewContainer.tsx","webpack://grafana/./public/app/features/explore/LogsVolumePanel.tsx","webpack://grafana/./public/app/features/explore/ExploreGraphLabel.tsx","webpack://grafana/./public/app/features/explore/Explore.tsx","webpack://grafana/./public/app/features/explore/ExplorePaneContainer.tsx","webpack://grafana/./public/app/features/explore/Wrapper.tsx","webpack://grafana/./.yarn/__virtual__/react-transition-group-virtual-08a7713bd0/3/opt/drone/yarncache/react-transition-group-npm-4.4.1-5b62a122ef-0bcd8af483.zip/node_modules/react-transition-group/esm/CSSTransition.js","webpack://grafana/./.yarn/__virtual__/react-use-virtual-ca2705900f/3/opt/drone/yarncache/react-use-npm-17.2.4-c702db5427-3c885c3798.zip/node_modules/react-use/esm/usePrevious.js","webpack://grafana/../../opt/drone/yarncache/fast-memoize-npm-2.5.2-f42a7c6940-79fa759719.zip/node_modules/fast-memoize/src/index.js"],"sourcesContent":["import {\n ByNamesMatcherMode,\n DataFrame,\n DynamicConfigValue,\n FieldConfigSource,\n FieldMatcherID,\n FieldType,\n getFieldDisplayName,\n isSystemOverrideWithRef,\n SystemConfigOverrideRule,\n} from '@grafana/data';\nimport { SeriesVisibilityChangeMode } from '@grafana/ui';\n\nconst displayOverrideRef = 'hideSeriesFrom';\nconst isHideSeriesOverride = isSystemOverrideWithRef(displayOverrideRef);\n\nexport function seriesVisibilityConfigFactory(\n label: string,\n mode: SeriesVisibilityChangeMode,\n fieldConfig: FieldConfigSource,\n data: DataFrame[]\n) {\n const { overrides } = fieldConfig;\n\n const displayName = label;\n const currentIndex = overrides.findIndex(isHideSeriesOverride);\n\n if (currentIndex < 0) {\n if (mode === SeriesVisibilityChangeMode.ToggleSelection) {\n const override = createOverride([displayName]);\n\n return {\n ...fieldConfig,\n overrides: [...fieldConfig.overrides, override],\n };\n }\n\n const displayNames = getDisplayNames(data, displayName);\n const override = createOverride(displayNames);\n\n return {\n ...fieldConfig,\n overrides: [...fieldConfig.overrides, override],\n };\n }\n\n const overridesCopy = Array.from(overrides);\n const [current] = overridesCopy.splice(currentIndex, 1) as SystemConfigOverrideRule[];\n\n if (mode === SeriesVisibilityChangeMode.ToggleSelection) {\n const existing = getExistingDisplayNames(current);\n\n if (existing[0] === displayName && existing.length === 1) {\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n }\n\n const override = createOverride([displayName]);\n\n return {\n ...fieldConfig,\n overrides: [...overridesCopy, override],\n };\n }\n\n const override = createExtendedOverride(current, displayName);\n\n if (allFieldsAreExcluded(override, data)) {\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n }\n\n return {\n ...fieldConfig,\n overrides: [...overridesCopy, override],\n };\n}\n\nfunction createOverride(\n names: string[],\n mode = ByNamesMatcherMode.exclude,\n property?: DynamicConfigValue\n): SystemConfigOverrideRule {\n property = property ?? {\n id: 'custom.hideFrom',\n value: {\n viz: true,\n legend: false,\n tooltip: false,\n },\n };\n\n return {\n __systemRef: displayOverrideRef,\n matcher: {\n id: FieldMatcherID.byNames,\n options: {\n mode: mode,\n names: names,\n prefix: mode === ByNamesMatcherMode.exclude ? 'All except:' : undefined,\n readOnly: true,\n },\n },\n properties: [\n {\n ...property,\n value: {\n viz: true,\n legend: false,\n tooltip: false,\n },\n },\n ],\n };\n}\n\nconst createExtendedOverride = (\n current: SystemConfigOverrideRule,\n displayName: string,\n mode = ByNamesMatcherMode.exclude\n): SystemConfigOverrideRule => {\n const property = current.properties.find((p) => p.id === 'custom.hideFrom');\n const existing = getExistingDisplayNames(current);\n const index = existing.findIndex((name) => name === displayName);\n\n if (index < 0) {\n existing.push(displayName);\n } else {\n existing.splice(index, 1);\n }\n\n return createOverride(existing, mode, property);\n};\n\nconst getExistingDisplayNames = (rule: SystemConfigOverrideRule): string[] => {\n const names = rule.matcher.options?.names;\n if (!Array.isArray(names)) {\n return [];\n }\n return names;\n};\n\nconst allFieldsAreExcluded = (override: SystemConfigOverrideRule, data: DataFrame[]): boolean => {\n return getExistingDisplayNames(override).length === getDisplayNames(data).length;\n};\n\nconst getDisplayNames = (data: DataFrame[], excludeName?: string): string[] => {\n const unique = new Set<string>();\n\n for (const frame of data) {\n for (const field of frame.fields) {\n if (field.type !== FieldType.number) {\n continue;\n }\n\n const name = getFieldDisplayName(field, frame, data);\n\n if (name === excludeName) {\n continue;\n }\n\n unique.add(name);\n }\n }\n\n return Array.from(unique);\n};\n","import { useEffect, useRef } from 'react';\nvar useInterval = function (callback, delay) {\n var savedCallback = useRef(function () { });\n useEffect(function () {\n savedCallback.current = callback;\n });\n useEffect(function () {\n if (delay !== null) {\n var interval_1 = setInterval(function () { return savedCallback.current(); }, delay || 0);\n return function () { return clearInterval(interval_1); };\n }\n return undefined;\n }, [delay]);\n};\nexport default useInterval;\n","import React, { FC } from 'react';\nimport { toDuration } from '@grafana/data';\n\nexport interface TimeProps {\n timeInMs: number;\n className?: string;\n humanize?: boolean;\n}\n\nexport const Time: FC<TimeProps> = ({ timeInMs, className, humanize }) => {\n return <span className={`elapsed-time ${className}`}>{formatTime(timeInMs, humanize)}</span>;\n};\n\nconst formatTime = (timeInMs: number, humanize = false): string => {\n const inSeconds = timeInMs / 1000;\n\n if (!humanize) {\n return `${inSeconds.toFixed(1)}s`;\n }\n\n const duration = toDuration(inSeconds, 'seconds');\n const hours = duration.hours();\n const minutes = duration.minutes();\n const seconds = duration.seconds();\n\n if (hours) {\n return `${hours}h ${minutes}m ${seconds}s`;\n }\n\n if (minutes) {\n return `${minutes}m ${seconds}s`;\n }\n\n return `${seconds}s`;\n};\n","import React, { FC, useState, useEffect } from 'react';\nimport { useInterval } from 'react-use';\nimport { Time, TimeProps } from './Time';\n\nconst INTERVAL = 150;\n\nexport interface ElapsedTimeProps extends Omit<TimeProps, 'timeInMs'> {\n // Use this to reset the timer. Any value is allowed just need to be !== from the previous.\n // Keep in mind things like [] !== [] or {} !== {}.\n resetKey?: any;\n}\n\nexport const ElapsedTime: FC<ElapsedTimeProps> = ({ resetKey, humanize, className }) => {\n const [elapsed, setElapsed] = useState(0); // the current value of elapsed\n\n // hook that will schedule a interval and then update the elapsed value on every tick.\n useInterval(() => setElapsed(elapsed + INTERVAL), INTERVAL);\n // this effect will only be run when resetKey changes. This will reset the elapsed to 0.\n useEffect(() => setElapsed(0), [resetKey]);\n\n return <Time timeInMs={elapsed} className={className} humanize={humanize} />;\n};\n","import React, { PureComponent } from 'react';\nimport { css, cx } from '@emotion/css';\nimport tinycolor from 'tinycolor2';\n\nimport { LogMessageAnsi, getLogRowStyles, Icon, Button, Themeable2, withTheme2 } from '@grafana/ui';\nimport { LogRowModel, TimeZone, dateTimeFormat, GrafanaTheme2 } from '@grafana/data';\n\nimport { ElapsedTime } from './ElapsedTime';\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n logsRowsLive: css`\n label: logs-rows-live;\n font-family: ${theme.typography.fontFamilyMonospace};\n font-size: ${theme.typography.bodySmall.fontSize};\n display: flex;\n flex-flow: column nowrap;\n height: 60vh;\n overflow-y: scroll;\n :first-child {\n margin-top: auto !important;\n }\n `,\n logsRowFade: css`\n label: logs-row-fresh;\n color: ${theme.colors.text};\n background-color: ${tinycolor(theme.colors.info.transparent).setAlpha(0.25).toString()};\n animation: fade 1s ease-out 1s 1 normal forwards;\n @keyframes fade {\n from {\n background-color: ${tinycolor(theme.colors.info.transparent).setAlpha(0.25).toString()};\n }\n to {\n background-color: transparent;\n }\n }\n `,\n logsRowsIndicator: css`\n font-size: ${theme.typography.h6.fontSize};\n padding-top: ${theme.spacing(1)};\n display: flex;\n align-items: center;\n `,\n button: css`\n margin-right: ${theme.spacing(1)};\n `,\n fullWidth: css`\n width: 100%;\n `,\n});\n\nexport interface Props extends Themeable2 {\n logRows?: LogRowModel[];\n timeZone: TimeZone;\n stopLive: () => void;\n onPause: () => void;\n onResume: () => void;\n isPaused: boolean;\n}\n\ninterface State {\n logRowsToRender?: LogRowModel[];\n}\n\nclass LiveLogs extends PureComponent<Props, State> {\n private liveEndDiv: HTMLDivElement | null = null;\n private scrollContainerRef = React.createRef<HTMLTableSectionElement>();\n\n constructor(props: Props) {\n super(props);\n this.state = {\n logRowsToRender: props.logRows,\n };\n }\n\n static getDerivedStateFromProps(nextProps: Props, state: State) {\n if (!nextProps.isPaused) {\n return {\n // We update what we show only if not paused. We keep any background subscriptions running and keep updating\n // our state, but we do not show the updates, this allows us start again showing correct result after resuming\n // without creating a gap in the log results.\n logRowsToRender: nextProps.logRows,\n };\n } else {\n return null;\n }\n }\n\n /**\n * Handle pausing when user scrolls up so that we stop resetting his position to the bottom when new row arrives.\n * We do not need to throttle it here much, adding new rows should be throttled/buffered itself in the query epics\n * and after you pause we remove the handler and add it after you manually resume, so this should not be fired often.\n */\n onScroll = (event: React.SyntheticEvent) => {\n const { isPaused, onPause } = this.props;\n const { scrollTop, clientHeight, scrollHeight } = event.currentTarget;\n const distanceFromBottom = scrollHeight - (scrollTop + clientHeight);\n if (distanceFromBottom >= 5 && !isPaused) {\n onPause();\n }\n };\n\n rowsToRender = () => {\n const { isPaused } = this.props;\n let { logRowsToRender: rowsToRender = [] } = this.state;\n if (!isPaused) {\n // A perf optimisation here. Show just 100 rows when streaming and full length when the streaming is paused.\n rowsToRender = rowsToRender.slice(-100);\n }\n return rowsToRender;\n };\n\n render() {\n const { theme, timeZone, onPause, onResume, isPaused } = this.props;\n const styles = getStyles(theme);\n const { logsRow, logsRowLocalTime, logsRowMessage } = getLogRowStyles(theme);\n\n return (\n <div>\n <table className={styles.fullWidth}>\n <tbody\n onScroll={isPaused ? undefined : this.onScroll}\n className={cx(['logs-rows', styles.logsRowsLive])}\n ref={this.scrollContainerRef}\n >\n {this.rowsToRender().map((row: LogRowModel) => {\n return (\n <tr className={cx(logsRow, styles.logsRowFade)} key={row.uid}>\n <td className={cx(logsRowLocalTime)}>{dateTimeFormat(row.timeEpochMs, { timeZone })}</td>\n <td className={cx(logsRowMessage)}>{row.hasAnsi ? <LogMessageAnsi value={row.raw} /> : row.entry}</td>\n </tr>\n );\n })}\n <tr\n ref={(element) => {\n this.liveEndDiv = element;\n // This is triggered on every update so on every new row. It keeps the view scrolled at the bottom by\n // default.\n if (this.liveEndDiv && !isPaused) {\n this.scrollContainerRef.current?.scrollTo(0, this.scrollContainerRef.current.scrollHeight);\n }\n }}\n />\n </tbody>\n </table>\n <div className={styles.logsRowsIndicator}>\n <Button variant=\"secondary\" onClick={isPaused ? onResume : onPause} className={styles.button}>\n <Icon name={isPaused ? 'play' : 'pause'} />\n \n {isPaused ? 'Resume' : 'Pause'}\n </Button>\n <Button variant=\"secondary\" onClick={this.props.stopLive} className={styles.button}>\n <Icon name=\"square-shape\" size=\"lg\" type=\"mono\" />\n Exit live mode\n </Button>\n {isPaused || (\n <span>\n Last line received: <ElapsedTime resetKey={this.props.logRows} humanize={true} /> ago\n </span>\n )}\n </div>\n </div>\n );\n }\n}\n\nexport const LiveLogsWithTheme = withTheme2(LiveLogs);\n","import React, { memo } from 'react';\nimport { css } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n metaContainer: css`\n flex: 1;\n color: ${theme.colors.text.secondary};\n margin-bottom: ${theme.spacing(2)};\n min-width: 30%;\n display: flex;\n flex-wrap: wrap;\n `,\n metaItem: css`\n margin-right: ${theme.spacing(2)};\n margin-top: ${theme.spacing(0.5)};\n display: flex;\n align-items: baseline;\n\n .logs-meta-item__error {\n color: ${theme.colors.error.text};\n }\n `,\n metaLabel: css`\n margin-right: calc(${theme.spacing(2)} / 2);\n font-size: ${theme.typography.bodySmall.fontSize};\n font-weight: ${theme.typography.fontWeightMedium};\n `,\n metaValue: css`\n font-family: ${theme.typography.fontFamilyMonospace};\n font-size: ${theme.typography.bodySmall.fontSize};\n `,\n});\n\nexport interface MetaItemProps {\n label?: string;\n value: string | JSX.Element;\n}\n\nconst MetaInfoItem = memo(function MetaInfoItem(props: MetaItemProps) {\n const style = useStyles2(getStyles);\n const { label, value } = props;\n\n return (\n <div className={style.metaItem}>\n {label && <span className={style.metaLabel}>{label}:</span>}\n <span className={style.metaValue}>{value}</span>\n </div>\n );\n});\n\ninterface MetaInfoTextProps {\n metaItems: MetaItemProps[];\n}\n\nexport const MetaInfoText = memo(function MetaInfoText(props: MetaInfoTextProps) {\n const style = useStyles2(getStyles);\n const { metaItems } = props;\n\n return (\n <div className={style.metaContainer}>\n {metaItems.map((item, index) => (\n <MetaInfoItem key={`${index}-${item.label}`} label={item.label} value={item.value} />\n ))}\n </div>\n );\n});\n","import React from 'react';\nimport { LogsDedupStrategy, LogsMetaItem, LogsMetaKind, LogRowModel } from '@grafana/data';\nimport { Button, Tooltip, Icon, LogLabels } from '@grafana/ui';\nimport { MAX_CHARACTERS } from '@grafana/ui/src/components/Logs/LogRowMessage';\nimport { MetaInfoText, MetaItemProps } from './MetaInfoText';\n\nexport type Props = {\n meta: LogsMetaItem[];\n dedupStrategy: LogsDedupStrategy;\n dedupCount: number;\n showDetectedFields: string[];\n hasUnescapedContent: boolean;\n forceEscape: boolean;\n logRows: LogRowModel[];\n onEscapeNewlines: () => void;\n clearDetectedFields: () => void;\n};\n\nexport const LogsMetaRow: React.FC<Props> = React.memo(\n ({\n meta,\n dedupStrategy,\n dedupCount,\n showDetectedFields,\n clearDetectedFields,\n hasUnescapedContent,\n forceEscape,\n onEscapeNewlines,\n logRows,\n }) => {\n const logsMetaItem: Array<LogsMetaItem | MetaItemProps> = [...meta];\n\n // Add deduplication info\n if (dedupStrategy !== LogsDedupStrategy.none) {\n logsMetaItem.push({\n label: 'Dedup count',\n value: dedupCount,\n kind: LogsMetaKind.Number,\n });\n }\n // Add info about limit for highlighting\n if (logRows.some((r) => r.entry.length > MAX_CHARACTERS)) {\n logsMetaItem.push({\n label: 'Info',\n value: 'Logs with more than 100,000 characters could not be parsed and highlighted',\n kind: LogsMetaKind.String,\n });\n }\n\n // Add detected fields info\n if (showDetectedFields?.length > 0) {\n logsMetaItem.push(\n {\n label: 'Showing only detected fields',\n value: renderMetaItem(showDetectedFields, LogsMetaKind.LabelsMap),\n },\n {\n label: '',\n value: (\n <Button variant=\"secondary\" size=\"sm\" onClick={clearDetectedFields}>\n Show all detected fields\n </Button>\n ),\n }\n );\n }\n\n // Add unescaped content info\n if (hasUnescapedContent) {\n logsMetaItem.push({\n label: 'Your logs might have incorrectly escaped content',\n value: (\n <Tooltip\n content=\"We suggest to try to fix the escaping of your log lines first. This is an experimental feature, your logs might not be correctly escaped.\"\n placement=\"right\"\n >\n <Button variant=\"secondary\" size=\"sm\" onClick={onEscapeNewlines}>\n <span>{forceEscape ? 'Remove escaping' : 'Escape newlines'} </span>\n <Icon name=\"exclamation-triangle\" className=\"muted\" size=\"sm\" />\n </Button>\n </Tooltip>\n ),\n });\n }\n\n return (\n <>\n {logsMetaItem && (\n <MetaInfoText\n metaItems={logsMetaItem.map((item) => {\n return {\n label: item.label,\n value: 'kind' in item ? renderMetaItem(item.value, item.kind) : item.value,\n };\n })}\n />\n )}\n </>\n );\n }\n);\n\nLogsMetaRow.displayName = 'LogsMetaRow';\n\nfunction renderMetaItem(value: any, kind: LogsMetaKind) {\n if (kind === LogsMetaKind.LabelsMap) {\n return (\n <span className=\"logs-meta-item__labels\">\n <LogLabels labels={value} />\n </span>\n );\n } else if (kind === LogsMetaKind.Error) {\n return <span className=\"logs-meta-item__error\">{value}</span>;\n }\n return value;\n}\n","import React from 'react';\nimport { css, cx } from '@emotion/css';\nimport { dateTimeFormat, systemDateFormats, TimeZone, AbsoluteTimeRange, GrafanaTheme2 } from '@grafana/data';\nimport { CustomScrollbar, Spinner, useTheme2 } from '@grafana/ui';\nimport { LogsPage } from './LogsNavigation';\n\ntype Props = {\n pages: LogsPage[];\n currentPageIndex: number;\n oldestLogsFirst: boolean;\n timeZone: TimeZone;\n loading: boolean;\n changeTime: (range: AbsoluteTimeRange) => void;\n};\n\nexport function LogsNavigationPages({\n pages,\n currentPageIndex,\n oldestLogsFirst,\n timeZone,\n loading,\n changeTime,\n}: Props) {\n const formatTime = (time: number) => {\n return `${dateTimeFormat(time, {\n format: systemDateFormats.interval.second,\n timeZone: timeZone,\n })}`;\n };\n\n const createPageContent = (page: LogsPage, index: number) => {\n if (currentPageIndex === index && loading) {\n return <Spinner />;\n }\n const topContent = formatTime(oldestLogsFirst ? page.logsRange.from : page.logsRange.to);\n const bottomContent = formatTime(oldestLogsFirst ? page.logsRange.to : page.logsRange.from);\n return `${topContent} — ${bottomContent}`;\n };\n\n const theme = useTheme2();\n const styles = getStyles(theme, loading);\n\n return (\n <CustomScrollbar autoHide>\n <div className={styles.pagesWrapper} data-testid=\"logsNavigationPages\">\n <div className={styles.pagesContainer}>\n {pages.map((page: LogsPage, index: number) => (\n <div\n data-testid={`page${index + 1}`}\n className={styles.page}\n key={page.queryRange.to}\n onClick={() => !loading && changeTime({ from: page.queryRange.from, to: page.queryRange.to })}\n >\n <div className={cx(styles.line, { selectedBg: currentPageIndex === index })} />\n <div className={cx(styles.time, { selectedText: currentPageIndex === index })}>\n {createPageContent(page, index)}\n </div>\n </div>\n ))}\n </div>\n </div>\n </CustomScrollbar>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2, loading: boolean) => {\n return {\n pagesWrapper: css`\n height: 100%;\n padding-left: ${theme.spacing(0.5)};\n display: flex;\n flex-direction: column;\n overflow-y: scroll;\n &::after {\n content: '';\n display: block;\n background: repeating-linear-gradient(\n 135deg,\n ${theme.colors.background.primary},\n ${theme.colors.background.primary} 5px,\n ${theme.colors.background.secondary} 5px,\n ${theme.colors.background.secondary} 15px\n );\n width: 3px;\n height: inherit;\n margin-bottom: 8px;\n }\n `,\n pagesContainer: css`\n display: flex;\n padding: 0;\n flex-direction: column;\n `,\n page: css`\n display: flex;\n margin: ${theme.spacing(2)} 0;\n cursor: ${loading ? 'auto' : 'pointer'};\n white-space: normal;\n .selectedBg {\n background: ${theme.colors.primary.main};\n }\n .selectedText {\n color: ${theme.colors.primary.main};\n }\n `,\n line: css`\n width: 3px;\n height: 100%;\n align-items: center;\n background: ${theme.colors.text.secondary};\n `,\n time: css`\n width: 60px;\n min-height: 80px;\n font-size: ${theme.v1.typography.size.sm};\n padding-left: ${theme.spacing(0.5)};\n display: flex;\n align-items: center;\n `,\n };\n};\n","import React, { memo, useState, useEffect, useRef } from 'react';\nimport { isEqual } from 'lodash';\nimport { css } from '@emotion/css';\nimport { LogsSortOrder, AbsoluteTimeRange, TimeZone, DataQuery, GrafanaTheme2 } from '@grafana/data';\nimport { Button, Icon, Spinner, useTheme2 } from '@grafana/ui';\nimport { LogsNavigationPages } from './LogsNavigationPages';\n\ntype Props = {\n absoluteRange: AbsoluteTimeRange;\n timeZone: TimeZone;\n queries: DataQuery[];\n loading: boolean;\n visibleRange: AbsoluteTimeRange;\n logsSortOrder?: LogsSortOrder | null;\n onChangeTime: (range: AbsoluteTimeRange) => void;\n scrollToTopLogs: () => void;\n addResultsToCache: () => void;\n clearCache: () => void;\n};\n\nexport type LogsPage = {\n logsRange: AbsoluteTimeRange;\n queryRange: AbsoluteTimeRange;\n};\n\nfunction LogsNavigation({\n absoluteRange,\n logsSortOrder,\n timeZone,\n loading,\n onChangeTime,\n scrollToTopLogs,\n visibleRange,\n queries,\n clearCache,\n addResultsToCache,\n}: Props) {\n const [pages, setPages] = useState<LogsPage[]>([]);\n const [currentPageIndex, setCurrentPageIndex] = useState(0);\n\n // These refs are to determine, if we want to clear up logs navigation when totally new query is run\n const expectedQueriesRef = useRef<DataQuery[]>();\n const expectedRangeRef = useRef<AbsoluteTimeRange>();\n // This ref is to store range span for future queres based on firstly selected time range\n // e.g. if last 5 min selected, always run 5 min range\n const rangeSpanRef = useRef(0);\n\n const oldestLogsFirst = logsSortOrder === LogsSortOrder.Ascending;\n const onFirstPage = oldestLogsFirst ? currentPageIndex === pages.length - 1 : currentPageIndex === 0;\n const onLastPage = oldestLogsFirst ? currentPageIndex === 0 : currentPageIndex === pages.length - 1;\n const theme = useTheme2();\n const styles = getStyles(theme, oldestLogsFirst, loading);\n\n // Main effect to set pages and index\n useEffect(() => {\n const newPage = { logsRange: visibleRange, queryRange: absoluteRange };\n let newPages: LogsPage[] = [];\n // We want to start new pagination if queries change or if absolute range is different than expected\n if (!isEqual(expectedRangeRef.current, absoluteRange) || !isEqual(expectedQueriesRef.current, queries)) {\n clearCache();\n setPages([newPage]);\n setCurrentPageIndex(0);\n expectedQueriesRef.current = queries;\n rangeSpanRef.current = absoluteRange.to - absoluteRange.from;\n } else {\n setPages((pages) => {\n // Remove duplicates with new query\n newPages = pages.filter((page) => !isEqual(newPage.queryRange, page.queryRange));\n // Sort pages based on logsOrder so they visually align with displayed logs\n newPages = [...newPages, newPage].sort((a, b) => sortPages(a, b, logsSortOrder));\n // Set new pages\n\n return newPages;\n });\n\n // Set current page index\n const index = newPages.findIndex((page) => page.queryRange.to === absoluteRange.to);\n setCurrentPageIndex(index);\n }\n addResultsToCache();\n }, [visibleRange, absoluteRange, logsSortOrder, queries, clearCache, addResultsToCache]);\n\n useEffect(() => {\n return () => clearCache();\n // We can't enforce the eslint rule here because we only want to run when component unmounts.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const changeTime = ({ from, to }: AbsoluteTimeRange) => {\n expectedRangeRef.current = { from, to };\n onChangeTime({ from, to });\n };\n\n const sortPages = (a: LogsPage, b: LogsPage, logsSortOrder?: LogsSortOrder | null) => {\n if (logsSortOrder === LogsSortOrder.Ascending) {\n return a.queryRange.to > b.queryRange.to ? 1 : -1;\n }\n return a.queryRange.to > b.queryRange.to ? -1 : 1;\n };\n\n const olderLogsButton = (\n <Button\n data-testid=\"olderLogsButton\"\n className={styles.navButton}\n variant=\"secondary\"\n onClick={() => {\n //If we are not on the last page, use next page's range\n if (!onLastPage) {\n const indexChange = oldestLogsFirst ? -1 : 1;\n changeTime({\n from: pages[currentPageIndex + indexChange].queryRange.from,\n to: pages[currentPageIndex + indexChange].queryRange.to,\n });\n } else {\n //If we are on the last page, create new range\n changeTime({ from: visibleRange.from - rangeSpanRef.current, to: visibleRange.from });\n }\n }}\n disabled={loading}\n >\n <div className={styles.navButtonContent}>\n {loading ? <Spinner /> : <Icon name={oldestLogsFirst ? 'angle-up' : 'angle-down'} size=\"lg\" />}\n Older logs\n </div>\n </Button>\n );\n\n const newerLogsButton = (\n <Button\n data-testid=\"newerLogsButton\"\n className={styles.navButton}\n variant=\"secondary\"\n onClick={() => {\n //If we are not on the first page, use previous page's range\n if (!onFirstPage) {\n const indexChange = oldestLogsFirst ? 1 : -1;\n changeTime({\n from: pages[currentPageIndex + indexChange].queryRange.from,\n to: pages[currentPageIndex + indexChange].queryRange.to,\n });\n }\n //If we are on the first page, button is disabled and we do nothing\n }}\n disabled={loading || onFirstPage}\n >\n <div className={styles.navButtonContent}>\n {loading && <Spinner />}\n {onFirstPage || loading ? null : <Icon name={oldestLogsFirst ? 'angle-down' : 'angle-up'} size=\"lg\" />}\n {onFirstPage ? 'Start of range' : 'Newer logs'}\n </div>\n </Button>\n );\n\n return (\n <div className={styles.navContainer}>\n {oldestLogsFirst ? olderLogsButton : newerLogsButton}\n <LogsNavigationPages\n pages={pages}\n currentPageIndex={currentPageIndex}\n oldestLogsFirst={oldestLogsFirst}\n timeZone={timeZone}\n loading={loading}\n changeTime={changeTime}\n />\n {oldestLogsFirst ? newerLogsButton : olderLogsButton}\n <Button\n data-testid=\"scrollToTop\"\n className={styles.scrollToTopButton}\n variant=\"secondary\"\n onClick={scrollToTopLogs}\n title=\"Scroll to top\"\n >\n <Icon name=\"arrow-up\" size=\"lg\" />\n </Button>\n </div>\n );\n}\n\nexport default memo(LogsNavigation);\n\nconst getStyles = (theme: GrafanaTheme2, oldestLogsFirst: boolean, loading: boolean) => {\n return {\n navContainer: css`\n max-height: 95vh;\n display: flex;\n flex-direction: column;\n justify-content: ${oldestLogsFirst ? 'flex-start' : 'space-between'};\n position: sticky;\n top: ${theme.spacing(2)};\n right: 0;\n `,\n navButton: css`\n width: 58px;\n height: 68px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n line-height: 1;\n `,\n navButtonContent: css`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n white-space: normal;\n `,\n scrollToTopButton: css`\n width: 40px;\n height: 40px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin-top: ${theme.spacing(1)};\n `,\n };\n};\n","import { css, cx } from '@emotion/css';\nimport {\n AbsoluteTimeRange,\n applyFieldOverrides,\n compareArrayValues,\n compareDataFrameStructures,\n createFieldConfigRegistry,\n DataFrame,\n dateTime,\n FieldColorModeId,\n FieldConfigSource,\n getFrameDisplayName,\n GrafanaTheme2,\n LoadingState,\n SplitOpen,\n TimeZone,\n} from '@grafana/data';\nimport { PanelRenderer } from '@grafana/runtime';\nimport { GraphDrawStyle, LegendDisplayMode, TooltipDisplayMode } from '@grafana/schema';\nimport {\n Icon,\n PanelContext,\n PanelContextProvider,\n SeriesVisibilityChangeMode,\n useStyles2,\n useTheme2,\n} from '@grafana/ui';\nimport appEvents from 'app/core/app_events';\nimport { ExploreGraphStyle } from 'app/core/utils/explore';\nimport { defaultGraphConfig, getGraphFieldConfig } from 'app/plugins/panel/timeseries/config';\nimport { TimeSeriesOptions } from 'app/plugins/panel/timeseries/types';\nimport { identity } from 'lodash';\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { usePrevious } from 'react-use';\nimport { seriesVisibilityConfigFactory } from '../dashboard/dashgrid/SeriesVisibilityConfigFactory';\nimport { applyGraphStyle } from './exploreGraphStyleUtils';\n\nconst MAX_NUMBER_OF_TIME_SERIES = 20;\n\ninterface Props {\n data: DataFrame[];\n height: number;\n width: number;\n absoluteRange: AbsoluteTimeRange;\n timeZone: TimeZone;\n loadingState: LoadingState;\n annotations?: DataFrame[];\n onHiddenSeriesChanged?: (hiddenSeries: string[]) => void;\n tooltipDisplayMode?: TooltipDisplayMode;\n splitOpenFn?: SplitOpen;\n onChangeTime: (timeRange: AbsoluteTimeRange) => void;\n graphStyle: ExploreGraphStyle;\n}\n\nexport function ExploreGraph({\n data,\n height,\n width,\n timeZone,\n absoluteRange,\n onChangeTime,\n loadingState,\n annotations,\n onHiddenSeriesChanged,\n splitOpenFn,\n graphStyle,\n tooltipDisplayMode = TooltipDisplayMode.Single,\n}: Props) {\n const theme = useTheme2();\n const [showAllTimeSeries, setShowAllTimeSeries] = useState(false);\n const [baseStructureRev, setBaseStructureRev] = useState(1);\n\n const previousData = usePrevious(data);\n const structureChangesRef = useRef(0);\n\n if (data && previousData && !compareArrayValues(previousData, data, compareDataFrameStructures)) {\n structureChangesRef.current++;\n }\n\n const structureRev = baseStructureRev + structureChangesRef.current;\n\n const [fieldConfig, setFieldConfig] = useState<FieldConfigSource>({\n defaults: {\n color: {\n mode: FieldColorModeId.PaletteClassic,\n },\n custom: {\n drawStyle: GraphDrawStyle.Line,\n fillOpacity: 0,\n pointSize: 5,\n },\n },\n overrides: [],\n });\n\n const style = useStyles2(getStyles);\n const timeRange = {\n from: dateTime(absoluteRange.from),\n to: dateTime(absoluteRange.to),\n raw: {\n from: dateTime(absoluteRange.from),\n to: dateTime(absoluteRange.to),\n },\n };\n\n const dataWithConfig = useMemo(() => {\n const registry = createFieldConfigRegistry(getGraphFieldConfig(defaultGraphConfig), 'Explore');\n const styledFieldConfig = applyGraphStyle(fieldConfig, graphStyle);\n return applyFieldOverrides({\n fieldConfig: styledFieldConfig,\n data,\n timeZone,\n replaceVariables: (value) => value, // We don't need proper replace here as it is only used in getLinks and we use getFieldLinks\n theme,\n fieldConfigRegistry: registry,\n });\n }, [fieldConfig, graphStyle, data, timeZone, theme]);\n\n useEffect(() => {\n if (onHiddenSeriesChanged) {\n const hiddenFrames: string[] = [];\n dataWithConfig.forEach((frame) => {\n const allFieldsHidden = frame.fields.map((field) => field.config?.custom?.hideFrom?.viz).every(identity);\n if (allFieldsHidden) {\n hiddenFrames.push(getFrameDisplayName(frame));\n }\n });\n onHiddenSeriesChanged(hiddenFrames);\n }\n }, [dataWithConfig, onHiddenSeriesChanged]);\n\n const seriesToShow = showAllTimeSeries ? dataWithConfig : dataWithConfig.slice(0, MAX_NUMBER_OF_TIME_SERIES);\n\n const panelContext: PanelContext = {\n eventBus: appEvents,\n onSplitOpen: splitOpenFn,\n onToggleSeriesVisibility(label: string, mode: SeriesVisibilityChangeMode) {\n setBaseStructureRev((r) => r + 1);\n setFieldConfig(seriesVisibilityConfigFactory(label, mode, fieldConfig, data));\n },\n };\n\n return (\n <PanelContextProvider value={panelContext}>\n {dataWithConfig.length > MAX_NUMBER_OF_TIME_SERIES && !showAllTimeSeries && (\n <div className={cx([style.timeSeriesDisclaimer])}>\n <Icon className={style.disclaimerIcon} name=\"exclamation-triangle\" />\n {`Showing only ${MAX_NUMBER_OF_TIME_SERIES} time series. `}\n <span\n className={cx([style.showAllTimeSeries])}\n onClick={() => {\n structureChangesRef.current++;\n setShowAllTimeSeries(true);\n }}\n >{`Show all ${dataWithConfig.length}`}</span>\n </div>\n )}\n <PanelRenderer\n data={{ series: seriesToShow, timeRange, structureRev, state: loadingState, annotations }}\n pluginId=\"timeseries\"\n title=\"\"\n width={width}\n height={height}\n onChangeTimeRange={onChangeTime}\n timeZone={timeZone}\n options={\n {\n tooltip: { mode: tooltipDisplayMode },\n legend: { displayMode: LegendDisplayMode.List, placement: 'bottom', calcs: [] },\n } as TimeSeriesOptions\n }\n />\n </PanelContextProvider>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n timeSeriesDisclaimer: css`\n label: time-series-disclaimer;\n width: 300px;\n margin: ${theme.spacing(1)} auto;\n padding: 10px 0;\n border-radius: ${theme.spacing(2)};\n text-align: center;\n background-color: ${theme.colors.background.primary};\n `,\n disclaimerIcon: css`\n label: disclaimer-icon;\n color: ${theme.colors.warning.main};\n margin-right: ${theme.spacing(0.5)};\n `,\n showAllTimeSeries: css`\n label: show-all-time-series;\n cursor: pointer;\n color: ${theme.colors.text.link};\n `,\n});\n","import produce from 'immer';\nimport { FieldConfigSource } from '@grafana/data';\nimport { GraphDrawStyle, GraphFieldConfig, StackingMode } from '@grafana/schema';\nimport { ExploreGraphStyle } from 'app/core/utils/explore';\n\nexport type FieldConfig = FieldConfigSource<GraphFieldConfig>;\n\nexport function applyGraphStyle(config: FieldConfig, style: ExploreGraphStyle): FieldConfig {\n return produce(config, (draft) => {\n if (draft.defaults.custom === undefined) {\n draft.defaults.custom = {};\n }\n\n const { custom } = draft.defaults;\n\n if (custom.stacking === undefined) {\n custom.stacking = { group: 'A' };\n }\n\n switch (style) {\n case 'lines':\n custom.drawStyle = GraphDrawStyle.Line;\n custom.stacking.mode = StackingMode.None;\n custom.fillOpacity = 0;\n break;\n case 'bars':\n custom.drawStyle = GraphDrawStyle.Bars;\n custom.stacking.mode = StackingMode.None;\n custom.fillOpacity = 100;\n break;\n case 'points':\n custom.drawStyle = GraphDrawStyle.Points;\n custom.stacking.mode = StackingMode.None;\n custom.fillOpacity = 0;\n break;\n case 'stacked_lines':\n custom.drawStyle = GraphDrawStyle.Line;\n custom.stacking.mode = StackingMode.Normal;\n custom.fillOpacity = 100;\n break;\n case 'stacked_bars':\n custom.drawStyle = GraphDrawStyle.Bars;\n custom.stacking.mode = StackingMode.Normal;\n custom.fillOpacity = 100;\n break;\n default: {\n // should never happen\n // NOTE: casting to `never` will cause typescript\n // to verify that the switch statement checks every possible\n // enum-value\n const invalidValue: never = style;\n throw new Error(`Invalid graph-style: ${invalidValue}`);\n }\n }\n });\n}\n","import React, { PureComponent, createRef } from 'react';\nimport { css } from '@emotion/css';\nimport { capitalize } from 'lodash';\nimport memoizeOne from 'memoize-one';\nimport { TooltipDisplayMode } from '@grafana/schema';\nimport {\n rangeUtil,\n RawTimeRange,\n LogLevel,\n TimeZone,\n AbsoluteTimeRange,\n LogsDedupStrategy,\n LogRowModel,\n LogsDedupDescription,\n LogsMetaItem,\n LogsSortOrder,\n LinkModel,\n Field,\n DataQuery,\n DataFrame,\n GrafanaTheme2,\n LoadingState,\n} from '@grafana/data';\nimport {\n RadioButtonGroup,\n LogRows,\n Button,\n InlineField,\n InlineFieldRow,\n InlineSwitch,\n withTheme2,\n Themeable2,\n} from '@grafana/ui';\nimport store from 'app/core/store';\nimport { dedupLogRows, filterLogLevels } from 'app/core/logs_model';\nimport { LogsMetaRow } from './LogsMetaRow';\nimport LogsNavigation from './LogsNavigation';\nimport { RowContextOptions } from '@grafana/ui/src/components/Logs/LogRowContextProvider';\nimport { ExploreGraph } from './ExploreGraph';\n\nconst SETTINGS_KEYS = {\n showLabels: 'grafana.explore.logs.showLabels',\n showTime: 'grafana.explore.logs.showTime',\n wrapLogMessage: 'grafana.explore.logs.wrapLogMessage',\n prettifyLogMessage: 'grafana.explore.logs.prettifyLogMessage',\n};\n\ninterface Props extends Themeable2 {\n width: number;\n logRows: LogRowModel[];\n logsMeta?: LogsMetaItem[];\n logsSeries?: DataFrame[];\n logsQueries?: DataQuery[];\n visibleRange?: AbsoluteTimeRange;\n theme: GrafanaTheme2;\n loading: boolean;\n loadingState: LoadingState;\n absoluteRange: AbsoluteTimeRange;\n timeZone: TimeZone;\n scanning?: boolean;\n scanRange?: RawTimeRange;\n showContextToggle?: (row?: LogRowModel) => boolean;\n onChangeTime: (range: AbsoluteTimeRange) => void;\n onClickFilterLabel?: (key: string, value: string) => void;\n onClickFilterOutLabel?: (key: string, value: string) => void;\n onStartScanning?: () => void;\n onStopScanning?: () => void;\n getRowContext?: (row: LogRowModel, options?: RowContextOptions) => Promise<any>;\n getFieldLinks: (field: Field, rowIndex: number) => Array<LinkModel<Field>>;\n addResultsToCache: () => void;\n clearCache: () => void;\n}\n\ninterface State {\n showLabels: boolean;\n showTime: boolean;\n wrapLogMessage: boolean;\n prettifyLogMessage: boolean;\n dedupStrategy: LogsDedupStrategy;\n hiddenLogLevels: LogLevel[];\n logsSortOrder: LogsSortOrder | null;\n isFlipping: boolean;\n showDetectedFields: string[];\n forceEscape: boolean;\n}\n\nclass UnthemedLogs extends PureComponent<Props, State> {\n flipOrderTimer?: number;\n cancelFlippingTimer?: number;\n topLogsRef = createRef<HTMLDivElement>();\n\n state: State = {\n showLabels: store.getBool(SETTINGS_KEYS.showLabels, false),\n showTime: store.getBool(SETTINGS_KEYS.showTime, true),\n wrapLogMessage: store.getBool(SETTINGS_KEYS.wrapLogMessage, true),\n prettifyLogMessage: store.getBool(SETTINGS_KEYS.prettifyLogMessage, false),\n dedupStrategy: LogsDedupStrategy.none,\n hiddenLogLevels: [],\n logsSortOrder: null,\n isFlipping: false,\n showDetectedFields: [],\n forceEscape: false,\n };\n\n componentWillUnmount() {\n if (this.flipOrderTimer) {\n window.clearTimeout(this.flipOrderTimer);\n }\n\n if (this.cancelFlippingTimer) {\n window.clearTimeout(this.cancelFlippingTimer);\n }\n }\n\n onChangeLogsSortOrder = () => {\n this.setState({ isFlipping: true });\n // we are using setTimeout here to make sure that disabled button is rendered before the rendering of reordered logs\n this.flipOrderTimer = window.setTimeout(() => {\n this.setState((prevState) => {\n if (prevState.logsSortOrder === null || prevState.logsSortOrder === LogsSortOrder.Descending) {\n return { logsSortOrder: LogsSortOrder.Ascending };\n }\n return { logsSortOrder: LogsSortOrder.Descending };\n });\n }, 0);\n this.cancelFlippingTimer = window.setTimeout(() => this.setState({ isFlipping: false }), 1000);\n };\n\n onEscapeNewlines = () => {\n this.setState((prevState) => ({\n forceEscape: !prevState.forceEscape,\n }));\n };\n\n onChangeDedup = (dedupStrategy: LogsDedupStrategy) => {\n this.setState({ dedupStrategy });\n };\n\n onChangeLabels = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { target } = event;\n if (target) {\n const showLabels = target.checked;\n this.setState({\n showLabels,\n });\n store.set(SETTINGS_KEYS.showLabels, showLabels);\n }\n };\n\n onChangeTime = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { target } = event;\n if (target) {\n const showTime = target.checked;\n this.setState({\n showTime,\n });\n store.set(SETTINGS_KEYS.showTime, showTime);\n }\n };\n\n onChangewrapLogMessage = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { target } = event;\n if (target) {\n const wrapLogMessage = target.checked;\n this.setState({\n wrapLogMessage,\n });\n store.set(SETTINGS_KEYS.wrapLogMessage, wrapLogMessage);\n }\n };\n\n onChangePrettifyLogMessage = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { target } = event;\n if (target) {\n const prettifyLogMessage = target.checked;\n this.setState({\n prettifyLogMessage,\n });\n store.set(SETTINGS_KEYS.prettifyLogMessage, prettifyLogMessage);\n }\n };\n\n onToggleLogLevel = (hiddenRawLevels: string[]) => {\n const hiddenLogLevels = hiddenRawLevels.map((level) => LogLevel[level as LogLevel]);\n this.setState({ hiddenLogLevels });\n };\n\n onClickScan = (event: React.SyntheticEvent) => {\n event.preventDefault();\n if (this.props.onStartScanning) {\n this.props.onStartScanning();\n }\n };\n\n onClickStopScan = (event: React.SyntheticEvent) => {\n event.preventDefault();\n if (this.props.onStopScanning) {\n this.props.onStopScanning();\n }\n };\n\n showDetectedField = (key: string) => {\n const index = this.state.showDetectedFields.indexOf(key);\n\n if (index === -1) {\n this.setState((state) => {\n return {\n showDetectedFields: state.showDetectedFields.concat(key),\n };\n });\n }\n };\n\n hideDetectedField = (key: string) => {\n const index = this.state.showDetectedFields.indexOf(key);\n if (index > -1) {\n this.setState((state) => {\n return {\n showDetectedFields: state.showDetectedFields.filter((k) => key !== k),\n };\n });\n }\n };\n\n clearDetectedFields = () => {\n this.setState((state) => {\n return {\n showDetectedFields: [],\n };\n });\n };\n\n checkUnescapedContent = memoizeOne((logRows: LogRowModel[]) => {\n return !!logRows.some((r) => r.hasUnescapedContent);\n });\n\n dedupRows = memoizeOne((logRows: LogRowModel[], dedupStrategy: LogsDedupStrategy) => {\n const dedupedRows = dedupLogRows(logRows, dedupStrategy);\n const dedupCount = dedupedRows.reduce((sum, row) => (row.duplicates ? sum + row.duplicates : sum), 0);\n return { dedupedRows, dedupCount };\n });\n\n filterRows = memoizeOne((logRows: LogRowModel[], hiddenLogLevels: LogLevel[]) => {\n return filterLogLevels(logRows, new Set(hiddenLogLevels));\n });\n\n scrollToTopLogs = () => this.topLogsRef.current?.scrollIntoView();\n\n render() {\n const {\n width,\n logRows,\n logsMeta,\n logsSeries,\n visibleRange,\n loading = false,\n loadingState,\n onClickFilterLabel,\n onClickFilterOutLabel,\n timeZone,\n scanning,\n scanRange,\n showContextToggle,\n absoluteRange,\n onChangeTime,\n getFieldLinks,\n theme,\n logsQueries,\n clearCache,\n addResultsToCache,\n } = this.props;\n\n const {\n showLabels,\n showTime,\n wrapLogMessage,\n prettifyLogMessage,\n dedupStrategy,\n hiddenLogLevels,\n logsSortOrder,\n isFlipping,\n showDetectedFields,\n forceEscape,\n } = this.state;\n\n const styles = getStyles(theme, wrapLogMessage);\n const hasData = logRows && logRows.length > 0;\n const hasUnescapedContent = this.checkUnescapedContent(logRows);\n\n const filteredLogs = this.filterRows(logRows, hiddenLogLevels);\n const { dedupedRows, dedupCount } = this.dedupRows(filteredLogs, dedupStrategy);\n\n const scanText = scanRange ? `Scanning ${rangeUtil.describeTimeRange(scanRange)}` : 'Scanning...';\n\n return (\n <>\n {logsSeries && logsSeries.length ? (\n <>\n <div className={styles.infoText}>\n This datasource does not support full-range histograms. The graph is based on the logs seen in the\n response.\n </div>\n <ExploreGraph\n graphStyle=\"lines\"\n data={logsSeries}\n height={150}\n width={width}\n tooltipDisplayMode={TooltipDisplayMode.Multi}\n absoluteRange={visibleRange || absoluteRange}\n timeZone={timeZone}\n loadingState={loadingState}\n onChangeTime={onChangeTime}\n onHiddenSeriesChanged={this.onToggleLogLevel}\n />\n </>\n ) : undefined}\n <div className={styles.logOptions} ref={this.topLogsRef}>\n <InlineFieldRow>\n <InlineField label=\"Time\" transparent>\n <InlineSwitch value={showTime} onChange={this.onChangeTime} transparent id=\"show-time\" />\n </InlineField>\n <InlineField label=\"Unique labels\" transparent>\n <InlineSwitch value={showLabels} onChange={this.onChangeLabels} transparent id=\"unique-labels\" />\n </InlineField>\n <InlineField label=\"Wrap lines\" transparent>\n <InlineSwitch value={wrapLogMessage} onChange={this.onChangewrapLogMessage} transparent id=\"wrap-lines\" />\n </InlineField>\n <InlineField label=\"Prettify JSON\" transparent>\n <InlineSwitch\n value={prettifyLogMessage}\n onChange={this.onChangePrettifyLogMessage}\n transparent\n id=\"prettify\"\n />\n </InlineField>\n <InlineField label=\"Dedup\" transparent>\n <RadioButtonGroup\n options={Object.values(LogsDedupStrategy).map((dedupType) => ({\n label: capitalize(dedupType),\n value: dedupType,\n description: LogsDedupDescription[dedupType],\n }))}\n value={dedupStrategy}\n onChange={this.onChangeDedup}\n className={styles.radioButtons}\n />\n </InlineField>\n </InlineFieldRow>\n <div>\n <Button\n variant=\"secondary\"\n disabled={isFlipping}\n title={logsSortOrder === LogsSortOrder.Ascending ? 'Change to newest first' : 'Change to oldest first'}\n aria-label=\"Flip results order\"\n className={styles.headerButton}\n onClick={this.onChangeLogsSortOrder}\n >\n {isFlipping ? 'Flipping...' : 'Flip results order'}\n </Button>\n </div>\n </div>\n <LogsMetaRow\n logRows={logRows}\n meta={logsMeta || []}\n dedupStrategy={dedupStrategy}\n dedupCount={dedupCount}\n hasUnescapedContent={hasUnescapedContent}\n forceEscape={forceEscape}\n showDetectedFields={showDetectedFields}\n onEscapeNewlines={this.onEscapeNewlines}\n clearDetectedFields={this.clearDetectedFields}\n />\n <div className={styles.logsSection}>\n <div className={styles.logRows}>\n <LogRows\n logRows={logRows}\n deduplicatedRows={dedupedRows}\n dedupStrategy={dedupStrategy}\n getRowContext={this.props.getRowContext}\n onClickFilterLabel={onClickFilterLabel}\n onClickFilterOutLabel={onClickFilterOutLabel}\n showContextToggle={showContextToggle}\n showLabels={showLabels}\n showTime={showTime}\n enableLogDetails={true}\n forceEscape={forceEscape}\n wrapLogMessage={wrapLogMessage}\n prettifyLogMessage={prettifyLogMessage}\n timeZone={timeZone}\n getFieldLinks={getFieldLinks}\n logsSortOrder={logsSortOrder}\n showDetectedFields={showDetectedFields}\n onClickShowDetectedField={this.showDetectedField}\n onClickHideDetectedField={this.hideDetectedField}\n />\n </div>\n <LogsNavigation\n logsSortOrder={logsSortOrder}\n visibleRange={visibleRange ?? absoluteRange}\n absoluteRange={absoluteRange}\n timeZone={timeZone}\n onChangeTime={onChangeTime}\n loading={loading}\n queries={logsQueries ?? []}\n scrollToTopLogs={this.scrollToTopLogs}\n addResultsToCache={addResultsToCache}\n clearCache={clearCache}\n />\n </div>\n {!loading && !hasData && !scanning && (\n <div className={styles.noData}>\n No logs found.\n <Button size=\"xs\" fill=\"text\" onClick={this.onClickScan}>\n Scan for older logs\n </Button>\n </div>\n )}\n\n {scanning && (\n <div className={styles.noData}>\n <span>{scanText}</span>\n <Button size=\"xs\" fill=\"text\" onClick={this.onClickStopScan}>\n Stop scan\n </Button>\n </div>\n )}\n </>\n );\n }\n}\n\nexport const Logs = withTheme2(UnthemedLogs);\n\nconst getStyles = (theme: GrafanaTheme2, wrapLogMessage: boolean) => {\n return {\n noData: css`\n > * {\n margin-left: 0.5em;\n }\n `,\n logOptions: css`\n display: flex;\n justify-content: space-between;\n align-items: baseline;\n flex-wrap: wrap;\n background-color: ${theme.colors.background.primary};\n padding: ${theme.spacing(1, 2)};\n border-radius: ${theme.shape.borderRadius()};\n margin: ${theme.spacing(2, 0, 1)};\n border: 1px solid ${theme.colors.border.medium};\n `,\n headerButton: css`\n margin: ${theme.spacing(0.5, 0, 0, 1)};\n `,\n radioButtons: css`\n margin: 0 ${theme.spacing(1)};\n `,\n logsSection: css`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n `,\n logRows: css`\n overflow-x: ${wrapLogMessage ? 'unset' : 'scroll'};\n overflow-y: visible;\n width: 100%;\n `,\n infoText: css`\n font-size: ${theme.typography.size.sm};\n color: ${theme.colors.text.secondary};\n `,\n };\n};\n","import React from 'react';\nimport memoizeOne from 'memoize-one';\nimport { css } from '@emotion/css';\nimport { CSSTransition } from 'react-transition-group';\n\nconst transitionDuration = 500;\n// We add a bit of delay to the transition as another perf optimisation. As at the start we need to render\n// quite a bit of new rows, if we start transition at the same time there can be frame rate drop. This gives time\n// for react to first render them and then do the animation.\nconst transitionDelay = 100;\n\nconst getStyles = memoizeOne(() => {\n return {\n logsEnter: css`\n label: logsEnter;\n position: absolute;\n opacity: 0;\n height: auto;\n width: 100%;\n `,\n logsEnterActive: css`\n label: logsEnterActive;\n opacity: 1;\n transition: opacity ${transitionDuration}ms ease-out ${transitionDelay}ms;\n `,\n logsExit: css`\n label: logsExit;\n position: absolute;\n opacity: 1;\n height: auto;\n width: 100%;\n `,\n logsExitActive: css`\n label: logsExitActive;\n opacity: 0;\n transition: opacity ${transitionDuration}ms ease-out ${transitionDelay}ms;\n `,\n };\n});\n\ntype Props = {\n children: React.ReactNode;\n visible: boolean;\n};\n\n/**\n * Cross fade transition component that is tied a bit too much to the logs containers so not very useful elsewhere\n * right now.\n */\nexport function LogsCrossFadeTransition(props: Props) {\n const { visible, children } = props;\n const styles = getStyles();\n return (\n <CSSTransition\n in={visible}\n mountOnEnter={true}\n unmountOnExit={true}\n timeout={transitionDuration + transitionDelay}\n classNames={{\n enter: styles.logsEnter,\n enterActive: styles.logsEnterActive,\n exit: styles.logsExit,\n exitActive: styles.logsExitActive,\n }}\n >\n {children}\n </CSSTransition>\n );\n}\n","import React, { useCallback } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { RefreshPicker } from '@grafana/ui';\n\nimport { changeRefreshInterval } from './state/time';\nimport { setPausedStateAction, runQueries } from './state/query';\nimport { ExploreId } from '../../types';\n\n/**\n * Hook that gives you all the functions needed to control the live tailing.\n */\nexport function useLiveTailControls(exploreId: ExploreId) {\n const dispatch = useDispatch();\n\n const pause = useCallback(() => {\n dispatch(setPausedStateAction({ exploreId, isPaused: true }));\n }, [exploreId, dispatch]);\n\n const resume = useCallback(() => {\n dispatch(setPausedStateAction({ exploreId, isPaused: false }));\n }, [exploreId, dispatch]);\n\n const stop = useCallback(() => {\n // We need to pause here first because there is transition where we are not live but live logs are still shown\n // to cross fade with the normal view. This will prevent reordering of the logs in the live view during the\n // transition.\n pause();\n\n // TODO referencing this from perspective of refresh picker when there is designated button for it now is not\n // great. Needs a bit of refactoring.\n dispatch(changeRefreshInterval(exploreId, RefreshPicker.offOption.value));\n dispatch(runQueries(exploreId));\n }, [exploreId, dispatch, pause]);\n\n const start = useCallback(() => {\n dispatch(changeRefreshInterval(exploreId, RefreshPicker.liveOption.value));\n }, [exploreId, dispatch]);\n\n return {\n pause,\n resume,\n stop,\n start,\n };\n}\n\ntype Props = {\n exploreId: ExploreId;\n children: (controls: ReturnType<typeof useLiveTailControls>) => React.ReactElement;\n};\n\n/**\n * If you can't use the hook you can use this as a render prop pattern.\n */\nexport function LiveTailControls(props: Props) {\n const controls = useLiveTailControls(props.exploreId);\n return props.children(controls);\n}\n","import React, { PureComponent } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\nimport { css } from '@emotion/css';\nimport { Collapse } from '@grafana/ui';\nimport {\n AbsoluteTimeRange,\n Field,\n hasLogsContextSupport,\n LoadingState,\n LogRowModel,\n RawTimeRange,\n} from '@grafana/data';\nimport { ExploreId, ExploreItemState } from 'app/types/explore';\nimport { StoreState } from 'app/types';\nimport { splitOpen } from './state/main';\nimport { addResultsToCache, clearCache } from './state/query';\nimport { updateTimeRange } from './state/time';\nimport { getTimeZone } from '../profile/state/selectors';\nimport { LiveLogsWithTheme } from './LiveLogs';\nimport { Logs } from './Logs';\nimport { LogsCrossFadeTransition } from './utils/LogsCrossFadeTransition';\nimport { LiveTailControls } from './useLiveTailControls';\nimport { getFieldLinksForExplore } from './utils/links';\n\ninterface LogsContainerProps extends PropsFromRedux {\n width: number;\n exploreId: ExploreId;\n scanRange?: RawTimeRange;\n syncedTimes: boolean;\n loadingState: LoadingState;\n onClickFilterLabel?: (key: string, value: string) => void;\n onClickFilterOutLabel?: (key: string, value: string) => void;\n onStartScanning: () => void;\n onStopScanning: () => void;\n}\n\nclass LogsContainer extends PureComponent<LogsContainerProps> {\n onChangeTime = (absoluteRange: AbsoluteTimeRange) => {\n const { exploreId, updateTimeRange } = this.props;\n updateTimeRange({ exploreId, absoluteRange });\n };\n\n getLogRowContext = async (row: LogRowModel, options?: any): Promise<any> => {\n const { datasourceInstance } = this.props;\n\n if (hasLogsContextSupport(datasourceInstance)) {\n return datasourceInstance.getLogRowContext(row, options);\n }\n\n return [];\n };\n\n showContextToggle = (row?: LogRowModel): boolean => {\n const { datasourceInstance } = this.props;\n\n if (hasLogsContextSupport(datasourceInstance)) {\n return datasourceInstance.showContextToggle(row);\n }\n\n return false;\n };\n\n getFieldLinks = (field: Field, rowIndex: number) => {\n const { splitOpen: splitOpenFn, range } = this.props;\n return getFieldLinksForExplore({ field, rowIndex, splitOpenFn, range });\n };\n\n render() {\n const {\n loading,\n loadingState,\n logRows,\n logsMeta,\n logsSeries,\n logsQueries,\n onClickFilterLabel,\n onClickFilterOutLabel,\n onStartScanning,\n onStopScanning,\n absoluteRange,\n timeZone,\n visibleRange,\n scanning,\n range,\n width,\n isLive,\n exploreId,\n addResultsToCache,\n clearCache,\n } = this.props;\n\n if (!logRows) {\n return null;\n }\n\n // We need to override css overflow of divs in Collapse element to enable sticky Logs navigation\n const styleOverridesForStickyNavigation = css`\n & > div {\n overflow: visible;\n & > div {\n overflow: visible;\n }\n }\n `;\n\n return (\n <>\n <LogsCrossFadeTransition visible={isLive}>\n <Collapse label=\"Logs\" loading={false} isOpen>\n <LiveTailControls exploreId={exploreId}>\n {(controls) => (\n <LiveLogsWithTheme\n logRows={logRows}\n timeZone={timeZone}\n stopLive={controls.stop}\n isPaused={this.props.isPaused}\n onPause={controls.pause}\n onResume={controls.resume}\n />\n )}\n </LiveTailControls>\n </Collapse>\n </LogsCrossFadeTransition>\n <LogsCrossFadeTransition visible={!isLive}>\n <Collapse label=\"Logs\" loading={loading} isOpen className={styleOverridesForStickyNavigation}>\n <Logs\n logRows={logRows}\n logsMeta={logsMeta}\n logsSeries={logsSeries}\n logsQueries={logsQueries}\n width={width}\n loading={loading}\n loadingState={loadingState}\n onChangeTime={this.onChangeTime}\n onClickFilterLabel={onClickFilterLabel}\n onClickFilterOutLabel={onClickFilterOutLabel}\n onStartScanning={onStartScanning}\n onStopScanning={onStopScanning}\n absoluteRange={absoluteRange}\n visibleRange={visibleRange}\n timeZone={timeZone}\n scanning={scanning}\n scanRange={range.raw}\n showContextToggle={this.showContextToggle}\n getRowContext={this.getLogRowContext}\n getFieldLinks={this.getFieldLinks}\n addResultsToCache={() => addResultsToCache(exploreId)}\n clearCache={() => clearCache(exploreId)}\n />\n </Collapse>\n </LogsCrossFadeTransition>\n </>\n );\n }\n}\n\nfunction mapStateToProps(state: StoreState, { exploreId }: { exploreId: string }) {\n const explore = state.explore;\n // @ts-ignore\n const item: ExploreItemState = explore[exploreId];\n const {\n logsResult,\n loading,\n scanning,\n datasourceInstance,\n isLive,\n isPaused,\n range,\n absoluteRange,\n logsVolumeDataProvider,\n logsVolumeData,\n } = item;\n const timeZone = getTimeZone(state.user);\n\n return {\n loading,\n logRows: logsResult?.rows,\n logsMeta: logsResult?.meta,\n logsSeries: logsResult?.series,\n logsQueries: logsResult?.queries,\n visibleRange: logsResult?.visibleRange,\n scanning,\n timeZone,\n datasourceInstance,\n isLive,\n isPaused,\n range,\n absoluteRange,\n logsVolumeDataProvider,\n logsVolumeData,\n };\n}\n\nconst mapDispatchToProps = {\n updateTimeRange,\n splitOpen,\n addResultsToCache,\n clearCache,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\ntype PropsFromRedux = ConnectedProps<typeof connector>;\n\nexport default connector(LogsContainer);\n","import { ExploreId, StoreState } from 'app/types';\n\nexport const isSplit = (state: StoreState) => Boolean(state.explore[ExploreId.left] && state.explore[ExploreId.right]);\n\nexport const getExploreItemSelector = (exploreId: ExploreId) => (state: StoreState) => state.explore[exploreId];\n","import React, { useCallback, useMemo } from 'react';\nimport { ExploreId } from 'app/types/explore';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { getDatasourceSrv } from '../plugins/datasource_srv';\nimport { runQueries, changeQueriesAction } from './state/query';\nimport { CoreApp, DataQuery } from '@grafana/data';\nimport { getNextRefIdChar } from 'app/core/utils/query';\nimport { QueryEditorRows } from '../query/components/QueryEditorRows';\nimport { createSelector } from '@reduxjs/toolkit';\nimport { getExploreItemSelector } from './state/selectors';\n\ninterface Props {\n exploreId: ExploreId;\n}\n\nconst makeSelectors = (exploreId: ExploreId) => {\n const exploreItemSelector = getExploreItemSelector(exploreId);\n return {\n getQueries: createSelector(exploreItemSelector, (s) => s!.queries),\n getQueryResponse: createSelector(exploreItemSelector, (s) => s!.queryResponse),\n getHistory: createSelector(exploreItemSelector, (s) => s!.history),\n getEventBridge: createSelector(exploreItemSelector, (s) => s!.eventBridge),\n getDatasourceInstanceSettings: createSelector(\n exploreItemSelector,\n (s) => getDatasourceSrv().getInstanceSettings(s!.datasourceInstance?.uid)!\n ),\n };\n};\n\nexport const QueryRows = ({ exploreId }: Props) => {\n const dispatch = useDispatch();\n const { getQueries, getDatasourceInstanceSettings, getQueryResponse, getHistory, getEventBridge } = useMemo(\n () => makeSelectors(exploreId),\n [exploreId]\n );\n\n const queries = useSelector(getQueries)!;\n const dsSettings = useSelector(getDatasourceInstanceSettings)!;\n const queryResponse = useSelector(getQueryResponse)!;\n const history = useSelector(getHistory);\n const eventBridge = useSelector(getEventBridge);\n\n const onRunQueries = useCallback(() => {\n dispatch(runQueries(exploreId));\n }, [dispatch, exploreId]);\n\n const onChange = useCallback(\n (newQueries: DataQuery[]) => {\n dispatch(changeQueriesAction({ queries: newQueries, exploreId }));\n\n // if we are removing a query we want to run the remaining ones\n if (newQueries.length < queries.length) {\n onRunQueries();\n }\n },\n [dispatch, exploreId, onRunQueries, queries]\n );\n\n const onAddQuery = useCallback(\n (query: DataQuery) => {\n onChange([...queries, { ...query, refId: getNextRefIdChar(queries) }]);\n },\n [onChange, queries]\n );\n\n return (\n <QueryEditorRows\n dsSettings={dsSettings}\n queries={queries}\n onQueriesChange={onChange}\n onAddQuery={onAddQuery}\n onRunQueries={onRunQueries}\n data={queryResponse}\n app={CoreApp.Explore}\n history={history}\n eventBus={eventBridge}\n />\n );\n};\n","import React, { PureComponent } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\nimport { ValueLinkConfig, applyFieldOverrides, TimeZone } from '@grafana/data';\nimport { Collapse, Table } from '@grafana/ui';\nimport { ExploreId, ExploreItemState } from 'app/types/explore';\nimport { StoreState } from 'app/types';\nimport { splitOpen } from './state/main';\nimport { config } from 'app/core/config';\nimport { PANEL_BORDER } from 'app/core/constants';\nimport { MetaInfoText } from './MetaInfoText';\nimport { FilterItem } from '@grafana/ui/src/components/Table/types';\nimport { getFieldLinksForExplore } from './utils/links';\n\ninterface TableContainerProps {\n ariaLabel?: string;\n exploreId: ExploreId;\n width: number;\n timeZone: TimeZone;\n onCellFilterAdded?: (filter: FilterItem) => void;\n}\n\nfunction mapStateToProps(state: StoreState, { exploreId }: TableContainerProps) {\n const explore = state.explore;\n // @ts-ignore\n const item: ExploreItemState = explore[exploreId];\n const { loading: loadingInState, tableResult, range } = item;\n const loading = tableResult && tableResult.length > 0 ? false : loadingInState;\n return { loading, tableResult, range };\n}\n\nconst mapDispatchToProps = {\n splitOpen,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\ntype Props = TableContainerProps & ConnectedProps<typeof connector>;\n\nexport class TableContainer extends PureComponent<Props> {\n getTableHeight() {\n const { tableResult } = this.props;\n\n if (!tableResult || tableResult.length === 0) {\n return 200;\n }\n\n // tries to estimate table height\n return Math.max(Math.min(600, tableResult.length * 35) + 35);\n }\n\n render() {\n const { loading, onCellFilterAdded, tableResult, width, splitOpen, range, ariaLabel, timeZone } = this.props;\n const height = this.getTableHeight();\n const tableWidth = width - config.theme.panelPadding * 2 - PANEL_BORDER;\n\n let dataFrame = tableResult;\n\n if (dataFrame?.length) {\n dataFrame = applyFieldOverrides({\n data: [dataFrame],\n timeZone,\n theme: config.theme2,\n replaceVariables: (v: string) => v,\n fieldConfig: {\n defaults: {},\n overrides: [],\n },\n })[0];\n // Bit of code smell here. We need to add links here to the frame modifying the frame on every render.\n // Should work fine in essence but still not the ideal way to pass props. In logs container we do this\n // differently and sidestep this getLinks API on a dataframe\n for (const field of dataFrame.fields) {\n field.getLinks = (config: ValueLinkConfig) => {\n return getFieldLinksForExplore({ field, rowIndex: config.valueRowIndex!, splitOpenFn: splitOpen, range });\n };\n }\n }\n\n return (\n <Collapse label=\"Table\" loading={loading} isOpen>\n {dataFrame?.length ? (\n <Table\n ariaLabel={ariaLabel}\n data={dataFrame}\n width={tableWidth}\n height={height}\n onCellFilterAdded={onCellFilterAdded}\n />\n ) : (\n <MetaInfoText metaItems={[{ value: '0 series returned' }]} />\n )}\n </Collapse>\n );\n }\n}\n\nexport default connector(TableContainer);\n","import React from 'react';\nimport { css } from '@emotion/css';\nimport { stylesFactory, useTheme, Select, Button, Switch, Field } from '@grafana/ui';\nimport { GrafanaTheme, SelectableValue } from '@grafana/data';\nimport appEvents from 'app/core/app_events';\nimport { ShowConfirmModalEvent } from '../../../types/events';\nimport { dispatch } from 'app/store/store';\nimport { notifyApp } from 'app/core/actions';\nimport { createSuccessNotification } from 'app/core/copy/appNotification';\nimport { MAX_HISTORY_ITEMS } from '../../../core/utils/richHistory';\n\nexport interface RichHistorySettingsProps {\n retentionPeriod: number;\n starredTabAsFirstTab: boolean;\n activeDatasourceOnly: boolean;\n onChangeRetentionPeriod: (option: SelectableValue<number>) => void;\n toggleStarredTabAsFirstTab: () => void;\n toggleactiveDatasourceOnly: () => void;\n deleteRichHistory: () => void;\n}\n\nconst getStyles = stylesFactory((theme: GrafanaTheme) => {\n return {\n container: css`\n font-size: ${theme.typography.size.sm};\n .space-between {\n margin-bottom: ${theme.spacing.lg};\n }\n `,\n input: css`\n max-width: 200px;\n `,\n switch: css`\n display: flex;\n align-items: center;\n `,\n label: css`\n margin-left: ${theme.spacing.md};\n `,\n };\n});\n\nconst retentionPeriodOptions = [\n { value: 2, label: '2 days' },\n { value: 5, label: '5 days' },\n { value: 7, label: '1 week' },\n { value: 14, label: '2 weeks' },\n];\n\nexport function RichHistorySettings(props: RichHistorySettingsProps) {\n const {\n retentionPeriod,\n starredTabAsFirstTab,\n activeDatasourceOnly,\n onChangeRetentionPeriod,\n toggleStarredTabAsFirstTab,\n toggleactiveDatasourceOnly,\n deleteRichHistory,\n } = props;\n const theme = useTheme();\n const styles = getStyles(theme);\n const selectedOption = retentionPeriodOptions.find((v) => v.value === retentionPeriod);\n\n const onDelete = () => {\n appEvents.publish(\n new ShowConfirmModalEvent({\n title: 'Delete',\n text: 'Are you sure you want to permanently delete your query history?',\n yesText: 'Delete',\n icon: 'trash-alt',\n onConfirm: () => {\n deleteRichHistory();\n dispatch(notifyApp(createSuccessNotification('Query history deleted')));\n },\n })\n );\n };\n\n return (\n <div className={styles.container}>\n <Field\n label=\"History time span\"\n description={`Select the period of time for which Grafana will save your query history. Up to ${MAX_HISTORY_ITEMS} entries will be stored.`}\n className=\"space-between\"\n >\n <div className={styles.input}>\n <Select\n menuShouldPortal\n value={selectedOption}\n options={retentionPeriodOptions}\n onChange={onChangeRetentionPeriod}\n ></Select>\n </div>\n </Field>\n <Field label=\"Default active tab\" description=\" \" className=\"space-between\">\n <div className={styles.switch}>\n <Switch value={starredTabAsFirstTab} onChange={toggleStarredTabAsFirstTab}></Switch>\n <div className={styles.label}>Change the default active tab from “Query history” to “Starred”</div>\n </div>\n </Field>\n <Field label=\"Data source behaviour\" description=\" \" className=\"space-between\">\n <div className={styles.switch}>\n <Switch value={activeDatasourceOnly} onChange={toggleactiveDatasourceOnly}></Switch>\n <div className={styles.label}>Only show queries for data source currently active in Explore</div>\n </div>\n </Field>\n <div\n className={css`\n font-weight: ${theme.typography.weight.bold};\n `}\n >\n Clear query history\n </div>\n <div\n className={css`\n margin-bottom: ${theme.spacing.sm};\n `}\n >\n Delete all of your query history, permanently.\n </div>\n <Button variant=\"destructive\" onClick={onDelete}>\n Clear query history\n </Button>\n </div>\n );\n}\n","import React, { useState, useEffect } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\nimport { css, cx } from '@emotion/css';\nimport { stylesFactory, useTheme, TextArea, Button, IconButton } from '@grafana/ui';\nimport { getDataSourceSrv } from '@grafana/runtime';\nimport { GrafanaTheme, DataSourceApi } from '@grafana/data';\nimport { RichHistoryQuery, ExploreId } from 'app/types/explore';\nimport { createUrlFromRichHistory, createQueryText } from 'app/core/utils/richHistory';\nimport { createAndCopyShortLink } from 'app/core/utils/shortLinks';\nimport { copyStringToClipboard } from 'app/core/utils/explore';\nimport appEvents from 'app/core/app_events';\nimport { dispatch } from 'app/store/store';\nimport { notifyApp } from 'app/core/actions';\nimport { createSuccessNotification } from 'app/core/copy/appNotification';\nimport { StoreState } from 'app/types';\n\nimport { updateRichHistory } from '../state/history';\nimport { changeDatasource } from '../state/datasource';\nimport { setQueries } from '../state/query';\nimport { ShowConfirmModalEvent } from '../../../types/events';\n\nfunction mapStateToProps(state: StoreState, { exploreId }: { exploreId: ExploreId }) {\n const explore = state.explore;\n const { datasourceInstance } = explore[exploreId]!;\n return {\n exploreId,\n datasourceInstance,\n };\n}\n\nconst mapDispatchToProps = {\n changeDatasource,\n updateRichHistory,\n setQueries,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\ninterface OwnProps {\n query: RichHistoryQuery;\n dsImg: string;\n isRemoved: boolean;\n}\n\nexport type Props = ConnectedProps<typeof connector> & OwnProps;\n\nconst getStyles = stylesFactory((theme: GrafanaTheme, isRemoved: boolean) => {\n /* Hard-coded value so all buttons and icons on right side of card are aligned */\n const rigtColumnWidth = '240px';\n const rigtColumnContentWidth = '170px';\n\n /* If datasource was removed, card will have inactive color */\n const cardColor = theme.colors.bg2;\n\n return {\n queryCard: css`\n display: flex;\n flex-direction: column;\n border: 1px solid ${theme.colors.border1};\n margin: ${theme.spacing.sm} 0;\n background-color: ${cardColor};\n border-radius: ${theme.border.radius.sm};\n .starred {\n color: ${theme.palette.orange};\n }\n `,\n cardRow: css`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ${theme.spacing.sm};\n border-bottom: none;\n :first-of-type {\n border-bottom: 1px solid ${theme.colors.border1};\n padding: ${theme.spacing.xs} ${theme.spacing.sm};\n }\n img {\n height: ${theme.typography.size.base};\n max-width: ${theme.typography.size.base};\n margin-right: ${theme.spacing.sm};\n }\n `,\n datasourceContainer: css`\n display: flex;\n align-items: center;\n font-size: ${theme.typography.size.sm};\n font-weight: ${theme.typography.weight.semibold};\n `,\n queryActionButtons: css`\n max-width: ${rigtColumnContentWidth};\n display: flex;\n justify-content: flex-end;\n font-size: ${theme.typography.size.base};\n button {\n margin-left: ${theme.spacing.sm};\n }\n `,\n queryContainer: css`\n font-weight: ${theme.typography.weight.semibold};\n width: calc(100% - ${rigtColumnWidth});\n `,\n queryRow: css`\n border-top: 1px solid ${theme.colors.border1};\n word-break: break-all;\n padding: 4px 2px;\n :first-child {\n border-top: none;\n padding: 0 0 4px 0;\n }\n `,\n updateCommentContainer: css`\n width: calc(100% + ${rigtColumnWidth});\n margin-top: ${theme.spacing.sm};\n `,\n comment: css`\n overflow-wrap: break-word;\n font-size: ${theme.typography.size.sm};\n font-weight: ${theme.typography.weight.regular};\n margin-top: ${theme.spacing.xs};\n `,\n commentButtonRow: css`\n > * {\n margin-right: ${theme.spacing.sm};\n }\n `,\n textArea: css`\n width: 100%;\n `,\n runButton: css`\n max-width: ${rigtColumnContentWidth};\n display: flex;\n justify-content: flex-end;\n button {\n height: auto;\n padding: ${theme.spacing.xs} ${theme.spacing.md};\n line-height: 1.4;\n span {\n white-space: normal !important;\n }\n }\n `,\n };\n});\n\nexport function RichHistoryCard(props: Props) {\n const {\n query,\n dsImg,\n isRemoved,\n updateRichHistory,\n changeDatasource,\n exploreId,\n datasourceInstance,\n setQueries,\n } = props;\n const [activeUpdateComment, setActiveUpdateComment] = useState(false);\n const [comment, setComment] = useState<string | undefined>(query.comment);\n const [queryDsInstance, setQueryDsInstance] = useState<DataSourceApi | undefined>(undefined);\n\n useEffect(() => {\n const getQueryDsInstance = async () => {\n const ds = await getDataSourceSrv().get(query.datasourceName);\n setQueryDsInstance(ds);\n };\n\n getQueryDsInstance();\n }, [query.datasourceName]);\n\n const theme = useTheme();\n const styles = getStyles(theme, isRemoved);\n\n const onRunQuery = async () => {\n const queriesToRun = query.queries;\n if (query.datasourceName !== datasourceInstance?.name) {\n await changeDatasource(exploreId, query.datasourceName, { importQueries: true });\n setQueries(exploreId, queriesToRun);\n } else {\n setQueries(exploreId, queriesToRun);\n }\n };\n\n const onCopyQuery = () => {\n const queriesToCopy = query.queries.map((q) => createQueryText(q, queryDsInstance)).join('\\n');\n copyStringToClipboard(queriesToCopy);\n dispatch(notifyApp(createSuccessNotification('Query copied to clipboard')));\n };\n\n const onCreateShortLink = async () => {\n const link = createUrlFromRichHistory(query);\n await createAndCopyShortLink(link);\n };\n\n const onDeleteQuery = () => {\n // For starred queries, we want confirmation. For non-starred, we don't.\n if (query.starred) {\n appEvents.publish(\n new ShowConfirmModalEvent({\n title: 'Delete',\n text: 'Are you sure you want to permanently delete your starred query?',\n yesText: 'Delete',\n icon: 'trash-alt',\n onConfirm: () => {\n updateRichHistory(query.ts, 'delete');\n dispatch(notifyApp(createSuccessNotification('Query deleted')));\n },\n })\n );\n } else {\n updateRichHistory(query.ts, 'delete');\n dispatch(notifyApp(createSuccessNotification('Query deleted')));\n }\n };\n\n const onStarrQuery = () => {\n updateRichHistory(query.ts, 'starred');\n };\n\n const toggleActiveUpdateComment = () => setActiveUpdateComment(!activeUpdateComment);\n\n const onUpdateComment = () => {\n updateRichHistory(query.ts, 'comment', comment);\n setActiveUpdateComment(false);\n };\n\n const onCancelUpdateComment = () => {\n setActiveUpdateComment(false);\n setComment(query.comment);\n };\n\n const onKeyDown = (keyEvent: React.KeyboardEvent) => {\n if (keyEvent.key === 'Enter' && (keyEvent.shiftKey || keyEvent.ctrlKey)) {\n onUpdateComment();\n }\n\n if (keyEvent.key === 'Escape') {\n onCancelUpdateComment();\n }\n };\n\n const updateComment = (\n <div className={styles.updateCommentContainer} aria-label={comment ? 'Update comment form' : 'Add comment form'}>\n <TextArea\n value={comment}\n placeholder={comment ? undefined : 'An optional description of what the query does.'}\n onChange={(e) => setComment(e.currentTarget.value)}\n className={styles.textArea}\n />\n <div className={styles.commentButtonRow}>\n <Button onClick={onUpdateComment} aria-label=\"Submit button\">\n Save comment\n </Button>\n <Button variant=\"secondary\" onClick={onCancelUpdateComment}>\n Cancel\n </Button>\n </div>\n </div>\n );\n\n const queryActionButtons = (\n <div className={styles.queryActionButtons}>\n <IconButton\n name=\"comment-alt\"\n onClick={toggleActiveUpdateComment}\n title={query.comment?.length > 0 ? 'Edit comment' : 'Add comment'}\n />\n <IconButton name=\"copy\" onClick={onCopyQuery} title=\"Copy query to clipboard\" />\n {!isRemoved && (\n <IconButton name=\"share-alt\" onClick={onCreateShortLink} title=\"Copy shortened link to clipboard\" />\n )}\n <IconButton name=\"trash-alt\" title={'Delete query'} onClick={onDeleteQuery} />\n <IconButton\n name={query.starred ? 'favorite' : 'star'}\n iconType={query.starred ? 'mono' : 'default'}\n onClick={onStarrQuery}\n title={query.starred ? 'Unstar query' : 'Star query'}\n />\n </div>\n );\n\n return (\n <div className={styles.queryCard} onKeyDown={onKeyDown}>\n <div className={styles.cardRow}>\n <div className={styles.datasourceContainer}>\n <img src={dsImg} aria-label=\"Data source icon\" />\n <div aria-label=\"Data source name\">\n {isRemoved ? 'Data source does not exist anymore' : query.datasourceName}\n </div>\n </div>\n {queryActionButtons}\n </div>\n <div className={cx(styles.cardRow)}>\n <div className={styles.queryContainer}>\n {query.queries.map((q, i) => {\n const queryText = createQueryText(q, queryDsInstance);\n return (\n <div aria-label=\"Query text\" key={`${q}-${i}`} className={styles.queryRow}>\n {queryText}\n </div>\n );\n })}\n {!activeUpdateComment && query.comment && (\n <div aria-label=\"Query comment\" className={styles.comment}>\n {query.comment}\n </div>\n )}\n {activeUpdateComment && updateComment}\n </div>\n {!activeUpdateComment && (\n <div className={styles.runButton}>\n <Button variant=\"secondary\" onClick={onRunQuery} disabled={isRemoved}>\n {datasourceInstance?.name === query.datasourceName ? 'Run query' : 'Switch data source and run query'}\n </Button>\n </div>\n )}\n </div>\n </div>\n );\n}\n\nexport default connector(RichHistoryCard);\n","import React, { useState, useEffect } from 'react';\nimport { css } from '@emotion/css';\nimport { uniqBy } from 'lodash';\n\n// Types\nimport { RichHistoryQuery, ExploreId } from 'app/types/explore';\n\n// Utils\nimport { stylesFactory, useTheme, RangeSlider, MultiSelect, Select, FilterInput } from '@grafana/ui';\nimport { GrafanaTheme, SelectableValue } from '@grafana/data';\n\nimport {\n SortOrder,\n mapNumbertoTimeInSlider,\n mapQueriesToHeadings,\n createDatasourcesList,\n filterAndSortQueries,\n} from 'app/core/utils/richHistory';\n\n// Components\nimport RichHistoryCard from './RichHistoryCard';\nimport { sortOrderOptions } from './RichHistory';\nimport { useDebounce } from 'react-use';\n\nexport interface Props {\n queries: RichHistoryQuery[];\n sortOrder: SortOrder;\n activeDatasourceOnly: boolean;\n datasourceFilters: SelectableValue[];\n retentionPeriod: number;\n exploreId: ExploreId;\n height: number;\n onChangeSortOrder: (sortOrder: SortOrder) => void;\n onSelectDatasourceFilters: (value: SelectableValue[]) => void;\n}\n\nconst getStyles = stylesFactory((theme: GrafanaTheme, height: number) => {\n const bgColor = theme.isLight ? theme.palette.gray5 : theme.palette.dark4;\n\n /* 134px is based on the width of the Query history tabs bar, so the content is aligned to right side of the tab */\n const cardWidth = '100% - 134px';\n const sliderHeight = `${height - 180}px`;\n return {\n container: css`\n display: flex;\n .label-slider {\n font-size: ${theme.typography.size.sm};\n &:last-of-type {\n margin-top: ${theme.spacing.lg};\n }\n &:first-of-type {\n font-weight: ${theme.typography.weight.semibold};\n margin-bottom: ${theme.spacing.md};\n }\n }\n `,\n containerContent: css`\n width: calc(${cardWidth});\n `,\n containerSlider: css`\n width: 129px;\n margin-right: ${theme.spacing.sm};\n .slider {\n bottom: 10px;\n height: ${sliderHeight};\n width: 129px;\n padding: ${theme.spacing.sm} 0;\n }\n `,\n slider: css`\n position: fixed;\n `,\n selectors: css`\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n `,\n filterInput: css`\n margin-bottom: ${theme.spacing.sm};\n `,\n multiselect: css`\n width: 100%;\n margin-bottom: ${theme.spacing.sm};\n .gf-form-select-box__multi-value {\n background-color: ${bgColor};\n padding: ${theme.spacing.xxs} ${theme.spacing.xs} ${theme.spacing.xxs} ${theme.spacing.sm};\n border-radius: ${theme.border.radius.sm};\n }\n `,\n sort: css`\n width: 170px;\n `,\n sessionName: css`\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n margin-top: ${theme.spacing.lg};\n h4 {\n margin: 0 10px 0 0;\n }\n `,\n heading: css`\n font-size: ${theme.typography.heading.h4};\n margin: ${theme.spacing.md} ${theme.spacing.xxs} ${theme.spacing.sm} ${theme.spacing.xxs};\n `,\n footer: css`\n height: 60px;\n margin: ${theme.spacing.lg} auto;\n display: flex;\n justify-content: center;\n font-weight: ${theme.typography.weight.light};\n font-size: ${theme.typography.size.sm};\n a {\n font-weight: ${theme.typography.weight.semibold};\n margin-left: ${theme.spacing.xxs};\n }\n `,\n queries: css`\n font-size: ${theme.typography.size.sm};\n font-weight: ${theme.typography.weight.regular};\n margin-left: ${theme.spacing.xs};\n `,\n };\n});\n\nexport function RichHistoryQueriesTab(props: Props) {\n const {\n datasourceFilters,\n onSelectDatasourceFilters,\n queries,\n onChangeSortOrder,\n sortOrder,\n activeDatasourceOnly,\n retentionPeriod,\n exploreId,\n height,\n } = props;\n\n const [timeFilter, setTimeFilter] = useState<[number, number]>([0, retentionPeriod]);\n const [data, setData] = useState<[RichHistoryQuery[], ReturnType<typeof createDatasourcesList>]>([[], []]);\n const [searchInput, setSearchInput] = useState('');\n const [debouncedSearchInput, setDebouncedSearchInput] = useState('');\n\n const theme = useTheme();\n const styles = getStyles(theme, height);\n\n useDebounce(\n () => {\n setDebouncedSearchInput(searchInput);\n },\n 300,\n [searchInput]\n );\n\n useEffect(() => {\n const datasourcesRetrievedFromQueryHistory = uniqBy(queries, 'datasourceName').map((d) => d.datasourceName);\n const listOfDatasources = createDatasourcesList(datasourcesRetrievedFromQueryHistory);\n\n setData([\n filterAndSortQueries(\n queries,\n sortOrder,\n datasourceFilters.map((d) => d.value),\n debouncedSearchInput,\n timeFilter\n ),\n listOfDatasources,\n ]);\n }, [timeFilter, queries, sortOrder, datasourceFilters, debouncedSearchInput]);\n\n const [filteredQueries, listOfDatasources] = data;\n\n /* mappedQueriesToHeadings is an object where query headings (stringified dates/data sources)\n * are keys and arrays with queries that belong to that headings are values.\n */\n const mappedQueriesToHeadings = mapQueriesToHeadings(filteredQueries, sortOrder);\n\n return (\n <div className={styles.container}>\n <div className={styles.containerSlider}>\n <div className={styles.slider}>\n <div className=\"label-slider\">Filter history</div>\n <div className=\"label-slider\">{mapNumbertoTimeInSlider(timeFilter[0])}</div>\n <div className=\"slider\">\n <RangeSlider\n tooltipAlwaysVisible={false}\n min={0}\n max={retentionPeriod}\n value={timeFilter}\n orientation=\"vertical\"\n formatTooltipResult={mapNumbertoTimeInSlider}\n reverse={true}\n onAfterChange={setTimeFilter as () => number[]}\n />\n </div>\n <div className=\"label-slider\">{mapNumbertoTimeInSlider(timeFilter[1])}</div>\n </div>\n </div>\n\n <div className={styles.containerContent}>\n <div className={styles.selectors}>\n {!activeDatasourceOnly && (\n <div aria-label=\"Filter datasources\" className={styles.multiselect}>\n <MultiSelect\n menuShouldPortal\n options={listOfDatasources}\n value={datasourceFilters}\n placeholder=\"Filter queries for data sources(s)\"\n onChange={onSelectDatasourceFilters}\n />\n </div>\n )}\n <div className={styles.filterInput}>\n <FilterInput\n placeholder=\"Search queries\"\n value={searchInput}\n onChange={(value: string) => {\n setSearchInput(value);\n }}\n />\n </div>\n <div aria-label=\"Sort queries\" className={styles.sort}>\n <Select\n menuShouldPortal\n value={sortOrderOptions.filter((order) => order.value === sortOrder)}\n options={sortOrderOptions}\n placeholder=\"Sort queries by\"\n onChange={(e) => onChangeSortOrder(e.value as SortOrder)}\n />\n </div>\n </div>\n {Object.keys(mappedQueriesToHeadings).map((heading) => {\n return (\n <div key={heading}>\n <div className={styles.heading}>\n {heading} <span className={styles.queries}>{mappedQueriesToHeadings[heading].length} queries</span>\n </div>\n {mappedQueriesToHeadings[heading].map((q: RichHistoryQuery) => {\n const idx = listOfDatasources.findIndex((d) => d.label === q.datasourceName);\n return (\n <RichHistoryCard\n query={q}\n key={q.ts}\n exploreId={exploreId}\n dsImg={listOfDatasources[idx].imgUrl}\n isRemoved={listOfDatasources[idx].isRemoved}\n />\n );\n })}\n </div>\n );\n })}\n <div className={styles.footer}>The history is local to your browser and is not shared with others.</div>\n </div>\n </div>\n );\n}\n","import React, { useState, useEffect } from 'react';\nimport { css } from '@emotion/css';\nimport { uniqBy } from 'lodash';\n\n// Types\nimport { RichHistoryQuery, ExploreId } from 'app/types/explore';\n\n// Utils\nimport { stylesFactory, useTheme, Select, MultiSelect, FilterInput } from '@grafana/ui';\nimport { GrafanaTheme, SelectableValue } from '@grafana/data';\nimport { filterAndSortQueries, createDatasourcesList, SortOrder } from 'app/core/utils/richHistory';\n\n// Components\nimport RichHistoryCard from './RichHistoryCard';\nimport { sortOrderOptions } from './RichHistory';\nimport { useDebounce } from 'react-use';\n\nexport interface Props {\n queries: RichHistoryQuery[];\n sortOrder: SortOrder;\n activeDatasourceOnly: boolean;\n datasourceFilters: SelectableValue[];\n exploreId: ExploreId;\n onChangeSortOrder: (sortOrder: SortOrder) => void;\n onSelectDatasourceFilters: (value: SelectableValue[]) => void;\n}\n\nconst getStyles = stylesFactory((theme: GrafanaTheme) => {\n const bgColor = theme.isLight ? theme.palette.gray5 : theme.palette.dark4;\n return {\n container: css`\n display: flex;\n `,\n containerContent: css`\n width: 100%;\n `,\n selectors: css`\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n `,\n multiselect: css`\n width: 100%;\n margin-bottom: ${theme.spacing.sm};\n .gf-form-select-box__multi-value {\n background-color: ${bgColor};\n padding: ${theme.spacing.xxs} ${theme.spacing.xs} ${theme.spacing.xxs} ${theme.spacing.sm};\n border-radius: ${theme.border.radius.sm};\n }\n `,\n filterInput: css`\n margin-bottom: ${theme.spacing.sm};\n `,\n sort: css`\n width: 170px;\n `,\n footer: css`\n height: 60px;\n margin-top: ${theme.spacing.lg};\n display: flex;\n justify-content: center;\n font-weight: ${theme.typography.weight.light};\n font-size: ${theme.typography.size.sm};\n a {\n font-weight: ${theme.typography.weight.semibold};\n margin-left: ${theme.spacing.xxs};\n }\n `,\n };\n});\n\nexport function RichHistoryStarredTab(props: Props) {\n const {\n datasourceFilters,\n onSelectDatasourceFilters,\n queries,\n onChangeSortOrder,\n sortOrder,\n activeDatasourceOnly,\n exploreId,\n } = props;\n\n const [data, setData] = useState<[RichHistoryQuery[], ReturnType<typeof createDatasourcesList>]>([[], []]);\n const [searchInput, setSearchInput] = useState('');\n const [debouncedSearchInput, setDebouncedSearchInput] = useState('');\n\n const theme = useTheme();\n const styles = getStyles(theme);\n\n useDebounce(\n () => {\n setDebouncedSearchInput(searchInput);\n },\n 300,\n [searchInput]\n );\n\n useEffect(() => {\n const datasourcesRetrievedFromQueryHistory = uniqBy(queries, 'datasourceName').map((d) => d.datasourceName);\n const listOfDatasources = createDatasourcesList(datasourcesRetrievedFromQueryHistory);\n const starredQueries = queries.filter((q) => q.starred === true);\n setData([\n filterAndSortQueries(\n starredQueries,\n sortOrder,\n datasourceFilters.map((d) => d.value),\n debouncedSearchInput\n ),\n listOfDatasources,\n ]);\n }, [queries, sortOrder, datasourceFilters, debouncedSearchInput]);\n\n const [filteredQueries, listOfDatasources] = data;\n\n return (\n <div className={styles.container}>\n <div className={styles.containerContent}>\n <div className={styles.selectors}>\n {!activeDatasourceOnly && (\n <div aria-label=\"Filter datasources\" className={styles.multiselect}>\n <MultiSelect\n menuShouldPortal\n options={listOfDatasources}\n value={datasourceFilters}\n placeholder=\"Filter queries for specific data sources(s)\"\n onChange={onSelectDatasourceFilters}\n />\n </div>\n )}\n <div className={styles.filterInput}>\n <FilterInput\n placeholder=\"Search queries\"\n value={searchInput}\n onChange={(value: string) => {\n setSearchInput(value);\n }}\n />\n </div>\n <div aria-label=\"Sort queries\" className={styles.sort}>\n <Select\n menuShouldPortal\n options={sortOrderOptions}\n value={sortOrderOptions.filter((order) => order.value === sortOrder)}\n placeholder=\"Sort queries by\"\n onChange={(e) => onChangeSortOrder(e.value as SortOrder)}\n />\n </div>\n </div>\n {filteredQueries.map((q) => {\n const idx = listOfDatasources.findIndex((d) => d.label === q.datasourceName);\n return (\n <RichHistoryCard\n query={q}\n key={q.ts}\n exploreId={exploreId}\n dsImg={listOfDatasources[idx].imgUrl}\n isRemoved={listOfDatasources[idx].isRemoved}\n />\n );\n })}\n <div className={styles.footer}>The history is local to your browser and is not shared with others.</div>\n </div>\n </div>\n );\n}\n","import React, { PureComponent } from 'react';\n\n//Services & Utils\nimport { RICH_HISTORY_SETTING_KEYS, SortOrder } from 'app/core/utils/richHistory';\nimport store from 'app/core/store';\nimport { Themeable, withTheme, TabbedContainer, TabConfig } from '@grafana/ui';\n\n//Types\nimport { RichHistoryQuery, ExploreId } from 'app/types/explore';\nimport { SelectableValue } from '@grafana/data';\n\n//Components\nimport { RichHistorySettings } from './RichHistorySettings';\nimport { RichHistoryQueriesTab } from './RichHistoryQueriesTab';\nimport { RichHistoryStarredTab } from './RichHistoryStarredTab';\n\nexport enum Tabs {\n RichHistory = 'Query history',\n Starred = 'Starred',\n Settings = 'Settings',\n}\n\nexport const sortOrderOptions = [\n { label: 'Newest first', value: SortOrder.Descending },\n { label: 'Oldest first', value: SortOrder.Ascending },\n { label: 'Data source A-Z', value: SortOrder.DatasourceAZ },\n { label: 'Data source Z-A', value: SortOrder.DatasourceZA },\n];\n\nexport interface RichHistoryProps extends Themeable {\n richHistory: RichHistoryQuery[];\n activeDatasourceInstance?: string;\n firstTab: Tabs;\n exploreId: ExploreId;\n height: number;\n deleteRichHistory: () => void;\n onClose: () => void;\n}\n\ninterface RichHistoryState {\n sortOrder: SortOrder;\n retentionPeriod: number;\n starredTabAsFirstTab: boolean;\n activeDatasourceOnly: boolean;\n datasourceFilters: SelectableValue[];\n}\n\nclass UnThemedRichHistory extends PureComponent<RichHistoryProps, RichHistoryState> {\n constructor(props: RichHistoryProps) {\n super(props);\n this.state = {\n sortOrder: SortOrder.Descending,\n datasourceFilters: store.getObject(RICH_HISTORY_SETTING_KEYS.datasourceFilters, []),\n retentionPeriod: store.getObject(RICH_HISTORY_SETTING_KEYS.retentionPeriod, 7),\n starredTabAsFirstTab: store.getBool(RICH_HISTORY_SETTING_KEYS.starredTabAsFirstTab, false),\n activeDatasourceOnly: store.getBool(RICH_HISTORY_SETTING_KEYS.activeDatasourceOnly, true),\n };\n }\n\n onChangeRetentionPeriod = (retentionPeriod: SelectableValue<number>) => {\n if (retentionPeriod.value !== undefined) {\n this.setState({\n retentionPeriod: retentionPeriod.value,\n });\n store.set(RICH_HISTORY_SETTING_KEYS.retentionPeriod, retentionPeriod.value);\n }\n };\n\n toggleStarredTabAsFirstTab = () => {\n const starredTabAsFirstTab = !this.state.starredTabAsFirstTab;\n this.setState({\n starredTabAsFirstTab,\n });\n store.set(RICH_HISTORY_SETTING_KEYS.starredTabAsFirstTab, starredTabAsFirstTab);\n };\n\n toggleActiveDatasourceOnly = () => {\n const activeDatasourceOnly = !this.state.activeDatasourceOnly;\n this.setState({\n activeDatasourceOnly,\n });\n store.set(RICH_HISTORY_SETTING_KEYS.activeDatasourceOnly, activeDatasourceOnly);\n };\n\n onSelectDatasourceFilters = (value: SelectableValue[]) => {\n try {\n store.setObject(RICH_HISTORY_SETTING_KEYS.datasourceFilters, value);\n } catch (error) {\n console.error(error);\n }\n /* Set data source filters to state even though they were not successfully saved in\n * localStorage to allow interaction and filtering.\n **/\n this.setState({ datasourceFilters: value });\n };\n\n onChangeSortOrder = (sortOrder: SortOrder) => this.setState({ sortOrder });\n\n /* If user selects activeDatasourceOnly === true, set datasource filter to currently active datasource.\n * Filtering based on datasource won't be available. Otherwise set to null, as filtering will be\n * available for user.\n */\n updateFilters() {\n this.state.activeDatasourceOnly && this.props.activeDatasourceInstance\n ? this.onSelectDatasourceFilters([\n { label: this.props.activeDatasourceInstance, value: this.props.activeDatasourceInstance },\n ])\n : this.onSelectDatasourceFilters(this.state.datasourceFilters);\n }\n\n componentDidMount() {\n this.updateFilters();\n }\n\n componentDidUpdate(prevProps: RichHistoryProps, prevState: RichHistoryState) {\n if (\n this.props.activeDatasourceInstance !== prevProps.activeDatasourceInstance ||\n this.state.activeDatasourceOnly !== prevState.activeDatasourceOnly\n ) {\n this.updateFilters();\n }\n }\n\n render() {\n const { datasourceFilters, sortOrder, activeDatasourceOnly, retentionPeriod } = this.state;\n const { richHistory, height, exploreId, deleteRichHistory, onClose, firstTab } = this.props;\n\n const QueriesTab: TabConfig = {\n label: 'Query history',\n value: Tabs.RichHistory,\n content: (\n <RichHistoryQueriesTab\n queries={richHistory}\n sortOrder={sortOrder}\n datasourceFilters={datasourceFilters}\n activeDatasourceOnly={activeDatasourceOnly}\n retentionPeriod={retentionPeriod}\n onChangeSortOrder={this.onChangeSortOrder}\n onSelectDatasourceFilters={this.onSelectDatasourceFilters}\n exploreId={exploreId}\n height={height}\n />\n ),\n icon: 'history',\n };\n\n const StarredTab: TabConfig = {\n label: 'Starred',\n value: Tabs.Starred,\n content: (\n <RichHistoryStarredTab\n queries={richHistory}\n sortOrder={sortOrder}\n datasourceFilters={datasourceFilters}\n activeDatasourceOnly={activeDatasourceOnly}\n onChangeSortOrder={this.onChangeSortOrder}\n onSelectDatasourceFilters={this.onSelectDatasourceFilters}\n exploreId={exploreId}\n />\n ),\n icon: 'star',\n };\n\n const SettingsTab: TabConfig = {\n label: 'Settings',\n value: Tabs.Settings,\n content: (\n <RichHistorySettings\n retentionPeriod={this.state.retentionPeriod}\n starredTabAsFirstTab={this.state.starredTabAsFirstTab}\n activeDatasourceOnly={this.state.activeDatasourceOnly}\n onChangeRetentionPeriod={this.onChangeRetentionPeriod}\n toggleStarredTabAsFirstTab={this.toggleStarredTabAsFirstTab}\n toggleactiveDatasourceOnly={this.toggleActiveDatasourceOnly}\n deleteRichHistory={deleteRichHistory}\n />\n ),\n icon: 'sliders-v-alt',\n };\n\n let tabs = [QueriesTab, StarredTab, SettingsTab];\n return (\n <TabbedContainer tabs={tabs} onClose={onClose} defaultTab={firstTab} closeIconTooltip=\"Close query history\" />\n );\n }\n}\n\nexport const RichHistory = withTheme(UnThemedRichHistory);\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nvar styles = {\n top: {\n width: '100%',\n height: '10px',\n top: '-5px',\n left: '0px',\n cursor: 'row-resize',\n },\n right: {\n width: '10px',\n height: '100%',\n top: '0px',\n right: '-5px',\n cursor: 'col-resize',\n },\n bottom: {\n width: '100%',\n height: '10px',\n bottom: '-5px',\n left: '0px',\n cursor: 'row-resize',\n },\n left: {\n width: '10px',\n height: '100%',\n top: '0px',\n left: '-5px',\n cursor: 'col-resize',\n },\n topRight: {\n width: '20px',\n height: '20px',\n position: 'absolute',\n right: '-10px',\n top: '-10px',\n cursor: 'ne-resize',\n },\n bottomRight: {\n width: '20px',\n height: '20px',\n position: 'absolute',\n right: '-10px',\n bottom: '-10px',\n cursor: 'se-resize',\n },\n bottomLeft: {\n width: '20px',\n height: '20px',\n position: 'absolute',\n left: '-10px',\n bottom: '-10px',\n cursor: 'sw-resize',\n },\n topLeft: {\n width: '20px',\n height: '20px',\n position: 'absolute',\n left: '-10px',\n top: '-10px',\n cursor: 'nw-resize',\n },\n};\nvar Resizer = /** @class */ (function (_super) {\n __extends(Resizer, _super);\n function Resizer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.onMouseDown = function (e) {\n _this.props.onResizeStart(e, _this.props.direction);\n };\n _this.onTouchStart = function (e) {\n _this.props.onResizeStart(e, _this.props.direction);\n };\n return _this;\n }\n Resizer.prototype.render = function () {\n return (React.createElement(\"div\", { className: this.props.className || '', style: __assign(__assign({ position: 'absolute', userSelect: 'none' }, styles[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));\n };\n return Resizer;\n}(React.PureComponent));\nexport { Resizer };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\nimport { Resizer } from './resizer';\nimport memoize from 'fast-memoize';\nvar DEFAULT_SIZE = {\n width: 'auto',\n height: 'auto',\n};\nvar clamp = memoize(function (n, min, max) { return Math.max(Math.min(n, max), min); });\nvar snap = memoize(function (n, size) { return Math.round(n / size) * size; });\nvar hasDirection = memoize(function (dir, target) {\n return new RegExp(dir, 'i').test(target);\n});\n// INFO: In case of window is a Proxy and does not porxy Events correctly, use isTouchEvent & isMouseEvent to distinguish event type instead of `instanceof`.\nvar isTouchEvent = function (event) {\n return Boolean(event.touches && event.touches.length);\n};\nvar isMouseEvent = function (event) {\n return Boolean((event.clientX || event.clientX === 0) &&\n (event.clientY || event.clientY === 0));\n};\nvar findClosestSnap = memoize(function (n, snapArray, snapGap) {\n if (snapGap === void 0) { snapGap = 0; }\n var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0);\n var gap = Math.abs(snapArray[closestGapIndex] - n);\n return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;\n});\nvar endsWith = memoize(function (str, searchStr) {\n return str.substr(str.length - searchStr.length, searchStr.length) === searchStr;\n});\nvar getStringSize = memoize(function (n) {\n n = n.toString();\n if (n === 'auto') {\n return n;\n }\n if (endsWith(n, 'px')) {\n return n;\n }\n if (endsWith(n, '%')) {\n return n;\n }\n if (endsWith(n, 'vh')) {\n return n;\n }\n if (endsWith(n, 'vw')) {\n return n;\n }\n if (endsWith(n, 'vmax')) {\n return n;\n }\n if (endsWith(n, 'vmin')) {\n return n;\n }\n return n + \"px\";\n});\nvar getPixelSize = function (size, parentSize, innerWidth, innerHeight) {\n if (size && typeof size === 'string') {\n if (endsWith(size, 'px')) {\n return Number(size.replace('px', ''));\n }\n if (endsWith(size, '%')) {\n var ratio = Number(size.replace('%', '')) / 100;\n return parentSize * ratio;\n }\n if (endsWith(size, 'vw')) {\n var ratio = Number(size.replace('vw', '')) / 100;\n return innerWidth * ratio;\n }\n if (endsWith(size, 'vh')) {\n var ratio = Number(size.replace('vh', '')) / 100;\n return innerHeight * ratio;\n }\n }\n return size;\n};\nvar calculateNewMax = memoize(function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {\n maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);\n maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);\n minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight);\n minHeight = getPixelSize(minHeight, parentSize.height, innerWidth, innerHeight);\n return {\n maxWidth: typeof maxWidth === 'undefined' ? undefined : Number(maxWidth),\n maxHeight: typeof maxHeight === 'undefined' ? undefined : Number(maxHeight),\n minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth),\n minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight),\n };\n});\nvar definedProps = [\n 'as',\n 'style',\n 'className',\n 'grid',\n 'snap',\n 'bounds',\n 'boundsByDirection',\n 'size',\n 'defaultSize',\n 'minWidth',\n 'minHeight',\n 'maxWidth',\n 'maxHeight',\n 'lockAspectRatio',\n 'lockAspectRatioExtraWidth',\n 'lockAspectRatioExtraHeight',\n 'enable',\n 'handleStyles',\n 'handleClasses',\n 'handleWrapperStyle',\n 'handleWrapperClass',\n 'children',\n 'onResizeStart',\n 'onResize',\n 'onResizeStop',\n 'handleComponent',\n 'scale',\n 'resizeRatio',\n 'snapGap',\n];\n// HACK: This class is used to calculate % size.\nvar baseClassName = '__resizable_base__';\nvar Resizable = /** @class */ (function (_super) {\n __extends(Resizable, _super);\n function Resizable(props) {\n var _this = _super.call(this, props) || this;\n _this.ratio = 1;\n _this.resizable = null;\n // For parent boundary\n _this.parentLeft = 0;\n _this.parentTop = 0;\n // For boundary\n _this.resizableLeft = 0;\n _this.resizableRight = 0;\n _this.resizableTop = 0;\n _this.resizableBottom = 0;\n // For target boundary\n _this.targetLeft = 0;\n _this.targetTop = 0;\n _this.appendBase = function () {\n if (!_this.resizable || !_this.window) {\n return null;\n }\n var parent = _this.parentNode;\n if (!parent) {\n return null;\n }\n var element = _this.window.document.createElement('div');\n element.style.width = '100%';\n element.style.height = '100%';\n element.style.position = 'absolute';\n element.style.transform = 'scale(0, 0)';\n element.style.left = '0';\n element.style.flex = '0';\n if (element.classList) {\n element.classList.add(baseClassName);\n }\n else {\n element.className += baseClassName;\n }\n parent.appendChild(element);\n return element;\n };\n _this.removeBase = function (base) {\n var parent = _this.parentNode;\n if (!parent) {\n return;\n }\n parent.removeChild(base);\n };\n _this.ref = function (c) {\n if (c) {\n _this.resizable = c;\n }\n };\n _this.state = {\n isResizing: false,\n width: typeof (_this.propsSize && _this.propsSize.width) === 'undefined'\n ? 'auto'\n : _this.propsSize && _this.propsSize.width,\n height: typeof (_this.propsSize && _this.propsSize.height) === 'undefined'\n ? 'auto'\n : _this.propsSize && _this.propsSize.height,\n direction: 'right',\n original: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n },\n backgroundStyle: {\n height: '100%',\n width: '100%',\n backgroundColor: 'rgba(0,0,0,0)',\n cursor: 'auto',\n opacity: 0,\n position: 'fixed',\n zIndex: 9999,\n top: '0',\n left: '0',\n bottom: '0',\n right: '0',\n },\n flexBasis: undefined,\n };\n _this.onResizeStart = _this.onResizeStart.bind(_this);\n _this.onMouseMove = _this.onMouseMove.bind(_this);\n _this.onMouseUp = _this.onMouseUp.bind(_this);\n return _this;\n }\n Object.defineProperty(Resizable.prototype, \"parentNode\", {\n get: function () {\n if (!this.resizable) {\n return null;\n }\n return this.resizable.parentNode;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Resizable.prototype, \"window\", {\n get: function () {\n if (!this.resizable) {\n return null;\n }\n if (!this.resizable.ownerDocument) {\n return null;\n }\n return this.resizable.ownerDocument.defaultView;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Resizable.prototype, \"propsSize\", {\n get: function () {\n return this.props.size || this.props.defaultSize || DEFAULT_SIZE;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Resizable.prototype, \"size\", {\n get: function () {\n var width = 0;\n var height = 0;\n if (this.resizable && this.window) {\n var orgWidth = this.resizable.offsetWidth;\n var orgHeight = this.resizable.offsetHeight;\n // HACK: Set position `relative` to get parent size.\n // This is because when re-resizable set `absolute`, I can not get base width correctly.\n var orgPosition = this.resizable.style.position;\n if (orgPosition !== 'relative') {\n this.resizable.style.position = 'relative';\n }\n // INFO: Use original width or height if set auto.\n width = this.resizable.style.width !== 'auto' ? this.resizable.offsetWidth : orgWidth;\n height = this.resizable.style.height !== 'auto' ? this.resizable.offsetHeight : orgHeight;\n // Restore original position\n this.resizable.style.position = orgPosition;\n }\n return { width: width, height: height };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Resizable.prototype, \"sizeStyle\", {\n get: function () {\n var _this = this;\n var size = this.props.size;\n var getSize = function (key) {\n if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {\n return 'auto';\n }\n if (_this.propsSize && _this.propsSize[key] && endsWith(_this.propsSize[key].toString(), '%')) {\n if (endsWith(_this.state[key].toString(), '%')) {\n return _this.state[key].toString();\n }\n var parentSize = _this.getParentSize();\n var value = Number(_this.state[key].toString().replace('px', ''));\n var percent = (value / parentSize[key]) * 100;\n return percent + \"%\";\n }\n return getStringSize(_this.state[key]);\n };\n var width = size && typeof size.width !== 'undefined' && !this.state.isResizing\n ? getStringSize(size.width)\n : getSize('width');\n var height = size && typeof size.height !== 'undefined' && !this.state.isResizing\n ? getStringSize(size.height)\n : getSize('height');\n return { width: width, height: height };\n },\n enumerable: false,\n configurable: true\n });\n Resizable.prototype.getParentSize = function () {\n if (!this.parentNode) {\n if (!this.window) {\n return { width: 0, height: 0 };\n }\n return { width: this.window.innerWidth, height: this.window.innerHeight };\n }\n var base = this.appendBase();\n if (!base) {\n return { width: 0, height: 0 };\n }\n // INFO: To calculate parent width with flex layout\n var wrapChanged = false;\n var wrap = this.parentNode.style.flexWrap;\n if (wrap !== 'wrap') {\n wrapChanged = true;\n this.parentNode.style.flexWrap = 'wrap';\n // HACK: Use relative to get parent padding size\n }\n base.style.position = 'relative';\n base.style.minWidth = '100%';\n var size = {\n width: base.offsetWidth,\n height: base.offsetHeight,\n };\n if (wrapChanged) {\n this.parentNode.style.flexWrap = wrap;\n }\n this.removeBase(base);\n return size;\n };\n Resizable.prototype.bindEvents = function () {\n if (this.window) {\n this.window.addEventListener('mouseup', this.onMouseUp);\n this.window.addEventListener('mousemove', this.onMouseMove);\n this.window.addEventListener('mouseleave', this.onMouseUp);\n this.window.addEventListener('touchmove', this.onMouseMove, {\n capture: true,\n passive: false,\n });\n this.window.addEventListener('touchend', this.onMouseUp);\n }\n };\n Resizable.prototype.unbindEvents = function () {\n if (this.window) {\n this.window.removeEventListener('mouseup', this.onMouseUp);\n this.window.removeEventListener('mousemove', this.onMouseMove);\n this.window.removeEventListener('mouseleave', this.onMouseUp);\n this.window.removeEventListener('touchmove', this.onMouseMove, true);\n this.window.removeEventListener('touchend', this.onMouseUp);\n }\n };\n Resizable.prototype.componentDidMount = function () {\n if (!this.resizable || !this.window) {\n return;\n }\n var computedStyle = this.window.getComputedStyle(this.resizable);\n this.setState({\n width: this.state.width || this.size.width,\n height: this.state.height || this.size.height,\n flexBasis: computedStyle.flexBasis !== 'auto' ? computedStyle.flexBasis : undefined,\n });\n };\n Resizable.prototype.componentWillUnmount = function () {\n if (this.window) {\n this.unbindEvents();\n }\n };\n Resizable.prototype.createSizeForCssProperty = function (newSize, kind) {\n var propsSize = this.propsSize && this.propsSize[kind];\n return this.state[kind] === 'auto' &&\n this.state.original[kind] === newSize &&\n (typeof propsSize === 'undefined' || propsSize === 'auto')\n ? 'auto'\n : newSize;\n };\n Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) {\n var boundsByDirection = this.props.boundsByDirection;\n var direction = this.state.direction;\n var widthByDirection = boundsByDirection && hasDirection('left', direction);\n var heightByDirection = boundsByDirection && hasDirection('top', direction);\n var boundWidth;\n var boundHeight;\n if (this.props.bounds === 'parent') {\n var parent_1 = this.parentNode;\n if (parent_1) {\n boundWidth = widthByDirection\n ? this.resizableRight - this.parentLeft\n : parent_1.offsetWidth + (this.parentLeft - this.resizableLeft);\n boundHeight = heightByDirection\n ? this.resizableBottom - this.parentTop\n : parent_1.offsetHeight + (this.parentTop - this.resizableTop);\n }\n }\n else if (this.props.bounds === 'window') {\n if (this.window) {\n boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft;\n boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop;\n }\n }\n else if (this.props.bounds) {\n boundWidth = widthByDirection\n ? this.resizableRight - this.targetLeft\n : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft);\n boundHeight = heightByDirection\n ? this.resizableBottom - this.targetTop\n : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop);\n }\n if (boundWidth && Number.isFinite(boundWidth)) {\n maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;\n }\n if (boundHeight && Number.isFinite(boundHeight)) {\n maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;\n }\n return { maxWidth: maxWidth, maxHeight: maxHeight };\n };\n Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) {\n var scale = this.props.scale || 1;\n var resizeRatio = this.props.resizeRatio || 1;\n var _a = this.state, direction = _a.direction, original = _a.original;\n var _b = this.props, lockAspectRatio = _b.lockAspectRatio, lockAspectRatioExtraHeight = _b.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _b.lockAspectRatioExtraWidth;\n var newWidth = original.width;\n var newHeight = original.height;\n var extraHeight = lockAspectRatioExtraHeight || 0;\n var extraWidth = lockAspectRatioExtraWidth || 0;\n if (hasDirection('right', direction)) {\n newWidth = original.width + ((clientX - original.x) * resizeRatio) / scale;\n if (lockAspectRatio) {\n newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;\n }\n }\n if (hasDirection('left', direction)) {\n newWidth = original.width - ((clientX - original.x) * resizeRatio) / scale;\n if (lockAspectRatio) {\n newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;\n }\n }\n if (hasDirection('bottom', direction)) {\n newHeight = original.height + ((clientY - original.y) * resizeRatio) / scale;\n if (lockAspectRatio) {\n newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;\n }\n }\n if (hasDirection('top', direction)) {\n newHeight = original.height - ((clientY - original.y) * resizeRatio) / scale;\n if (lockAspectRatio) {\n newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;\n }\n }\n return { newWidth: newWidth, newHeight: newHeight };\n };\n Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) {\n var _a = this.props, lockAspectRatio = _a.lockAspectRatio, lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth;\n var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width;\n var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width;\n var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height;\n var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height;\n var extraHeight = lockAspectRatioExtraHeight || 0;\n var extraWidth = lockAspectRatioExtraWidth || 0;\n if (lockAspectRatio) {\n var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth;\n var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth;\n var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight;\n var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight;\n var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth);\n var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth);\n var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight);\n var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight);\n newWidth = clamp(newWidth, lockedMinWidth, lockedMaxWidth);\n newHeight = clamp(newHeight, lockedMinHeight, lockedMaxHeight);\n }\n else {\n newWidth = clamp(newWidth, computedMinWidth, computedMaxWidth);\n newHeight = clamp(newHeight, computedMinHeight, computedMaxHeight);\n }\n return { newWidth: newWidth, newHeight: newHeight };\n };\n Resizable.prototype.setBoundingClientRect = function () {\n // For parent boundary\n if (this.props.bounds === 'parent') {\n var parent_2 = this.parentNode;\n if (parent_2) {\n var parentRect = parent_2.getBoundingClientRect();\n this.parentLeft = parentRect.left;\n this.parentTop = parentRect.top;\n }\n }\n // For target(html element) boundary\n if (this.props.bounds && typeof this.props.bounds !== 'string') {\n var targetRect = this.props.bounds.getBoundingClientRect();\n this.targetLeft = targetRect.left;\n this.targetTop = targetRect.top;\n }\n // For boundary\n if (this.resizable) {\n var _a = this.resizable.getBoundingClientRect(), left = _a.left, top_1 = _a.top, right = _a.right, bottom = _a.bottom;\n this.resizableLeft = left;\n this.resizableRight = right;\n this.resizableTop = top_1;\n this.resizableBottom = bottom;\n }\n };\n Resizable.prototype.onResizeStart = function (event, direction) {\n if (!this.resizable || !this.window) {\n return;\n }\n var clientX = 0;\n var clientY = 0;\n if (event.nativeEvent && isMouseEvent(event.nativeEvent)) {\n clientX = event.nativeEvent.clientX;\n clientY = event.nativeEvent.clientY;\n }\n else if (event.nativeEvent && isTouchEvent(event.nativeEvent)) {\n clientX = event.nativeEvent.touches[0].clientX;\n clientY = event.nativeEvent.touches[0].clientY;\n }\n if (this.props.onResizeStart) {\n if (this.resizable) {\n var startResize = this.props.onResizeStart(event, direction, this.resizable);\n if (startResize === false) {\n return;\n }\n }\n }\n // Fix #168\n if (this.props.size) {\n if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) {\n this.setState({ height: this.props.size.height });\n }\n if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) {\n this.setState({ width: this.props.size.width });\n }\n }\n // For lockAspectRatio case\n this.ratio =\n typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height;\n var flexBasis;\n var computedStyle = this.window.getComputedStyle(this.resizable);\n if (computedStyle.flexBasis !== 'auto') {\n var parent_3 = this.parentNode;\n if (parent_3) {\n var dir = this.window.getComputedStyle(parent_3).flexDirection;\n this.flexDir = dir.startsWith('row') ? 'row' : 'column';\n flexBasis = computedStyle.flexBasis;\n }\n }\n // For boundary\n this.setBoundingClientRect();\n this.bindEvents();\n var state = {\n original: {\n x: clientX,\n y: clientY,\n width: this.size.width,\n height: this.size.height,\n },\n isResizing: true,\n backgroundStyle: __assign(__assign({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || 'auto' }),\n direction: direction,\n flexBasis: flexBasis,\n };\n this.setState(state);\n };\n Resizable.prototype.onMouseMove = function (event) {\n if (!this.state.isResizing || !this.resizable || !this.window) {\n return;\n }\n if (this.window.TouchEvent && isTouchEvent(event)) {\n try {\n event.preventDefault();\n event.stopPropagation();\n }\n catch (e) {\n // Ignore on fail\n }\n }\n var _a = this.props, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, minWidth = _a.minWidth, minHeight = _a.minHeight;\n var clientX = isTouchEvent(event) ? event.touches[0].clientX : event.clientX;\n var clientY = isTouchEvent(event) ? event.touches[0].clientY : event.clientY;\n var _b = this.state, direction = _b.direction, original = _b.original, width = _b.width, height = _b.height;\n var parentSize = this.getParentSize();\n var max = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight);\n maxWidth = max.maxWidth;\n maxHeight = max.maxHeight;\n minWidth = max.minWidth;\n minHeight = max.minHeight;\n // Calculate new size\n var _c = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c.newHeight, newWidth = _c.newWidth;\n // Calculate max size from boundary settings\n var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight);\n // Calculate new size from aspect ratio\n var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight });\n newWidth = newSize.newWidth;\n newHeight = newSize.newHeight;\n if (this.props.grid) {\n var newGridWidth = snap(newWidth, this.props.grid[0]);\n var newGridHeight = snap(newHeight, this.props.grid[1]);\n var gap = this.props.snapGap || 0;\n newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;\n newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;\n }\n if (this.props.snap && this.props.snap.x) {\n newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);\n }\n if (this.props.snap && this.props.snap.y) {\n newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);\n }\n var delta = {\n width: newWidth - original.width,\n height: newHeight - original.height,\n };\n if (width && typeof width === 'string') {\n if (endsWith(width, '%')) {\n var percent = (newWidth / parentSize.width) * 100;\n newWidth = percent + \"%\";\n }\n else if (endsWith(width, 'vw')) {\n var vw = (newWidth / this.window.innerWidth) * 100;\n newWidth = vw + \"vw\";\n }\n else if (endsWith(width, 'vh')) {\n var vh = (newWidth / this.window.innerHeight) * 100;\n newWidth = vh + \"vh\";\n }\n }\n if (height && typeof height === 'string') {\n if (endsWith(height, '%')) {\n var percent = (newHeight / parentSize.height) * 100;\n newHeight = percent + \"%\";\n }\n else if (endsWith(height, 'vw')) {\n var vw = (newHeight / this.window.innerWidth) * 100;\n newHeight = vw + \"vw\";\n }\n else if (endsWith(height, 'vh')) {\n var vh = (newHeight / this.window.innerHeight) * 100;\n newHeight = vh + \"vh\";\n }\n }\n var newState = {\n width: this.createSizeForCssProperty(newWidth, 'width'),\n height: this.createSizeForCssProperty(newHeight, 'height'),\n };\n if (this.flexDir === 'row') {\n newState.flexBasis = newState.width;\n }\n else if (this.flexDir === 'column') {\n newState.flexBasis = newState.height;\n }\n this.setState(newState);\n if (this.props.onResize) {\n this.props.onResize(event, direction, this.resizable, delta);\n }\n };\n Resizable.prototype.onMouseUp = function (event) {\n var _a = this.state, isResizing = _a.isResizing, direction = _a.direction, original = _a.original;\n if (!isResizing || !this.resizable) {\n return;\n }\n var delta = {\n width: this.size.width - original.width,\n height: this.size.height - original.height,\n };\n if (this.props.onResizeStop) {\n this.props.onResizeStop(event, direction, this.resizable, delta);\n }\n if (this.props.size) {\n this.setState(this.props.size);\n }\n this.unbindEvents();\n this.setState({\n isResizing: false,\n backgroundStyle: __assign(__assign({}, this.state.backgroundStyle), { cursor: 'auto' }),\n });\n };\n Resizable.prototype.updateSize = function (size) {\n this.setState({ width: size.width, height: size.height });\n };\n Resizable.prototype.renderResizer = function () {\n var _this = this;\n var _a = this.props, enable = _a.enable, handleStyles = _a.handleStyles, handleClasses = _a.handleClasses, handleWrapperStyle = _a.handleWrapperStyle, handleWrapperClass = _a.handleWrapperClass, handleComponent = _a.handleComponent;\n if (!enable) {\n return null;\n }\n var resizers = Object.keys(enable).map(function (dir) {\n if (enable[dir] !== false) {\n return (React.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null));\n }\n return null;\n });\n // #93 Wrap the resize box in span (will not break 100% width/height)\n return (React.createElement(\"div\", { className: handleWrapperClass, style: handleWrapperStyle }, resizers));\n };\n Resizable.prototype.render = function () {\n var _this = this;\n var extendsProps = Object.keys(this.props).reduce(function (acc, key) {\n if (definedProps.indexOf(key) !== -1) {\n return acc;\n }\n acc[key] = _this.props[key];\n return acc;\n }, {});\n var style = __assign(__assign(__assign({ position: 'relative', userSelect: this.state.isResizing ? 'none' : 'auto' }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: 'border-box', flexShrink: 0 });\n if (this.state.flexBasis) {\n style.flexBasis = this.state.flexBasis;\n }\n var Wrapper = this.props.as || 'div';\n return (React.createElement(Wrapper, __assign({ ref: this.ref, style: style, className: this.props.className }, extendsProps),\n this.state.isResizing && React.createElement(\"div\", { style: this.state.backgroundStyle }),\n this.props.children,\n this.renderResizer()));\n };\n Resizable.defaultProps = {\n as: 'div',\n onResizeStart: function () { },\n onResize: function () { },\n onResizeStop: function () { },\n enable: {\n top: true,\n right: true,\n bottom: true,\n left: true,\n topRight: true,\n bottomRight: true,\n bottomLeft: true,\n topLeft: true,\n },\n style: {},\n grid: [1, 1],\n lockAspectRatio: false,\n lockAspectRatioExtraWidth: 0,\n lockAspectRatioExtraHeight: 0,\n scale: 1,\n resizeRatio: 1,\n snapGap: 0,\n };\n return Resizable;\n}(React.PureComponent));\nexport { Resizable };\n","// Libraries\nimport React from 'react';\nimport { Resizable, ResizeCallback } from 're-resizable';\nimport { css, cx, keyframes } from '@emotion/css';\n\n// Services & Utils\nimport { stylesFactory, useTheme2 } from '@grafana/ui';\n\n// Types\nimport { GrafanaTheme2 } from '@grafana/data';\n\nconst drawerSlide = keyframes`\n 0% {\n transform: translateY(400px);\n }\n\n 100% {\n transform: translateY(0px);\n }\n`;\n\nconst getStyles = stylesFactory((theme: GrafanaTheme2) => {\n return {\n container: css`\n position: fixed !important;\n bottom: 0;\n background: ${theme.colors.background.primary};\n border-top: 1px solid ${theme.colors.border.weak};\n margin: ${theme.spacing(0, -2, 0, -2)};\n box-shadow: ${theme.shadows.z3};\n z-index: ${theme.zIndex.sidemenu};\n `,\n drawerActive: css`\n opacity: 1;\n animation: 0.5s ease-out ${drawerSlide};\n `,\n rzHandle: css`\n background: ${theme.colors.secondary.main};\n transition: 0.3s background ease-in-out;\n position: relative;\n width: 200px !important;\n height: 7px !important;\n left: calc(50% - 100px) !important;\n top: -4px !important;\n cursor: grab;\n border-radius: 4px;\n &:hover {\n background: ${theme.colors.secondary.shade};\n }\n `,\n };\n});\n\nexport interface Props {\n width: number;\n children: React.ReactNode;\n onResize?: ResizeCallback;\n}\n\nexport function ExploreDrawer(props: Props) {\n const { width, children, onResize } = props;\n const theme = useTheme2();\n const styles = getStyles(theme);\n const drawerWidth = `${width + 31.5}px`;\n\n return (\n <Resizable\n className={cx(styles.container, styles.drawerActive)}\n defaultSize={{ width: drawerWidth, height: '400px' }}\n handleClasses={{ top: styles.rzHandle }}\n enable={{\n top: true,\n right: false,\n bottom: false,\n left: false,\n topRight: false,\n bottomRight: false,\n bottomLeft: false,\n topLeft: false,\n }}\n maxHeight=\"100vh\"\n maxWidth={drawerWidth}\n minWidth={drawerWidth}\n onResize={onResize}\n >\n {children}\n </Resizable>\n );\n}\n","// Libraries\nimport React, { useState } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\n\n// Services & Utils\nimport store from 'app/core/store';\nimport { RICH_HISTORY_SETTING_KEYS } from 'app/core/utils/richHistory';\n\n// Types\nimport { ExploreItemState, StoreState } from 'app/types';\nimport { ExploreId } from 'app/types/explore';\n\n// Components, enums\nimport { RichHistory, Tabs } from './RichHistory';\n\n//Actions\nimport { deleteRichHistory } from '../state/history';\nimport { ExploreDrawer } from '../ExploreDrawer';\n\nfunction mapStateToProps(state: StoreState, { exploreId }: { exploreId: ExploreId }) {\n const explore = state.explore;\n // @ts-ignore\n const item: ExploreItemState = explore[exploreId];\n const { datasourceInstance } = item;\n const firstTab = store.getBool(RICH_HISTORY_SETTING_KEYS.starredTabAsFirstTab, false)\n ? Tabs.Starred\n : Tabs.RichHistory;\n const { richHistory } = explore;\n return {\n richHistory,\n firstTab,\n activeDatasourceInstance: datasourceInstance?.name,\n };\n}\n\nconst mapDispatchToProps = {\n deleteRichHistory,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\ninterface OwnProps {\n width: number;\n exploreId: ExploreId;\n onClose: () => void;\n}\nexport type Props = ConnectedProps<typeof connector> & OwnProps;\n\nexport function RichHistoryContainer(props: Props) {\n const [height, setHeight] = useState(400);\n\n const { richHistory, width, firstTab, activeDatasourceInstance, exploreId, deleteRichHistory, onClose } = props;\n\n return (\n <ExploreDrawer\n width={width}\n onResize={(_e, _dir, ref) => {\n setHeight(Number(ref.style.height.slice(0, -2)));\n }}\n >\n <RichHistory\n richHistory={richHistory}\n firstTab={firstTab}\n activeDatasourceInstance={activeDatasourceInstance}\n exploreId={exploreId}\n deleteRichHistory={deleteRichHistory}\n onClose={onClose}\n height={height}\n />\n </ExploreDrawer>\n );\n}\n\nexport default connector(RichHistoryContainer);\n","import React from 'react';\nimport { TabbedContainer, TabConfig } from '@grafana/ui';\nimport { TimeZone } from '@grafana/data';\nimport { runQueries } from './state/query';\nimport { StoreState, ExploreItemState, ExploreId } from 'app/types';\nimport { connect, ConnectedProps } from 'react-redux';\nimport { ExploreDrawer } from 'app/features/explore/ExploreDrawer';\nimport { InspectJSONTab } from 'app/features/inspector/InspectJSONTab';\nimport { QueryInspector } from 'app/features/inspector/QueryInspector';\nimport { InspectStatsTab } from 'app/features/inspector/InspectStatsTab';\nimport { InspectDataTab } from 'app/features/inspector/InspectDataTab';\nimport { InspectErrorTab } from 'app/features/inspector/InspectErrorTab';\n\ninterface DispatchProps {\n width: number;\n exploreId: ExploreId;\n timeZone: TimeZone;\n onClose: () => void;\n}\n\ntype Props = DispatchProps & ConnectedProps<typeof connector>;\n\nexport function ExploreQueryInspector(props: Props) {\n const { loading, width, onClose, queryResponse, timeZone } = props;\n const dataFrames = queryResponse?.series || [];\n const error = queryResponse?.error;\n\n const statsTab: TabConfig = {\n label: 'Stats',\n value: 'stats',\n icon: 'chart-line',\n content: <InspectStatsTab data={queryResponse!} timeZone={queryResponse?.request?.timezone as TimeZone} />,\n };\n\n const jsonTab: TabConfig = {\n label: 'JSON',\n value: 'json',\n icon: 'brackets-curly',\n content: <InspectJSONTab data={queryResponse} onClose={onClose} />,\n };\n\n const dataTab: TabConfig = {\n label: 'Data',\n value: 'data',\n icon: 'database',\n content: (\n <InspectDataTab\n data={dataFrames}\n isLoading={loading}\n options={{ withTransforms: false, withFieldConfig: false }}\n timeZone={timeZone}\n />\n ),\n };\n\n const queryTab: TabConfig = {\n label: 'Query',\n value: 'query',\n icon: 'info-circle',\n content: <QueryInspector data={dataFrames} onRefreshQuery={() => props.runQueries(props.exploreId)} />,\n };\n\n const tabs = [statsTab, queryTab, jsonTab, dataTab];\n if (error) {\n const errorTab: TabConfig = {\n label: 'Error',\n value: 'error',\n icon: 'exclamation-triangle',\n content: <InspectErrorTab error={error} />,\n };\n tabs.push(errorTab);\n }\n return (\n <ExploreDrawer width={width} onResize={() => {}}>\n <TabbedContainer tabs={tabs} onClose={onClose} closeIconTooltip=\"Close query inspector\" />\n </ExploreDrawer>\n );\n}\n\nfunction mapStateToProps(state: StoreState, { exploreId }: { exploreId: ExploreId }) {\n const explore = state.explore;\n const item: ExploreItemState = explore[exploreId]!;\n const { loading, queryResponse } = item;\n\n return {\n loading,\n queryResponse,\n };\n}\n\nconst mapDispatchToProps = {\n runQueries,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\nexport default connector(ExploreQueryInspector);\n","import React from 'react';\nimport { Tooltip, ToolbarButton } from '@grafana/ui';\n\ninterface TimeSyncButtonProps {\n isSynced: boolean;\n onClick: () => void;\n}\n\nexport function TimeSyncButton(props: TimeSyncButtonProps) {\n const { onClick, isSynced } = props;\n\n const syncTimesTooltip = () => {\n const { isSynced } = props;\n const tooltip = isSynced ? 'Unsync all views' : 'Sync all views to this time range';\n return <>{tooltip}</>;\n };\n\n return (\n <Tooltip content={syncTimesTooltip} placement=\"bottom\">\n <ToolbarButton\n icon=\"link\"\n variant={isSynced ? 'active' : 'default'}\n aria-label={isSynced ? 'Synced times' : 'Unsynced times'}\n onClick={onClick}\n />\n </Tooltip>\n );\n}\n","// Libaries\nimport React, { Component } from 'react';\n\n// Types\nimport { ExploreId } from 'app/types';\nimport { TimeRange, TimeZone, RawTimeRange, dateTimeForTimeZone, dateMath } from '@grafana/data';\n\n// State\n\n// Components\nimport { TimeSyncButton } from './TimeSyncButton';\nimport { TimePickerWithHistory } from 'app/core/components/TimePicker/TimePickerWithHistory';\n\n// Utils & Services\nimport { getShiftedTimeRange, getZoomedTimeRange } from 'app/core/utils/timePicker';\n\nexport interface Props {\n exploreId: ExploreId;\n hideText?: boolean;\n range: TimeRange;\n timeZone: TimeZone;\n fiscalYearStartMonth: number;\n splitted: boolean;\n syncedTimes: boolean;\n onChangeTimeSync: () => void;\n onChangeTime: (range: RawTimeRange) => void;\n onChangeTimeZone: (timeZone: TimeZone) => void;\n onChangeFiscalYearStartMonth: (fiscalYearStartMonth: number) => void;\n}\n\nexport class ExploreTimeControls extends Component<Props> {\n onMoveTimePicker = (direction: number) => {\n const { range, onChangeTime, timeZone } = this.props;\n const { from, to } = getShiftedTimeRange(direction, range);\n const nextTimeRange = {\n from: dateTimeForTimeZone(timeZone, from),\n to: dateTimeForTimeZone(timeZone, to),\n };\n\n onChangeTime(nextTimeRange);\n };\n\n onMoveForward = () => this.onMoveTimePicker(1);\n onMoveBack = () => this.onMoveTimePicker(-1);\n\n onChangeTimePicker = (timeRange: TimeRange) => {\n const adjustedFrom = dateMath.isMathString(timeRange.raw.from) ? timeRange.raw.from : timeRange.from;\n const adjustedTo = dateMath.isMathString(timeRange.raw.to) ? timeRange.raw.to : timeRange.to;\n\n this.props.onChangeTime({\n from: adjustedFrom,\n to: adjustedTo,\n });\n };\n\n onZoom = () => {\n const { range, onChangeTime, timeZone } = this.props;\n const { from, to } = getZoomedTimeRange(range, 2);\n const nextTimeRange = {\n from: dateTimeForTimeZone(timeZone, from),\n to: dateTimeForTimeZone(timeZone, to),\n };\n\n onChangeTime(nextTimeRange);\n };\n\n render() {\n const {\n range,\n timeZone,\n fiscalYearStartMonth,\n splitted,\n syncedTimes,\n onChangeTimeSync,\n hideText,\n onChangeTimeZone,\n onChangeFiscalYearStartMonth,\n } = this.props;\n const timeSyncButton = splitted ? <TimeSyncButton onClick={onChangeTimeSync} isSynced={syncedTimes} /> : undefined;\n const timePickerCommonProps = {\n value: range,\n timeZone,\n fiscalYearStartMonth,\n onMoveBackward: this.onMoveBack,\n onMoveForward: this.onMoveForward,\n onZoom: this.onZoom,\n hideText,\n };\n\n return (\n <TimePickerWithHistory\n {...timePickerCommonProps}\n timeSyncButton={timeSyncButton}\n isSynced={syncedTimes}\n onChange={this.onChangeTimePicker}\n onChangeTimeZone={onChangeTimeZone}\n onChangeFiscalYearStartMonth={onChangeFiscalYearStartMonth}\n />\n );\n }\n}\n","import React from 'react';\nimport { css } from '@emotion/css';\nimport { CSSTransition } from 'react-transition-group';\nimport { Tooltip, ButtonGroup, ToolbarButton } from '@grafana/ui';\n\ntype LiveTailButtonProps = {\n splitted: boolean;\n start: () => void;\n stop: () => void;\n pause: () => void;\n resume: () => void;\n isLive: boolean;\n isPaused: boolean;\n};\n\nexport function LiveTailButton(props: LiveTailButtonProps) {\n const { start, pause, resume, isLive, isPaused, stop, splitted } = props;\n const buttonVariant = isLive && !isPaused ? 'active' : 'default';\n const onClickMain = isLive ? (isPaused ? resume : pause) : start;\n\n return (\n <ButtonGroup>\n <Tooltip\n content={isLive && !isPaused ? <>Pause the live stream</> : <>Start live stream your logs</>}\n placement=\"bottom\"\n >\n <ToolbarButton\n iconOnly={splitted}\n variant={buttonVariant}\n icon={!isLive || isPaused ? 'play' : 'pause'}\n onClick={onClickMain}\n >\n {isLive && isPaused ? 'Paused' : 'Live'}\n </ToolbarButton>\n </Tooltip>\n\n <CSSTransition\n mountOnEnter={true}\n unmountOnExit={true}\n timeout={100}\n in={isLive}\n classNames={{\n enter: styles.stopButtonEnter,\n enterActive: styles.stopButtonEnterActive,\n exit: styles.stopButtonExit,\n exitActive: styles.stopButtonExitActive,\n }}\n >\n <Tooltip content={<>Stop and exit the live stream</>} placement=\"bottom\">\n <ToolbarButton variant={buttonVariant} onClick={stop} icon=\"square-shape\" />\n </Tooltip>\n </CSSTransition>\n </ButtonGroup>\n );\n}\n\nconst styles = {\n stopButtonEnter: css`\n label: stopButtonEnter;\n width: 0;\n opacity: 0;\n overflow: hidden;\n `,\n stopButtonEnterActive: css`\n label: stopButtonEnterActive;\n opacity: 1;\n width: 32px;\n `,\n stopButtonExit: css`\n label: stopButtonExit;\n width: 32px;\n opacity: 1;\n overflow: hidden;\n `,\n stopButtonExitActive: css`\n label: stopButtonExitActive;\n opacity: 0;\n width: 0;\n `,\n};\n","import React from 'react';\nimport { RefreshPicker, defaultIntervals } from '@grafana/ui';\nimport { getTimeSrv } from 'app/features/dashboard/services/TimeSrv';\n\nexport type Props = {\n isSmall?: boolean;\n loading: boolean;\n isLive: boolean;\n onRun: (loading: boolean) => void;\n refreshInterval?: string;\n onChangeRefreshInterval: (interval: string) => void;\n showDropdown: boolean;\n};\n\nexport function RunButton(props: Props) {\n const { isSmall, loading, onRun, onChangeRefreshInterval, refreshInterval, showDropdown, isLive } = props;\n const intervals = getTimeSrv().getValidIntervals(defaultIntervals);\n let text: string | undefined = loading ? 'Cancel' : 'Run query';\n let width = '108px';\n\n if (isLive) {\n return null;\n }\n\n if (isSmall) {\n text = undefined;\n width = '35px';\n }\n\n return (\n <RefreshPicker\n onIntervalChanged={onChangeRefreshInterval}\n value={refreshInterval}\n isLoading={loading}\n text={text}\n intervals={intervals}\n isLive={isLive}\n onRefresh={() => onRun(loading)}\n noIntervalPicker={!showDropdown}\n primary={true}\n width={width}\n />\n );\n}\n","import React, { FC } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\nimport { ButtonGroup, ButtonSelect, Icon, ToolbarButton, Tooltip } from '@grafana/ui';\nimport { DataQuery, urlUtil } from '@grafana/data';\n\nimport kbn from '../../core/utils/kbn';\nimport config from 'app/core/config';\nimport { getDashboardSrv } from '../dashboard/services/DashboardSrv';\nimport { StoreState } from 'app/types';\nimport { ExploreId } from 'app/types/explore';\nimport { setDashboardQueriesToUpdateOnLoad } from '../dashboard/state/reducers';\nimport { isSplit } from './state/selectors';\nimport { locationService } from '@grafana/runtime';\nimport { contextSrv } from 'app/core/services/context_srv';\n\nfunction mapStateToProps(state: StoreState, { exploreId }: { exploreId: ExploreId }) {\n const explore = state.explore;\n const splitted = isSplit(state);\n const { datasourceInstance, queries, originPanelId } = explore[exploreId]!;\n\n const roles = ['Editor', 'Admin'];\n if (config.viewersCanEdit) {\n roles.push('Viewer');\n }\n\n return {\n exploreId,\n datasourceInstance,\n queries,\n originPanelId,\n splitted,\n canEdit: roles.some((r) => contextSrv.hasRole(r)),\n };\n}\n\nconst mapDispatchToProps = {\n setDashboardQueriesToUpdateOnLoad,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\ntype Props = ConnectedProps<typeof connector>;\n\nexport const UnconnectedReturnToDashboardButton: FC<Props> = ({\n originPanelId,\n setDashboardQueriesToUpdateOnLoad,\n queries,\n splitted,\n canEdit,\n}) => {\n const withOriginId = originPanelId && Number.isInteger(originPanelId);\n\n // If in split mode, or no origin id, escape early and return null\n if (splitted || !withOriginId) {\n return null;\n }\n\n const cleanQueries = (queries: DataQuery[]) => {\n return queries.map((query: DataQuery & { context?: string }) => {\n delete query.context;\n delete query.key;\n return query;\n });\n };\n\n const returnToPanel = async ({ withChanges = false } = {}) => {\n const dashboardSrv = getDashboardSrv();\n const dash = dashboardSrv.getCurrent();\n if (!dash) {\n return;\n }\n\n const titleSlug = kbn.slugifyForUrl(dash.title);\n\n if (withChanges) {\n setDashboardQueriesToUpdateOnLoad({\n panelId: originPanelId!,\n queries: cleanQueries(queries),\n });\n }\n\n const query: any = {};\n\n if (withChanges || dash.panelInEdit) {\n query.editPanel = originPanelId;\n } else if (dash.panelInView) {\n query.viewPanel = originPanelId;\n }\n\n locationService.push(urlUtil.renderUrl(`/d/${dash.uid}/:${titleSlug}`, query));\n };\n\n return (\n <ButtonGroup>\n <Tooltip content={'Return to panel'} placement=\"bottom\">\n <ToolbarButton data-testid=\"returnButton\" title={'Return to panel'} onClick={() => returnToPanel()}>\n <Icon name=\"arrow-left\" />\n </ToolbarButton>\n </Tooltip>\n {canEdit && (\n <ButtonSelect\n data-testid=\"returnButtonWithChanges\"\n options={[{ label: 'Return to panel with changes', value: '' }]}\n onChange={() => returnToPanel({ withChanges: true })}\n />\n )}\n </ButtonGroup>\n );\n};\n\nexport default connector(UnconnectedReturnToDashboardButton);\n","import React, { PureComponent } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\nimport { ExploreId, ExploreItemState } from 'app/types/explore';\nimport { PageToolbar, SetInterval, ToolbarButton, ToolbarButtonRow } from '@grafana/ui';\nimport { DataSourceInstanceSettings, RawTimeRange } from '@grafana/data';\nimport { DataSourcePicker } from '@grafana/runtime';\nimport { StoreState } from 'app/types/store';\nimport { createAndCopyShortLink } from 'app/core/utils/shortLinks';\nimport { changeDatasource } from './state/datasource';\nimport { splitClose, splitOpen } from './state/main';\nimport { syncTimes, changeRefreshInterval } from './state/time';\nimport { getFiscalYearStartMonth, getTimeZone } from '../profile/state/selectors';\nimport { updateFiscalYearStartMonthForSession, updateTimeZoneForSession } from '../profile/state/reducers';\nimport { ExploreTimeControls } from './ExploreTimeControls';\nimport { LiveTailButton } from './LiveTailButton';\nimport { RunButton } from './RunButton';\nimport { LiveTailControls } from './useLiveTailControls';\nimport { cancelQueries, runQueries } from './state/query';\nimport ReturnToDashboardButton from './ReturnToDashboardButton';\nimport { isSplit } from './state/selectors';\nimport { DashNavButton } from '../dashboard/components/DashNav/DashNavButton';\n\ninterface OwnProps {\n exploreId: ExploreId;\n onChangeTime: (range: RawTimeRange, changedByScanner?: boolean) => void;\n}\n\ntype Props = OwnProps & ConnectedProps<typeof connector>;\n\nclass UnConnectedExploreToolbar extends PureComponent<Props> {\n onChangeDatasource = async (dsSettings: DataSourceInstanceSettings) => {\n this.props.changeDatasource(this.props.exploreId, dsSettings.uid, { importQueries: true });\n };\n\n onRunQuery = (loading = false) => {\n const { runQueries, cancelQueries, exploreId } = this.props;\n if (loading) {\n return cancelQueries(exploreId);\n } else {\n return runQueries(exploreId);\n }\n };\n\n onChangeRefreshInterval = (item: string) => {\n const { changeRefreshInterval, exploreId } = this.props;\n changeRefreshInterval(exploreId, item);\n };\n\n onChangeTimeSync = () => {\n const { syncTimes, exploreId } = this.props;\n syncTimes(exploreId);\n };\n\n render() {\n const {\n datasourceMissing,\n closeSplit,\n exploreId,\n loading,\n range,\n timeZone,\n fiscalYearStartMonth,\n splitted,\n syncedTimes,\n refreshInterval,\n onChangeTime,\n split,\n hasLiveOption,\n isLive,\n isPaused,\n containerWidth,\n onChangeTimeZone,\n onChangeFiscalYearStartMonth,\n } = this.props;\n\n const showSmallDataSourcePicker = (splitted ? containerWidth < 700 : containerWidth < 800) || false;\n const showSmallTimePicker = splitted || containerWidth < 1210;\n\n return (\n <PageToolbar\n title={exploreId === ExploreId.left ? 'Explore' : undefined}\n pageIcon={exploreId === ExploreId.left ? 'compass' : undefined}\n leftItems={[\n exploreId === ExploreId.left && (\n <DashNavButton\n key=\"share\"\n tooltip=\"Copy shortened link\"\n icon=\"share-alt\"\n onClick={() => createAndCopyShortLink(window.location.href)}\n aria-label=\"Copy shortened link\"\n />\n ),\n !datasourceMissing && (\n <DataSourcePicker\n key={`${exploreId}-ds-picker`}\n onChange={this.onChangeDatasource}\n current={this.props.datasourceName}\n hideTextValue={showSmallDataSourcePicker}\n width={showSmallDataSourcePicker ? 8 : undefined}\n />\n ),\n ].filter(Boolean)}\n >\n <ToolbarButtonRow>\n <ReturnToDashboardButton exploreId={exploreId} />\n\n {!splitted ? (\n <ToolbarButton title=\"Split\" onClick={() => split()} icon=\"columns\" disabled={isLive}>\n Split\n </ToolbarButton>\n ) : (\n <ToolbarButton title=\"Close split pane\" onClick={() => closeSplit(exploreId)} icon=\"times\">\n Close\n </ToolbarButton>\n )}\n\n {!isLive && (\n <ExploreTimeControls\n exploreId={exploreId}\n range={range}\n timeZone={timeZone}\n fiscalYearStartMonth={fiscalYearStartMonth}\n onChangeTime={onChangeTime}\n splitted={splitted}\n syncedTimes={syncedTimes}\n onChangeTimeSync={this.onChangeTimeSync}\n hideText={showSmallTimePicker}\n onChangeTimeZone={onChangeTimeZone}\n onChangeFiscalYearStartMonth={onChangeFiscalYearStartMonth}\n />\n )}\n\n <RunButton\n refreshInterval={refreshInterval}\n onChangeRefreshInterval={this.onChangeRefreshInterval}\n isSmall={splitted || showSmallTimePicker}\n isLive={isLive}\n loading={loading || (isLive && !isPaused)}\n onRun={this.onRunQuery}\n showDropdown={!isLive}\n />\n\n {refreshInterval && <SetInterval func={this.onRunQuery} interval={refreshInterval} loading={loading} />}\n\n {hasLiveOption && (\n <LiveTailControls exploreId={exploreId}>\n {(controls) => (\n <LiveTailButton\n splitted={splitted}\n isLive={isLive}\n isPaused={isPaused}\n start={controls.start}\n pause={controls.pause}\n resume={controls.resume}\n stop={controls.stop}\n />\n )}\n </LiveTailControls>\n )}\n </ToolbarButtonRow>\n </PageToolbar>\n );\n }\n}\n\nconst mapStateToProps = (state: StoreState, { exploreId }: OwnProps) => {\n const { syncedTimes } = state.explore;\n const exploreItem: ExploreItemState = state.explore[exploreId]!;\n const {\n datasourceInstance,\n datasourceMissing,\n range,\n refreshInterval,\n loading,\n isLive,\n isPaused,\n containerWidth,\n } = exploreItem;\n\n const hasLiveOption = !!datasourceInstance?.meta?.streaming;\n\n return {\n datasourceMissing,\n datasourceName: datasourceInstance?.name,\n loading,\n range,\n timeZone: getTimeZone(state.user),\n fiscalYearStartMonth: getFiscalYearStartMonth(state.user),\n splitted: isSplit(state),\n refreshInterval,\n hasLiveOption,\n isLive,\n isPaused,\n syncedTimes,\n containerWidth,\n };\n};\n\nconst mapDispatchToProps = {\n changeDatasource,\n changeRefreshInterval,\n cancelQueries,\n runQueries,\n closeSplit: splitClose,\n split: splitOpen,\n syncTimes,\n onChangeTimeZone: updateTimeZoneForSession,\n onChangeFiscalYearStartMonth: updateFiscalYearStartMonthForSession,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\nexport const ExploreToolbar = connector(UnConnectedExploreToolbar);\n","import React from 'react';\nimport { css } from '@emotion/css';\nimport { LinkButton, CallToActionCard, Icon, useTheme2 } from '@grafana/ui';\n\nimport { contextSrv } from 'app/core/core';\nimport { AccessControlAction } from 'app/types';\n\nexport const NoDataSourceCallToAction = () => {\n const theme = useTheme2();\n\n const canCreateDataSource =\n contextSrv.hasPermission(AccessControlAction.DataSourcesCreate) &&\n contextSrv.hasPermission(AccessControlAction.DataSourcesWrite);\n\n const message =\n 'Explore requires at least one data source. Once you have added a data source, you can query it here.';\n const footer = (\n <>\n <Icon name=\"rocket\" />\n <> ProTip: You can also define data sources through configuration files. </>\n <a\n href=\"http://docs.grafana.org/administration/provisioning/#datasources?utm_source=explore\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-link\"\n >\n Learn more\n </a>\n </>\n );\n\n const ctaElement = (\n <LinkButton size=\"lg\" href=\"datasources/new\" icon=\"database\" disabled={!canCreateDataSource}>\n Add data source\n </LinkButton>\n );\n\n const cardClassName = css`\n max-width: ${theme.breakpoints.values.lg}px;\n margin-top: ${theme.spacing(2)};\n align-self: center;\n `;\n\n return (\n <CallToActionCard callToActionElement={ctaElement} className={cardClassName} footer={footer} message={message} />\n );\n};\n","import React from 'react';\nimport { css, cx } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Button, HorizontalGroup, useTheme2 } from '@grafana/ui';\n\ntype Props = {\n addQueryRowButtonDisabled?: boolean;\n addQueryRowButtonHidden?: boolean;\n richHistoryButtonActive?: boolean;\n queryInspectorButtonActive?: boolean;\n\n onClickAddQueryRowButton: () => void;\n onClickRichHistoryButton: () => void;\n onClickQueryInspectorButton: () => void;\n};\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n containerMargin: css`\n margin-top: ${theme.spacing(2)};\n `,\n };\n};\nexport function SecondaryActions(props: Props) {\n const theme = useTheme2();\n const styles = getStyles(theme);\n return (\n <div className={styles.containerMargin}>\n <HorizontalGroup>\n {!props.addQueryRowButtonHidden && (\n <Button\n variant=\"secondary\"\n aria-label=\"Add row button\"\n onClick={props.onClickAddQueryRowButton}\n disabled={props.addQueryRowButtonDisabled}\n icon=\"plus\"\n >\n Add query\n </Button>\n )}\n <Button\n variant=\"secondary\"\n aria-label=\"Rich history button\"\n className={cx({ ['explore-active-button']: props.richHistoryButtonActive })}\n onClick={props.onClickRichHistoryButton}\n icon=\"history\"\n >\n Query history\n </Button>\n <Button\n variant=\"secondary\"\n aria-label=\"Query inspector button\"\n className={cx({ ['explore-active-button']: props.queryInspectorButtonActive })}\n onClick={props.onClickQueryInspectorButton}\n icon=\"info-circle\"\n >\n Inspector\n </Button>\n </HorizontalGroup>\n </div>\n );\n}\n","import React from 'react';\nimport { useToggle } from 'react-use';\nimport { Badge, Collapse, useStyles2, useTheme2 } from '@grafana/ui';\nimport { applyFieldOverrides, DataFrame, GrafanaTheme2 } from '@grafana/data';\nimport { css } from '@emotion/css';\nimport { ExploreId, StoreState } from '../../types';\nimport { splitOpen } from './state/main';\nimport { connect, ConnectedProps } from 'react-redux';\nimport { useLinks } from './utils/links';\nimport { NodeGraph } from '../../plugins/panel/nodeGraph';\nimport { useCategorizeFrames } from '../../plugins/panel/nodeGraph/useCategorizeFrames';\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n warningText: css`\n label: warningText;\n font-size: ${theme.typography.bodySmall.fontSize};\n color: ${theme.colors.text.secondary};\n `,\n});\n\ninterface OwnProps {\n // Edges and Nodes are separate frames\n dataFrames: DataFrame[];\n exploreId: ExploreId;\n // When showing the node graph together with trace view we do some changes so it works better.\n withTraceView?: boolean;\n}\n\ntype Props = OwnProps & ConnectedProps<typeof connector>;\n\nexport function UnconnectedNodeGraphContainer(props: Props) {\n const { dataFrames, range, splitOpen, withTraceView } = props;\n const getLinks = useLinks(range, splitOpen);\n const theme = useTheme2();\n const styles = useStyles2(getStyles);\n\n // This is implicit dependency that is needed for links to work. At some point when replacing variables in the link\n // it requires field to have a display property which is added by the overrides even though we don't add any field\n // overrides in explore.\n const frames = applyFieldOverrides({\n fieldConfig: {\n defaults: {},\n overrides: [],\n },\n data: dataFrames,\n // We don't need proper replace here as it is only used in getLinks and we use getFieldLinks\n replaceVariables: (value) => value,\n theme,\n });\n\n const { nodes } = useCategorizeFrames(frames);\n const [open, toggleOpen] = useToggle(false);\n\n const countWarning =\n withTraceView && nodes[0]?.length > 1000 ? (\n <span className={styles.warningText}> ({nodes[0].length} nodes, can be slow to load)</span>\n ) : null;\n\n return (\n <Collapse\n label={\n <span>\n Node graph{countWarning}{' '}\n <Badge text={'Beta'} color={'blue'} icon={'rocket'} tooltip={'This visualization is in beta'} />\n </span>\n }\n collapsible={withTraceView}\n // We allow collapsing this only when it is shown together with trace view.\n isOpen={withTraceView ? open : true}\n onToggle={withTraceView ? () => toggleOpen() : undefined}\n >\n <div style={{ height: withTraceView ? 500 : 600 }}>\n <NodeGraph dataFrames={frames} getLinks={getLinks} />\n </div>\n </Collapse>\n );\n}\n\nfunction mapStateToProps(state: StoreState, { exploreId }: OwnProps) {\n return {\n range: state.explore[exploreId]!.range,\n };\n}\n\nconst mapDispatchToProps = {\n splitOpen,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\nexport const NodeGraphContainer = connector(UnconnectedNodeGraphContainer);\n","import React, { FC, CSSProperties } from 'react';\nimport Transition, { ExitHandler } from 'react-transition-group/Transition';\n\ninterface Props {\n duration: number;\n children: JSX.Element;\n in: boolean;\n unmountOnExit?: boolean;\n onExited?: ExitHandler<HTMLDivElement>;\n}\n\nexport const FadeIn: FC<Props> = (props) => {\n const defaultStyle: CSSProperties = {\n transition: `opacity ${props.duration}ms linear`,\n opacity: 0,\n };\n\n const transitionStyles: { [str: string]: CSSProperties } = {\n exited: { opacity: 0, display: 'none' },\n entering: { opacity: 0 },\n entered: { opacity: 1 },\n exiting: { opacity: 0 },\n };\n\n return (\n <Transition\n in={props.in}\n timeout={props.duration}\n unmountOnExit={props.unmountOnExit || false}\n onExited={props.onExited}\n >\n {(state) => (\n <div\n style={{\n ...defaultStyle,\n ...transitionStyles[state],\n }}\n >\n {props.children}\n </div>\n )}\n </Transition>\n );\n};\n","import React, { FunctionComponent } from 'react';\nimport { DataQueryError } from '@grafana/data';\nimport { Alert, useTheme2 } from '@grafana/ui';\nimport { FadeIn } from 'app/core/components/Animations/FadeIn';\nimport { css } from '@emotion/css';\n\nexport interface ErrorContainerProps {\n queryError?: DataQueryError;\n}\n\nexport const ErrorContainer: FunctionComponent<ErrorContainerProps> = (props) => {\n const { queryError } = props;\n const theme = useTheme2();\n const showError = queryError ? true : false;\n const duration = showError ? 100 : 10;\n const title = queryError ? 'Query error' : 'Unknown error';\n const message = queryError?.message || queryError?.data?.message || null;\n const alertWithTopMargin = css`\n margin-top: ${theme.spacing(2)};\n `;\n\n return (\n <FadeIn in={showError} duration={duration}>\n <Alert severity=\"error\" title={title} className={alertWithTopMargin}>\n {message}\n </Alert>\n </FadeIn>\n );\n};\n","import React from 'react';\nimport { useSelector } from 'react-redux';\nimport { ExploreId, StoreState } from '../../types';\nimport { LoadingState } from '@grafana/data';\nimport { ErrorContainer } from './ErrorContainer';\n\ninterface Props {\n exploreId: ExploreId;\n}\nexport function ResponseErrorContainer(props: Props) {\n const queryResponse = useSelector((state: StoreState) => state.explore[props.exploreId]?.queryResponse);\n\n const queryError = queryResponse?.state === LoadingState.Error ? queryResponse?.error : undefined;\n\n return <ErrorContainer queryError={queryError} />;\n}\n","import {\n DataFrame,\n DataLink,\n dateTime,\n Field,\n mapInternalLinkToExplore,\n rangeUtil,\n SplitOpen,\n TimeRange,\n} from '@grafana/data';\nimport { getTemplateSrv } from '@grafana/runtime';\nimport { Icon } from '@grafana/ui';\nimport { SpanLinkDef, SpanLinkFunc, TraceSpan } from '@jaegertracing/jaeger-ui-components';\nimport { TraceToLogsOptions } from 'app/core/components/TraceToLogsSettings';\nimport { getDatasourceSrv } from 'app/features/plugins/datasource_srv';\nimport React from 'react';\nimport { LokiQuery } from '../../../plugins/datasource/loki/types';\nimport { getFieldLinksForExplore } from '../utils/links';\n\n/**\n * This is a factory for the link creator. It returns the function mainly so it can return undefined in which case\n * the trace view won't create any links and to capture the datasource and split function making it easier to memoize\n * with useMemo.\n */\nexport function createSpanLinkFactory({\n splitOpenFn,\n traceToLogsOptions,\n dataFrame,\n}: {\n splitOpenFn: SplitOpen;\n traceToLogsOptions?: TraceToLogsOptions;\n dataFrame?: DataFrame;\n}): SpanLinkFunc | undefined {\n if (!dataFrame || dataFrame.fields.length === 1 || !dataFrame.fields.some((f) => Boolean(f.config.links?.length))) {\n // if the dataframe contains just a single blob of data (legacy format) or does not have any links configured,\n // let's try to use the old legacy path.\n return legacyCreateSpanLinkFactory(splitOpenFn, traceToLogsOptions);\n } else {\n return function (span: TraceSpan): SpanLinkDef | undefined {\n // We should be here only if there are some links in the dataframe\n const field = dataFrame.fields.find((f) => Boolean(f.config.links?.length))!;\n try {\n const links = getFieldLinksForExplore({\n field,\n rowIndex: span.dataFrameRowIndex!,\n splitOpenFn,\n range: getTimeRangeFromSpan(span),\n dataFrame,\n });\n\n return {\n href: links[0].href,\n onClick: links[0].onClick,\n content: <Icon name=\"gf-logs\" title=\"Explore the logs for this in split view\" />,\n };\n } catch (error) {\n // It's fairly easy to crash here for example if data source defines wrong interpolation in the data link\n console.error(error);\n return undefined;\n }\n };\n }\n}\n\nfunction legacyCreateSpanLinkFactory(splitOpenFn: SplitOpen, traceToLogsOptions?: TraceToLogsOptions) {\n // We should return if dataSourceUid is undefined otherwise getInstanceSettings would return testDataSource.\n if (!traceToLogsOptions?.datasourceUid) {\n return undefined;\n }\n\n const dataSourceSettings = getDatasourceSrv().getInstanceSettings(traceToLogsOptions.datasourceUid);\n\n if (!dataSourceSettings) {\n return undefined;\n }\n\n return function (span: TraceSpan): SpanLinkDef {\n // This is reusing existing code from derived fields which may not be ideal match so some data is a bit faked at\n // the moment. Issue is that the trace itself isn't clearly mapped to dataFrame (right now it's just a json blob\n // inside a single field) so the dataLinks as config of that dataFrame abstraction breaks down a bit and we do\n // it manually here instead of leaving it for the data source to supply the config.\n\n const dataLink: DataLink<LokiQuery> = {\n title: dataSourceSettings.name,\n url: '',\n internal: {\n datasourceUid: dataSourceSettings.uid,\n datasourceName: dataSourceSettings.name,\n query: {\n expr: getLokiQueryFromSpan(span, traceToLogsOptions),\n refId: '',\n },\n },\n };\n\n const link = mapInternalLinkToExplore({\n link: dataLink,\n internalLink: dataLink.internal!,\n scopedVars: {},\n range: getTimeRangeFromSpan(span, {\n startMs: traceToLogsOptions.spanStartTimeShift\n ? rangeUtil.intervalToMs(traceToLogsOptions.spanStartTimeShift)\n : 0,\n endMs: traceToLogsOptions.spanEndTimeShift ? rangeUtil.intervalToMs(traceToLogsOptions.spanEndTimeShift) : 0,\n }),\n field: {} as Field,\n onClickFn: splitOpenFn,\n replaceVariables: getTemplateSrv().replace.bind(getTemplateSrv()),\n });\n\n return {\n href: link.href,\n onClick: link.onClick,\n content: <Icon name=\"gf-logs\" title=\"Explore the logs for this in split view\" />,\n };\n };\n}\n\n/**\n * Default keys to use when there are no configured tags.\n */\nconst defaultKeys = ['cluster', 'hostname', 'namespace', 'pod'];\n\nfunction getLokiQueryFromSpan(span: TraceSpan, options: TraceToLogsOptions): string {\n const { tags: keys, filterByTraceID, filterBySpanID } = options;\n const keysToCheck = keys?.length ? keys : defaultKeys;\n const tags = [...span.process.tags, ...span.tags].reduce((acc, tag) => {\n if (keysToCheck.includes(tag.key)) {\n acc.push(`${tag.key}=\"${tag.value}\"`);\n }\n return acc;\n }, [] as string[]);\n\n let query = `{${tags.join(', ')}}`;\n\n if (filterByTraceID && span.traceID) {\n query += ` |=\"${span.traceID}\"`;\n }\n if (filterBySpanID && span.spanID) {\n query += ` |=\"${span.spanID}\"`;\n }\n\n return query;\n}\n\n/**\n * Gets a time range from the span.\n */\nfunction getTimeRangeFromSpan(\n span: TraceSpan,\n timeShift: { startMs: number; endMs: number } = { startMs: 0, endMs: 0 }\n): TimeRange {\n const adjustedStartTime = Math.floor(span.startTime / 1000 + timeShift.startMs);\n const from = dateTime(adjustedStartTime);\n const spanEndMs = (span.startTime + span.duration) / 1000;\n let adjustedEndTime = Math.floor(spanEndMs + timeShift.endMs);\n\n // Because we can only pass milliseconds in the url we need to check if they equal.\n // We need end time to be later than start time\n if (adjustedStartTime === adjustedEndTime) {\n adjustedEndTime++;\n }\n const to = dateTime(adjustedEndTime);\n\n // Beware that public/app/features/explore/state/main.ts SplitOpen fn uses the range from here. No matter what is in the url.\n return {\n from,\n to,\n raw: {\n from,\n to,\n },\n };\n}\n","import { GrafanaTheme } from '@grafana/data';\nimport {\n Button,\n Input,\n Popover,\n PopoverController,\n stylesFactory,\n Tooltip as GrafanaTooltip,\n useTheme,\n} from '@grafana/ui';\nimport { ButtonProps, Elements, PopoverProps, TooltipProps } from '@jaegertracing/jaeger-ui-components';\nimport cx from 'classnames';\nimport { css } from '@emotion/css';\nimport React, { useRef } from 'react';\n\n/**\n * Right now Jaeger components need some UI elements to be injected. This is to get rid of AntD UI library that was\n * used by default.\n */\n\n// This needs to be static to prevent remounting on every render.\nexport const UIElements: Elements = {\n Popover({ children, content, overlayClassName }: PopoverProps) {\n const popoverRef = useRef<HTMLElement>(null);\n\n return (\n <PopoverController content={content} hideAfter={300}>\n {(showPopper, hidePopper, popperProps) => {\n return (\n <>\n {popoverRef.current && (\n <Popover\n {...popperProps}\n referenceElement={popoverRef.current}\n wrapperClassName={overlayClassName}\n onMouseLeave={hidePopper}\n onMouseEnter={showPopper}\n />\n )}\n\n {React.cloneElement(children, {\n ref: popoverRef,\n onMouseEnter: showPopper,\n onMouseLeave: hidePopper,\n })}\n </>\n );\n }}\n </PopoverController>\n );\n },\n Tooltip({ children, title }: TooltipProps) {\n return <GrafanaTooltip content={title}>{children}</GrafanaTooltip>;\n },\n Icon: (() => null as any) as any,\n Dropdown: (() => null as any) as any,\n Menu: (() => null as any) as any,\n MenuItem: (() => null as any) as any,\n Button({ onClick, children, className }: ButtonProps) {\n return (\n <Button variant=\"secondary\" onClick={onClick} className={className}>\n {children}\n </Button>\n );\n },\n Divider,\n Input(props) {\n return <Input {...props} />;\n },\n InputGroup({ children, className, style }) {\n return (\n <span className={className} style={style}>\n {children}\n </span>\n );\n },\n};\n\nconst getStyles = stylesFactory((theme: GrafanaTheme) => {\n return {\n Divider: css`\n display: inline-block;\n background: ${theme.isDark ? '#242424' : '#e8e8e8'};\n width: 1px;\n height: 0.9em;\n margin: 0 8px;\n vertical-align: middle;\n `,\n };\n});\n\nfunction Divider({ className }: { className?: string }) {\n const styles = getStyles(useTheme());\n return <div style={{}} className={cx(styles.Divider, className)} />;\n}\n","import { useCallback, useState } from 'react';\nimport { TraceSpan } from '@jaegertracing/jaeger-ui-components';\n\n/**\n * Children state means whether spans are collapsed or not. Also provides some functions to manipulate that state.\n */\nexport function useChildrenState() {\n const [childrenHiddenIDs, setChildrenHiddenIDs] = useState(new Set<string>());\n\n const expandOne = useCallback(\n function expandOne(spans: TraceSpan[]) {\n if (childrenHiddenIDs.size === 0) {\n return;\n }\n let prevExpandedDepth = -1;\n let expandNextHiddenSpan = true;\n const newChildrenHiddenIDs = spans.reduce((res, s) => {\n if (s.depth <= prevExpandedDepth) {\n expandNextHiddenSpan = true;\n }\n if (expandNextHiddenSpan && res.has(s.spanID)) {\n res.delete(s.spanID);\n expandNextHiddenSpan = false;\n prevExpandedDepth = s.depth;\n }\n return res;\n }, new Set(childrenHiddenIDs));\n setChildrenHiddenIDs(newChildrenHiddenIDs);\n },\n [childrenHiddenIDs]\n );\n\n const collapseOne = useCallback(\n function collapseOne(spans: TraceSpan[]) {\n if (shouldDisableCollapse(spans, childrenHiddenIDs)) {\n return;\n }\n let nearestCollapsedAncestor: TraceSpan | undefined;\n const newChildrenHiddenIDs = spans.reduce((res, curSpan) => {\n if (nearestCollapsedAncestor && curSpan.depth <= nearestCollapsedAncestor.depth) {\n res.add(nearestCollapsedAncestor.spanID);\n if (curSpan.hasChildren) {\n nearestCollapsedAncestor = curSpan;\n }\n } else if (curSpan.hasChildren && !res.has(curSpan.spanID)) {\n nearestCollapsedAncestor = curSpan;\n }\n return res;\n }, new Set(childrenHiddenIDs));\n // The last one\n if (nearestCollapsedAncestor) {\n newChildrenHiddenIDs.add(nearestCollapsedAncestor.spanID);\n }\n setChildrenHiddenIDs(newChildrenHiddenIDs);\n },\n [childrenHiddenIDs]\n );\n\n const expandAll = useCallback(function expandAll() {\n setChildrenHiddenIDs(new Set<string>());\n }, []);\n\n const collapseAll = useCallback(\n function collapseAll(spans: TraceSpan[]) {\n if (shouldDisableCollapse(spans, childrenHiddenIDs)) {\n return;\n }\n const newChildrenHiddenIDs = spans.reduce((res, s) => {\n if (s.hasChildren) {\n res.add(s.spanID);\n }\n return res;\n }, new Set<string>());\n\n setChildrenHiddenIDs(newChildrenHiddenIDs);\n },\n [childrenHiddenIDs]\n );\n\n const childrenToggle = useCallback(\n function childrenToggle(spanID: string) {\n const newChildrenHiddenIDs = new Set(childrenHiddenIDs);\n if (childrenHiddenIDs.has(spanID)) {\n newChildrenHiddenIDs.delete(spanID);\n } else {\n newChildrenHiddenIDs.add(spanID);\n }\n setChildrenHiddenIDs(newChildrenHiddenIDs);\n },\n [childrenHiddenIDs]\n );\n\n return {\n childrenHiddenIDs,\n expandOne,\n collapseOne,\n expandAll,\n collapseAll,\n childrenToggle,\n };\n}\n\nfunction shouldDisableCollapse(allSpans: TraceSpan[], hiddenSpansIds: Set<string>) {\n const allParentSpans = allSpans.filter((s) => s.hasChildren);\n return allParentSpans.length === hiddenSpansIds.size;\n}\n","import { useCallback, useState, useEffect } from 'react';\nimport { DataFrame } from '@grafana/data';\nimport { DetailState } from '@jaegertracing/jaeger-ui-components';\nimport { TraceLog } from '@jaegertracing/jaeger-ui-components/src/types/trace';\n\n/**\n * Keeps state of the span detail. This means whether span details are open but also state of each detail subitem\n * like logs or tags.\n */\nexport function useDetailState(frame: DataFrame) {\n const [detailStates, setDetailStates] = useState(new Map<string, DetailState>());\n\n // Clear detail state when new trace arrives\n useEffect(() => {\n setDetailStates(new Map<string, DetailState>());\n }, [frame, setDetailStates]);\n\n const toggleDetail = useCallback(\n function toggleDetail(spanID: string) {\n const newDetailStates = new Map(detailStates);\n if (newDetailStates.has(spanID)) {\n newDetailStates.delete(spanID);\n } else {\n newDetailStates.set(spanID, new DetailState());\n }\n setDetailStates(newDetailStates);\n },\n [detailStates]\n );\n\n const detailLogItemToggle = useCallback(\n function detailLogItemToggle(spanID: string, log: TraceLog) {\n const old = detailStates.get(spanID);\n if (!old) {\n return;\n }\n const detailState = old.toggleLogItem(log);\n const newDetailStates = new Map(detailStates);\n newDetailStates.set(spanID, detailState);\n return setDetailStates(newDetailStates);\n },\n [detailStates]\n );\n\n return {\n detailStates,\n toggleDetail,\n detailLogItemToggle,\n detailLogsToggle: useCallback(\n (spanID: string) => makeDetailSubsectionToggle('logs', detailStates, setDetailStates)(spanID),\n [detailStates]\n ),\n detailWarningsToggle: useCallback(\n (spanID: string) => makeDetailSubsectionToggle('warnings', detailStates, setDetailStates)(spanID),\n [detailStates]\n ),\n detailStackTracesToggle: useCallback(\n (spanID: string) => makeDetailSubsectionToggle('stackTraces', detailStates, setDetailStates)(spanID),\n [detailStates]\n ),\n detailReferencesToggle: useCallback(\n (spanID: string) => makeDetailSubsectionToggle('references', detailStates, setDetailStates)(spanID),\n [detailStates]\n ),\n detailProcessToggle: useCallback(\n (spanID: string) => makeDetailSubsectionToggle('process', detailStates, setDetailStates)(spanID),\n [detailStates]\n ),\n detailTagsToggle: useCallback(\n (spanID: string) => makeDetailSubsectionToggle('tags', detailStates, setDetailStates)(spanID),\n [detailStates]\n ),\n };\n}\n\nfunction makeDetailSubsectionToggle(\n subSection: 'tags' | 'process' | 'logs' | 'warnings' | 'references' | 'stackTraces',\n detailStates: Map<string, DetailState>,\n setDetailStates: (detailStates: Map<string, DetailState>) => void\n) {\n return (spanID: string) => {\n const old = detailStates.get(spanID);\n if (!old) {\n return;\n }\n let detailState;\n if (subSection === 'tags') {\n detailState = old.toggleTags();\n } else if (subSection === 'process') {\n detailState = old.toggleProcess();\n } else if (subSection === 'warnings') {\n detailState = old.toggleWarnings();\n } else if (subSection === 'references') {\n detailState = old.toggleReferences();\n } else if (subSection === 'stackTraces') {\n detailState = old.toggleStackTraces();\n } else {\n detailState = old.toggleLogs();\n }\n const newDetailStates = new Map(detailStates);\n newDetailStates.set(spanID, detailState);\n setDetailStates(newDetailStates);\n };\n}\n","import { DataFrame, DataFrameView, SplitOpen, TraceSpanRow } from '@grafana/data';\nimport { colors, useTheme } from '@grafana/ui';\nimport {\n ThemeOptions,\n ThemeProvider,\n ThemeType,\n Trace,\n TracePageHeader,\n TraceProcess,\n TraceResponse,\n TraceTimelineViewer,\n transformTraceData,\n TTraceTimeline,\n UIElementsContext,\n} from '@jaegertracing/jaeger-ui-components';\nimport { TraceToLogsData } from 'app/core/components/TraceToLogsSettings';\nimport { getDatasourceSrv } from 'app/features/plugins/datasource_srv';\nimport { getTimeZone } from 'app/features/profile/state/selectors';\nimport { StoreState } from 'app/types';\nimport { ExploreId } from 'app/types/explore';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { useSelector } from 'react-redux';\nimport { createSpanLinkFactory } from './createSpanLink';\nimport { UIElements } from './uiElements';\nimport { useChildrenState } from './useChildrenState';\nimport { useDetailState } from './useDetailState';\nimport { useHoverIndentGuide } from './useHoverIndentGuide';\nimport { useSearch } from './useSearch';\nimport { useViewRange } from './useViewRange';\n\nfunction noop(): {} {\n return {};\n}\n\ntype Props = {\n dataFrames: DataFrame[];\n splitOpenFn: SplitOpen;\n exploreId: ExploreId;\n scrollElement?: Element;\n};\n\nexport function TraceView(props: Props) {\n // At this point we only show single trace\n const frame = props.dataFrames[0];\n\n const { expandOne, collapseOne, childrenToggle, collapseAll, childrenHiddenIDs, expandAll } = useChildrenState();\n const {\n detailStates,\n toggleDetail,\n detailLogItemToggle,\n detailLogsToggle,\n detailProcessToggle,\n detailReferencesToggle,\n detailTagsToggle,\n detailWarningsToggle,\n detailStackTracesToggle,\n } = useDetailState(frame);\n\n const { removeHoverIndentGuideId, addHoverIndentGuideId, hoverIndentGuideIds } = useHoverIndentGuide();\n const { viewRange, updateViewRangeTime, updateNextViewRangeTime } = useViewRange();\n\n /**\n * Keeps state of resizable name column width\n */\n const [spanNameColumnWidth, setSpanNameColumnWidth] = useState(0.25);\n /**\n * State of the top minimap, slim means it is collapsed.\n */\n const [slim, setSlim] = useState(false);\n\n const traceProp = useMemo(() => transformDataFrames(frame), [frame]);\n const { search, setSearch, spanFindMatches } = useSearch(traceProp?.spans);\n const dataSourceName = useSelector((state: StoreState) => state.explore[props.exploreId]?.datasourceInstance?.name);\n const traceToLogsOptions = (getDatasourceSrv().getInstanceSettings(dataSourceName)?.jsonData as TraceToLogsData)\n ?.tracesToLogs;\n const timeZone = useSelector((state: StoreState) => getTimeZone(state.user));\n\n const theme = useTheme();\n const traceTheme = useMemo(\n () =>\n ({\n type: theme.isDark ? ThemeType.Dark : ThemeType.Light,\n servicesColorPalette: colors,\n components: {\n TraceName: {\n fontSize: theme.typography.size.lg,\n },\n },\n } as ThemeOptions),\n [theme]\n );\n\n const traceTimeline: TTraceTimeline = useMemo(\n () => ({\n childrenHiddenIDs,\n detailStates,\n hoverIndentGuideIds,\n shouldScrollToFirstUiFindMatch: false,\n spanNameColumnWidth,\n traceID: traceProp?.traceID,\n }),\n [childrenHiddenIDs, detailStates, hoverIndentGuideIds, spanNameColumnWidth, traceProp?.traceID]\n );\n\n const createSpanLink = useMemo(\n () => createSpanLinkFactory({ splitOpenFn: props.splitOpenFn, traceToLogsOptions, dataFrame: frame }),\n [props.splitOpenFn, traceToLogsOptions, frame]\n );\n const onSlimViewClicked = useCallback(() => setSlim(!slim), [slim]);\n\n if (!props.dataFrames?.length || !traceProp) {\n return null;\n }\n\n return (\n <ThemeProvider value={traceTheme}>\n <UIElementsContext.Provider value={UIElements}>\n <TracePageHeader\n canCollapse={false}\n clearSearch={noop}\n focusUiFindMatches={noop}\n hideMap={false}\n hideSummary={false}\n nextResult={noop}\n onSlimViewClicked={onSlimViewClicked}\n onTraceGraphViewClicked={noop}\n prevResult={noop}\n resultCount={0}\n slimView={slim}\n textFilter={null}\n trace={traceProp}\n traceGraphView={false}\n updateNextViewRangeTime={updateNextViewRangeTime}\n updateViewRangeTime={updateViewRangeTime}\n viewRange={viewRange}\n searchValue={search}\n onSearchValueChange={setSearch}\n hideSearchButtons={true}\n timeZone={timeZone}\n />\n <TraceTimelineViewer\n registerAccessors={noop}\n scrollToFirstVisibleSpan={noop}\n findMatchesIDs={spanFindMatches}\n trace={traceProp}\n traceTimeline={traceTimeline}\n updateNextViewRangeTime={updateNextViewRangeTime}\n updateViewRangeTime={updateViewRangeTime}\n viewRange={viewRange}\n focusSpan={noop}\n createLinkToExternalSpan={noop as any}\n setSpanNameColumnWidth={setSpanNameColumnWidth}\n collapseAll={collapseAll}\n collapseOne={collapseOne}\n expandAll={expandAll}\n expandOne={expandOne}\n childrenToggle={childrenToggle}\n clearShouldScrollToFirstUiFindMatch={noop}\n detailLogItemToggle={detailLogItemToggle}\n detailLogsToggle={detailLogsToggle}\n detailWarningsToggle={detailWarningsToggle}\n detailStackTracesToggle={detailStackTracesToggle}\n detailReferencesToggle={detailReferencesToggle}\n detailProcessToggle={detailProcessToggle}\n detailTagsToggle={detailTagsToggle}\n detailToggle={toggleDetail}\n setTrace={noop}\n addHoverIndentGuideId={addHoverIndentGuideId}\n removeHoverIndentGuideId={removeHoverIndentGuideId}\n linksGetter={noop as any}\n uiFind={search}\n createSpanLink={createSpanLink}\n scrollElement={props.scrollElement}\n />\n </UIElementsContext.Provider>\n </ThemeProvider>\n );\n}\n\nfunction transformDataFrames(frame?: DataFrame): Trace | null {\n if (!frame) {\n return null;\n }\n let data: TraceResponse =\n frame.fields.length === 1\n ? // For backward compatibility when we sent whole json response in a single field/value\n frame.fields[0].values.get(0)\n : transformTraceDataFrame(frame);\n return transformTraceData(data);\n}\n\nfunction transformTraceDataFrame(frame: DataFrame): TraceResponse {\n const view = new DataFrameView<TraceSpanRow>(frame);\n const processes: Record<string, TraceProcess> = {};\n for (let i = 0; i < view.length; i++) {\n const span = view.get(i);\n if (!processes[span.spanID]) {\n processes[span.spanID] = {\n serviceName: span.serviceName,\n tags: span.serviceTags,\n };\n }\n }\n\n return {\n traceID: view.get(0).traceID,\n processes,\n spans: view.toArray().map((s, index) => {\n return {\n ...s,\n duration: s.duration * 1000,\n startTime: s.startTime * 1000,\n processID: s.spanID,\n flags: 0,\n references: s.parentSpanID ? [{ refType: 'CHILD_OF', spanID: s.parentSpanID, traceID: s.traceID }] : undefined,\n logs: s.logs?.map((l) => ({ ...l, timestamp: l.timestamp * 1000 })) || [],\n dataFrameRowIndex: index,\n };\n }),\n };\n}\n","import { useCallback, useState } from 'react';\n\n/**\n * This is used internally to handle hover state of indent guide. As indent guides are separate\n * components per each row/span and you need to highlight all in multiple rows to make the effect of single line\n * they need this kind of common imperative state changes.\n *\n * Ideally would be changed to trace view internal state.\n */\nexport function useHoverIndentGuide() {\n const [hoverIndentGuideIds, setHoverIndentGuideIds] = useState(new Set<string>());\n\n const addHoverIndentGuideId = useCallback(function addHoverIndentGuideId(spanID: string) {\n setHoverIndentGuideIds((prevState) => {\n const newHoverIndentGuideIds = new Set(prevState);\n newHoverIndentGuideIds.add(spanID);\n return newHoverIndentGuideIds;\n });\n }, []);\n\n const removeHoverIndentGuideId = useCallback(function removeHoverIndentGuideId(spanID: string) {\n setHoverIndentGuideIds((prevState) => {\n const newHoverIndentGuideIds = new Set(prevState);\n newHoverIndentGuideIds.delete(spanID);\n return newHoverIndentGuideIds;\n });\n }, []);\n\n return { hoverIndentGuideIds, addHoverIndentGuideId, removeHoverIndentGuideId };\n}\n","import { useCallback, useState } from 'react';\nimport { ViewRangeTimeUpdate, ViewRange } from '@jaegertracing/jaeger-ui-components';\n\n/**\n * Controls state of the zoom function that can be used through minimap in header or on the timeline. ViewRange contains\n * state not only for current range that is showing but range that is currently being selected by the user.\n */\nexport function useViewRange() {\n const [viewRange, setViewRange] = useState<ViewRange>({\n time: {\n current: [0, 1],\n },\n });\n\n const updateNextViewRangeTime = useCallback(function updateNextViewRangeTime(update: ViewRangeTimeUpdate) {\n setViewRange(\n (prevRange): ViewRange => {\n const time = { ...prevRange.time, ...update };\n return { ...prevRange, time };\n }\n );\n }, []);\n\n const updateViewRangeTime = useCallback(function updateViewRangeTime(start: number, end: number) {\n const current: [number, number] = [start, end];\n const time = { current };\n setViewRange(\n (prevRange): ViewRange => {\n return { ...prevRange, time };\n }\n );\n }, []);\n\n return { viewRange, updateViewRangeTime, updateNextViewRangeTime };\n}\n","import { useMemo, useState } from 'react';\nimport { filterSpans, TraceSpan } from '@jaegertracing/jaeger-ui-components';\n\n/**\n * Controls the state of search input that highlights spans if they match the search string.\n * @param spans\n */\nexport function useSearch(spans?: TraceSpan[]) {\n const [search, setSearch] = useState('');\n const spanFindMatches: Set<string> | undefined | null = useMemo(() => {\n return search && spans ? filterSpans(search, spans) : undefined;\n }, [search, spans]);\n\n return { search, setSearch, spanFindMatches };\n}\n","import React from 'react';\nimport { Collapse } from '@grafana/ui';\nimport { DataFrame, SplitOpen } from '@grafana/data';\nimport { TraceView } from './TraceView';\nimport { ExploreId } from 'app/types/explore';\n\ninterface Props {\n dataFrames: DataFrame[];\n splitOpenFn: SplitOpen;\n exploreId: ExploreId;\n scrollElement?: Element;\n}\nexport function TraceViewContainer(props: Props) {\n const { dataFrames, splitOpenFn, exploreId, scrollElement } = props;\n\n return (\n <Collapse label=\"Trace View\" isOpen>\n <TraceView\n exploreId={exploreId}\n dataFrames={dataFrames}\n splitOpenFn={splitOpenFn}\n scrollElement={scrollElement}\n />\n </Collapse>\n );\n}\n","import { AbsoluteTimeRange, DataQueryResponse, LoadingState, SplitOpen, TimeZone } from '@grafana/data';\nimport { Alert, Button, Collapse, InlineField, TooltipDisplayMode, useStyles2, useTheme2 } from '@grafana/ui';\nimport { ExploreGraph } from './ExploreGraph';\nimport React from 'react';\nimport { css } from '@emotion/css';\n\ntype Props = {\n logsVolumeData?: DataQueryResponse;\n absoluteRange: AbsoluteTimeRange;\n timeZone: TimeZone;\n splitOpen: SplitOpen;\n width: number;\n onUpdateTimeRange: (timeRange: AbsoluteTimeRange) => void;\n onLoadLogsVolume: () => void;\n};\n\nexport function LogsVolumePanel(props: Props) {\n const { width, logsVolumeData, absoluteRange, timeZone, splitOpen, onUpdateTimeRange, onLoadLogsVolume } = props;\n const theme = useTheme2();\n const styles = useStyles2(getStyles);\n const spacing = parseInt(theme.spacing(2).slice(0, -2), 10);\n const height = 150;\n\n let LogsVolumePanelContent;\n\n if (!logsVolumeData) {\n return null;\n } else if (logsVolumeData?.error) {\n return (\n <Alert title=\"Failed to load log volume for this query\" severity=\"warning\">\n Please check console logs for more details.\n </Alert>\n );\n } else if (logsVolumeData?.state === LoadingState.Loading) {\n LogsVolumePanelContent = <span>Log volume is loading...</span>;\n } else if (logsVolumeData?.data) {\n if (logsVolumeData.data.length > 0) {\n LogsVolumePanelContent = (\n <ExploreGraph\n graphStyle=\"lines\"\n loadingState={LoadingState.Done}\n data={logsVolumeData.data}\n height={height}\n width={width - spacing}\n absoluteRange={absoluteRange}\n onChangeTime={onUpdateTimeRange}\n timeZone={timeZone}\n splitOpenFn={splitOpen}\n tooltipDisplayMode={TooltipDisplayMode.Multi}\n />\n );\n } else {\n LogsVolumePanelContent = <span>No volume data.</span>;\n }\n }\n\n const zoomRatio = logsLevelZoomRatio(logsVolumeData, absoluteRange);\n let zoomLevelInfo;\n\n if (zoomRatio !== undefined && zoomRatio < 1) {\n zoomLevelInfo = (\n <InlineField label=\"Reload log volume\" transparent>\n <Button size=\"xs\" icon=\"sync\" variant=\"secondary\" onClick={onLoadLogsVolume} id=\"reload-volume\" />\n </InlineField>\n );\n }\n\n return (\n <Collapse label=\"Log volume\" isOpen={true} loading={logsVolumeData?.state === LoadingState.Loading}>\n <div style={{ height }} className={styles.contentContainer}>\n {LogsVolumePanelContent}\n </div>\n <div className={styles.zoomInfoContainer}>{zoomLevelInfo}</div>\n </Collapse>\n );\n}\n\nconst getStyles = () => {\n return {\n zoomInfoContainer: css`\n display: flex;\n justify-content: end;\n position: absolute;\n right: 5px;\n top: 5px;\n `,\n contentContainer: css`\n display: flex;\n align-items: center;\n justify-content: center;\n `,\n };\n};\n\nfunction logsLevelZoomRatio(\n logsVolumeData: DataQueryResponse | undefined,\n selectedTimeRange: AbsoluteTimeRange\n): number | undefined {\n const dataRange = logsVolumeData && logsVolumeData.data[0] && logsVolumeData.data[0].meta?.custom?.absoluteRange;\n return dataRange ? (selectedTimeRange.from - selectedTimeRange.to) / (dataRange.from - dataRange.to) : undefined;\n}\n","import React from 'react';\nimport { css } from '@emotion/css';\nimport { SelectableValue } from '@grafana/data';\nimport { RadioButtonGroup } from '@grafana/ui';\nimport { ExploreGraphStyle, EXPLORE_GRAPH_STYLES } from 'app/core/utils/explore';\n\nconst ALL_GRAPH_STYLE_OPTIONS: Array<SelectableValue<ExploreGraphStyle>> = EXPLORE_GRAPH_STYLES.map((style) => ({\n value: style,\n // capital-case it and switch `_` to ` `\n label: style[0].toUpperCase() + style.slice(1).replace(/_/, ' '),\n}));\n\nconst spacing = css({\n display: 'flex',\n justifyContent: 'space-between',\n});\n\ntype Props = {\n graphStyle: ExploreGraphStyle;\n onChangeGraphStyle: (style: ExploreGraphStyle) => void;\n};\n\nexport function ExploreGraphLabel(props: Props) {\n const { graphStyle, onChangeGraphStyle } = props;\n return (\n <div className={spacing}>\n Graph\n <RadioButtonGroup size=\"sm\" options={ALL_GRAPH_STYLE_OPTIONS} value={graphStyle} onChange={onChangeGraphStyle} />\n </div>\n );\n}\n","import React from 'react';\nimport { css, cx } from '@emotion/css';\nimport { compose } from 'redux';\nimport { connect, ConnectedProps } from 'react-redux';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport memoizeOne from 'memoize-one';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { Collapse, CustomScrollbar, ErrorBoundaryAlert, Themeable2, withTheme2 } from '@grafana/ui';\nimport { AbsoluteTimeRange, DataQuery, GrafanaTheme2, LoadingState, RawTimeRange } from '@grafana/data';\n\nimport LogsContainer from './LogsContainer';\nimport { QueryRows } from './QueryRows';\nimport TableContainer from './TableContainer';\nimport RichHistoryContainer from './RichHistory/RichHistoryContainer';\nimport ExploreQueryInspector from './ExploreQueryInspector';\nimport { splitOpen } from './state/main';\nimport { changeSize, changeGraphStyle } from './state/explorePane';\nimport { updateTimeRange } from './state/time';\nimport { addQueryRow, loadLogsVolumeData, modifyQueries, scanStart, scanStopAction, setQueries } from './state/query';\nimport { ExploreId, ExploreItemState } from 'app/types/explore';\nimport { StoreState } from 'app/types';\nimport { ExploreToolbar } from './ExploreToolbar';\nimport { NoDataSourceCallToAction } from './NoDataSourceCallToAction';\nimport { getTimeZone } from '../profile/state/selectors';\nimport { SecondaryActions } from './SecondaryActions';\nimport { FILTER_FOR_OPERATOR, FILTER_OUT_OPERATOR, FilterItem } from '@grafana/ui/src/components/Table/types';\nimport { NodeGraphContainer } from './NodeGraphContainer';\nimport { ResponseErrorContainer } from './ResponseErrorContainer';\nimport { TraceViewContainer } from './TraceView/TraceViewContainer';\nimport { ExploreGraph } from './ExploreGraph';\nimport { LogsVolumePanel } from './LogsVolumePanel';\nimport { ExploreGraphLabel } from './ExploreGraphLabel';\nimport { ExploreGraphStyle } from 'app/core/utils/explore';\nimport { getNodeGraphDataFrames } from 'app/plugins/panel/nodeGraph/utils';\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n exploreMain: css`\n label: exploreMain;\n // Is needed for some transition animations to work.\n position: relative;\n margin-top: 21px;\n `,\n button: css`\n label: button;\n margin: 1em 4px 0 0;\n `,\n queryContainer: css`\n label: queryContainer;\n // Need to override normal css class and don't want to count on ordering of the classes in html.\n height: auto !important;\n flex: unset !important;\n display: unset !important;\n padding: ${theme.spacing(1)};\n `,\n };\n};\n\nexport interface ExploreProps extends Themeable2 {\n exploreId: ExploreId;\n theme: GrafanaTheme2;\n}\n\nenum ExploreDrawer {\n RichHistory,\n QueryInspector,\n}\n\ninterface ExploreState {\n openDrawer?: ExploreDrawer;\n}\n\nexport type Props = ExploreProps & ConnectedProps<typeof connector>;\n\n/**\n * Explore provides an area for quick query iteration for a given datasource.\n * Once a datasource is selected it populates the query section at the top.\n * When queries are run, their results are being displayed in the main section.\n * The datasource determines what kind of query editor it brings, and what kind\n * of results viewers it supports. The state is managed entirely in Redux.\n *\n * SPLIT VIEW\n *\n * Explore can have two Explore areas side-by-side. This is handled in `Wrapper.tsx`.\n * Since there can be multiple Explores (e.g., left and right) each action needs\n * the `exploreId` as first parameter so that the reducer knows which Explore state\n * is affected.\n *\n * DATASOURCE REQUESTS\n *\n * A click on Run Query creates transactions for all DataQueries for all expanded\n * result viewers. New runs are discarding previous runs. Upon completion a transaction\n * saves the result. The result viewers construct their data from the currently existing\n * transactions.\n *\n * The result viewers determine some of the query options sent to the datasource, e.g.,\n * `format`, to indicate eventual transformations by the datasources' result transformers.\n */\nexport class Explore extends React.PureComponent<Props, ExploreState> {\n scrollElement: HTMLDivElement | undefined;\n\n constructor(props: Props) {\n super(props);\n this.state = {\n openDrawer: undefined,\n };\n }\n\n onChangeTime = (rawRange: RawTimeRange) => {\n const { updateTimeRange, exploreId } = this.props;\n updateTimeRange({ exploreId, rawRange });\n };\n\n // Use this in help pages to set page to a single query\n onClickExample = (query: DataQuery) => {\n this.props.setQueries(this.props.exploreId, [query]);\n };\n\n onCellFilterAdded = (filter: FilterItem) => {\n const { value, key, operator } = filter;\n if (operator === FILTER_FOR_OPERATOR) {\n this.onClickFilterLabel(key, value);\n }\n\n if (operator === FILTER_OUT_OPERATOR) {\n this.onClickFilterOutLabel(key, value);\n }\n };\n\n onClickFilterLabel = (key: string, value: string) => {\n this.onModifyQueries({ type: 'ADD_FILTER', key, value });\n };\n\n onClickFilterOutLabel = (key: string, value: string) => {\n this.onModifyQueries({ type: 'ADD_FILTER_OUT', key, value });\n };\n\n onClickAddQueryRowButton = () => {\n const { exploreId, queryKeys } = this.props;\n this.props.addQueryRow(exploreId, queryKeys.length);\n };\n\n onModifyQueries = (action: any, index?: number) => {\n const { datasourceInstance } = this.props;\n if (datasourceInstance?.modifyQuery) {\n const modifier = (queries: DataQuery, modification: any) =>\n datasourceInstance.modifyQuery!(queries, modification);\n this.props.modifyQueries(this.props.exploreId, action, modifier, index);\n }\n };\n\n onResize = (size: { height: number; width: number }) => {\n this.props.changeSize(this.props.exploreId, size);\n };\n\n onStartScanning = () => {\n // Scanner will trigger a query\n this.props.scanStart(this.props.exploreId);\n };\n\n onStopScanning = () => {\n this.props.scanStopAction({ exploreId: this.props.exploreId });\n };\n\n onUpdateTimeRange = (absoluteRange: AbsoluteTimeRange) => {\n const { exploreId, updateTimeRange } = this.props;\n updateTimeRange({ exploreId, absoluteRange });\n };\n\n onChangeGraphStyle = (graphStyle: ExploreGraphStyle) => {\n const { exploreId, changeGraphStyle } = this.props;\n changeGraphStyle(exploreId, graphStyle);\n };\n\n toggleShowRichHistory = () => {\n this.setState((state) => {\n return {\n openDrawer: state.openDrawer === ExploreDrawer.RichHistory ? undefined : ExploreDrawer.RichHistory,\n };\n });\n };\n\n toggleShowQueryInspector = () => {\n this.setState((state) => {\n return {\n openDrawer: state.openDrawer === ExploreDrawer.QueryInspector ? undefined : ExploreDrawer.QueryInspector,\n };\n });\n };\n\n renderEmptyState() {\n return (\n <div className=\"explore-container\">\n <NoDataSourceCallToAction />\n </div>\n );\n }\n\n renderGraphPanel(width: number) {\n const { graphResult, absoluteRange, timeZone, splitOpen, queryResponse, loading, theme, graphStyle } = this.props;\n const spacing = parseInt(theme.spacing(2).slice(0, -2), 10);\n const label = <ExploreGraphLabel graphStyle={graphStyle} onChangeGraphStyle={this.onChangeGraphStyle} />;\n return (\n <Collapse label={label} loading={loading} isOpen>\n <ExploreGraph\n graphStyle={graphStyle}\n data={graphResult!}\n height={400}\n width={width - spacing}\n absoluteRange={absoluteRange}\n onChangeTime={this.onUpdateTimeRange}\n timeZone={timeZone}\n annotations={queryResponse.annotations}\n splitOpenFn={splitOpen}\n loadingState={queryResponse.state}\n />\n </Collapse>\n );\n }\n\n renderLogsVolume(width: number) {\n const { logsVolumeData, exploreId, loadLogsVolumeData, absoluteRange, timeZone, splitOpen } = this.props;\n\n return (\n <LogsVolumePanel\n absoluteRange={absoluteRange}\n width={width}\n logsVolumeData={logsVolumeData}\n onUpdateTimeRange={this.onUpdateTimeRange}\n timeZone={timeZone}\n splitOpen={splitOpen}\n onLoadLogsVolume={() => loadLogsVolumeData(exploreId)}\n />\n );\n }\n\n renderTablePanel(width: number) {\n const { exploreId, datasourceInstance, timeZone } = this.props;\n return (\n <TableContainer\n ariaLabel={selectors.pages.Explore.General.table}\n width={width}\n exploreId={exploreId}\n onCellFilterAdded={datasourceInstance?.modifyQuery ? this.onCellFilterAdded : undefined}\n timeZone={timeZone}\n />\n );\n }\n\n renderLogsPanel(width: number) {\n const { exploreId, syncedTimes, theme, queryResponse } = this.props;\n const spacing = parseInt(theme.spacing(2).slice(0, -2), 10);\n return (\n <LogsContainer\n exploreId={exploreId}\n loadingState={queryResponse.state}\n syncedTimes={syncedTimes}\n width={width - spacing}\n onClickFilterLabel={this.onClickFilterLabel}\n onClickFilterOutLabel={this.onClickFilterOutLabel}\n onStartScanning={this.onStartScanning}\n onStopScanning={this.onStopScanning}\n />\n );\n }\n\n renderNodeGraphPanel() {\n const { exploreId, showTrace, queryResponse } = this.props;\n return (\n <NodeGraphContainer\n dataFrames={this.memoizedGetNodeGraphDataFrames(queryResponse.series)}\n exploreId={exploreId}\n withTraceView={showTrace}\n />\n );\n }\n\n memoizedGetNodeGraphDataFrames = memoizeOne(getNodeGraphDataFrames);\n\n renderTraceViewPanel() {\n const { queryResponse, splitOpen, exploreId } = this.props;\n const dataFrames = queryResponse.series.filter((series) => series.meta?.preferredVisualisationType === 'trace');\n\n return (\n // If there is no data (like 404) we show a separate error so no need to show anything here\n dataFrames.length && (\n <TraceViewContainer\n exploreId={exploreId}\n dataFrames={dataFrames}\n splitOpenFn={splitOpen}\n scrollElement={this.scrollElement}\n />\n )\n );\n }\n\n render() {\n const {\n datasourceInstance,\n datasourceMissing,\n exploreId,\n graphResult,\n queryResponse,\n isLive,\n theme,\n showMetrics,\n showTable,\n showLogs,\n showTrace,\n showNodeGraph,\n timeZone,\n } = this.props;\n const { openDrawer } = this.state;\n const styles = getStyles(theme);\n const showPanels = queryResponse && queryResponse.state !== LoadingState.NotStarted;\n const showRichHistory = openDrawer === ExploreDrawer.RichHistory;\n const showQueryInspector = openDrawer === ExploreDrawer.QueryInspector;\n\n return (\n <CustomScrollbar\n autoHeightMin={'100%'}\n scrollRefCallback={(scrollElement) => (this.scrollElement = scrollElement || undefined)}\n >\n <ExploreToolbar exploreId={exploreId} onChangeTime={this.onChangeTime} />\n {datasourceMissing ? this.renderEmptyState() : null}\n {datasourceInstance && (\n <div className=\"explore-container\">\n <div className={cx('panel-container', styles.queryContainer)}>\n <QueryRows exploreId={exploreId} />\n <SecondaryActions\n addQueryRowButtonDisabled={isLive}\n // We cannot show multiple traces at the same time right now so we do not show add query button.\n //TODO:unification\n addQueryRowButtonHidden={false}\n richHistoryButtonActive={showRichHistory}\n queryInspectorButtonActive={showQueryInspector}\n onClickAddQueryRowButton={this.onClickAddQueryRowButton}\n onClickRichHistoryButton={this.toggleShowRichHistory}\n onClickQueryInspectorButton={this.toggleShowQueryInspector}\n />\n <ResponseErrorContainer exploreId={exploreId} />\n </div>\n <AutoSizer onResize={this.onResize} disableHeight>\n {({ width }) => {\n if (width === 0) {\n return null;\n }\n\n return (\n <main className={cx(styles.exploreMain)} style={{ width }}>\n <ErrorBoundaryAlert>\n {showPanels && (\n <>\n {showMetrics && graphResult && (\n <ErrorBoundaryAlert>{this.renderGraphPanel(width)}</ErrorBoundaryAlert>\n )}\n {<ErrorBoundaryAlert>{this.renderLogsVolume(width)}</ErrorBoundaryAlert>}\n {showTable && <ErrorBoundaryAlert>{this.renderTablePanel(width)}</ErrorBoundaryAlert>}\n {showLogs && <ErrorBoundaryAlert>{this.renderLogsPanel(width)}</ErrorBoundaryAlert>}\n {showNodeGraph && <ErrorBoundaryAlert>{this.renderNodeGraphPanel()}</ErrorBoundaryAlert>}\n {showTrace && <ErrorBoundaryAlert>{this.renderTraceViewPanel()}</ErrorBoundaryAlert>}\n </>\n )}\n {showRichHistory && (\n <RichHistoryContainer\n width={width}\n exploreId={exploreId}\n onClose={this.toggleShowRichHistory}\n />\n )}\n {showQueryInspector && (\n <ExploreQueryInspector\n exploreId={exploreId}\n width={width}\n onClose={this.toggleShowQueryInspector}\n timeZone={timeZone}\n />\n )}\n </ErrorBoundaryAlert>\n </main>\n );\n }}\n </AutoSizer>\n </div>\n )}\n </CustomScrollbar>\n );\n }\n}\n\nfunction mapStateToProps(state: StoreState, { exploreId }: ExploreProps) {\n const explore = state.explore;\n const { syncedTimes } = explore;\n const item: ExploreItemState = explore[exploreId]!;\n const timeZone = getTimeZone(state.user);\n const {\n datasourceInstance,\n datasourceMissing,\n queryKeys,\n isLive,\n graphResult,\n logsVolumeData,\n logsResult,\n showLogs,\n showMetrics,\n showTable,\n showTrace,\n absoluteRange,\n queryResponse,\n showNodeGraph,\n loading,\n graphStyle,\n } = item;\n\n return {\n datasourceInstance,\n datasourceMissing,\n queryKeys,\n isLive,\n graphResult,\n logsVolumeData,\n logsResult: logsResult ?? undefined,\n absoluteRange,\n queryResponse,\n syncedTimes,\n timeZone,\n showLogs,\n showMetrics,\n showTable,\n showTrace,\n showNodeGraph,\n loading,\n graphStyle,\n };\n}\n\nconst mapDispatchToProps = {\n changeSize,\n changeGraphStyle,\n modifyQueries,\n scanStart,\n scanStopAction,\n setQueries,\n updateTimeRange,\n loadLogsVolumeData,\n addQueryRow,\n splitOpen,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\nexport default compose(connector, withTheme2)(Explore) as React.ComponentType<{ exploreId: ExploreId }>;\n","import React from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\nimport memoizeOne from 'memoize-one';\nimport { DataQuery, ExploreUrlState, EventBusExtended, EventBusSrv } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport store from 'app/core/store';\nimport { lastSavedUrl, cleanupPaneAction } from './state/main';\nimport { initializeExplore, refreshExplore } from './state/explorePane';\nimport { ExploreId } from 'app/types/explore';\nimport { StoreState } from 'app/types';\nimport {\n DEFAULT_RANGE,\n ensureQueries,\n getTimeRange,\n getTimeRangeFromUrl,\n lastUsedDatasourceKeyForOrgId,\n parseUrlState,\n} from 'app/core/utils/explore';\nimport { getFiscalYearStartMonth, getTimeZone } from '../profile/state/selectors';\nimport Explore from './Explore';\n\ninterface OwnProps {\n exploreId: ExploreId;\n urlQuery: string;\n split: boolean;\n}\n\ninterface Props extends OwnProps, ConnectedProps<typeof connector> {}\n\n/**\n * This component is responsible for handling initialization of an Explore pane and triggering synchronization\n * of state based on URL changes and preventing any infinite loops.\n */\nclass ExplorePaneContainerUnconnected extends React.PureComponent<Props> {\n el: any;\n exploreEvents: EventBusExtended;\n\n constructor(props: Props) {\n super(props);\n this.exploreEvents = new EventBusSrv();\n this.state = {\n openDrawer: undefined,\n };\n }\n\n componentDidMount() {\n const { initialized, exploreId, initialDatasource, initialQueries, initialRange, originPanelId } = this.props;\n const width = this.el?.offsetWidth ?? 0;\n\n // initialize the whole explore first time we mount and if browser history contains a change in datasource\n if (!initialized) {\n this.props.initializeExplore(\n exploreId,\n initialDatasource,\n initialQueries,\n initialRange,\n width,\n this.exploreEvents,\n originPanelId\n );\n }\n }\n\n componentWillUnmount() {\n this.exploreEvents.removeAllListeners();\n this.props.cleanupPaneAction({ exploreId: this.props.exploreId });\n }\n\n componentDidUpdate(prevProps: Props) {\n this.refreshExplore(prevProps.urlQuery);\n }\n\n refreshExplore = (prevUrlQuery: string) => {\n const { exploreId, urlQuery } = this.props;\n\n // Update state from url only if it changed and only if the change wasn't initialised by redux to prevent any loops\n if (urlQuery !== prevUrlQuery && urlQuery !== lastSavedUrl[exploreId]) {\n this.props.refreshExplore(exploreId, urlQuery);\n }\n };\n\n getRef = (el: any) => {\n this.el = el;\n };\n\n render() {\n const exploreClass = this.props.split ? 'explore explore-split' : 'explore';\n return (\n <div className={exploreClass} ref={this.getRef} data-testid={selectors.pages.Explore.General.container}>\n {this.props.initialized && <Explore exploreId={this.props.exploreId} />}\n </div>\n );\n }\n}\n\nconst ensureQueriesMemoized = memoizeOne(ensureQueries);\nconst getTimeRangeFromUrlMemoized = memoizeOne(getTimeRangeFromUrl);\n\nfunction mapStateToProps(state: StoreState, props: OwnProps) {\n const urlState = parseUrlState(props.urlQuery);\n const timeZone = getTimeZone(state.user);\n const fiscalYearStartMonth = getFiscalYearStartMonth(state.user);\n\n const { datasource, queries, range: urlRange, originPanelId } = (urlState || {}) as ExploreUrlState;\n const initialDatasource = datasource || store.get(lastUsedDatasourceKeyForOrgId(state.user.orgId));\n const initialQueries: DataQuery[] = ensureQueriesMemoized(queries);\n const initialRange = urlRange\n ? getTimeRangeFromUrlMemoized(urlRange, timeZone, fiscalYearStartMonth)\n : getTimeRange(timeZone, DEFAULT_RANGE, fiscalYearStartMonth);\n\n return {\n initialized: state.explore[props.exploreId]?.initialized,\n initialDatasource,\n initialQueries,\n initialRange,\n originPanelId,\n };\n}\n\nconst mapDispatchToProps = {\n initializeExplore,\n refreshExplore,\n cleanupPaneAction,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\nexport const ExplorePaneContainer = connector(ExplorePaneContainerUnconnected);\n","import React, { PureComponent } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\nimport { ExploreId, ExploreQueryParams } from 'app/types/explore';\nimport { ErrorBoundaryAlert } from '@grafana/ui';\nimport { lastSavedUrl, resetExploreAction, richHistoryUpdatedAction } from './state/main';\nimport { getRichHistory } from '../../core/utils/richHistory';\nimport { ExplorePaneContainer } from './ExplorePaneContainer';\nimport { GrafanaRouteComponentProps } from 'app/core/navigation/types';\nimport { Branding } from '../../core/components/Branding/Branding';\n\nimport { getNavModel } from '../../core/selectors/navModel';\nimport { StoreState } from 'app/types';\n\ninterface RouteProps extends GrafanaRouteComponentProps<{}, ExploreQueryParams> {}\ninterface OwnProps {}\n\nconst mapStateToProps = (state: StoreState) => {\n return {\n navModel: getNavModel(state.navIndex, 'explore'),\n exploreState: state.explore,\n };\n};\n\nconst mapDispatchToProps = {\n resetExploreAction,\n richHistoryUpdatedAction,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\ntype Props = OwnProps & RouteProps & ConnectedProps<typeof connector>;\nclass WrapperUnconnected extends PureComponent<Props> {\n componentWillUnmount() {\n this.props.resetExploreAction({});\n }\n\n componentDidMount() {\n lastSavedUrl.left = undefined;\n lastSavedUrl.right = undefined;\n\n const richHistory = getRichHistory();\n this.props.richHistoryUpdatedAction({ richHistory });\n }\n\n componentDidUpdate(prevProps: Props) {\n const { left, right } = this.props.queryParams;\n const hasSplit = Boolean(left) && Boolean(right);\n const datasourceTitle = hasSplit\n ? `${this.props.exploreState.left.datasourceInstance?.name} | ${this.props.exploreState.right?.datasourceInstance?.name}`\n : `${this.props.exploreState.left.datasourceInstance?.name}`;\n const documentTitle = `${this.props.navModel.main.text} - ${datasourceTitle} - ${Branding.AppTitle}`;\n document.title = documentTitle;\n }\n\n render() {\n const { left, right } = this.props.queryParams;\n const hasSplit = Boolean(left) && Boolean(right);\n\n return (\n <div className=\"page-scrollbar-wrapper\">\n <div className=\"explore-wrapper\">\n <ErrorBoundaryAlert style=\"page\">\n <ExplorePaneContainer split={hasSplit} exploreId={ExploreId.left} urlQuery={left} />\n </ErrorBoundaryAlert>\n {hasSplit && (\n <ErrorBoundaryAlert style=\"page\">\n <ExplorePaneContainer split={hasSplit} exploreId={ExploreId.right} urlQuery={right} />\n </ErrorBoundaryAlert>\n )}\n </div>\n </div>\n );\n }\n}\n\nconst Wrapper = connector(WrapperUnconnected);\n\nexport default Wrapper;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * <div>\n * <CSSTransition in={inProp} timeout={200} classNames=\"my-node\">\n * <div>\n * {\"I'll receive my-node-* classes\"}\n * </div>\n * </CSSTransition>\n * <button type=\"button\" onClick={() => setInProp(true)}>\n * Click to Enter\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is for to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n /* eslint-disable no-unused-expressions */\n node && node.scrollTop;\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;","import { useEffect, useRef } from 'react';\nexport default function usePrevious(state) {\n var ref = useRef();\n useEffect(function () {\n ref.current = state;\n });\n return ref.current;\n}\n","//\n// Main\n//\n\nfunction memoize (fn, options) {\n var cache = options && options.cache\n ? options.cache\n : cacheDefault\n\n var serializer = options && options.serializer\n ? options.serializer\n : serializerDefault\n\n var strategy = options && options.strategy\n ? options.strategy\n : strategyDefault\n\n return strategy(fn, {\n cache: cache,\n serializer: serializer\n })\n}\n\n//\n// Strategy\n//\n\nfunction isPrimitive (value) {\n return value == null || typeof value === 'number' || typeof value === 'boolean' // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\n\nfunction monadic (fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg)\n\n var computedValue = cache.get(cacheKey)\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg)\n cache.set(cacheKey, computedValue)\n }\n\n return computedValue\n}\n\nfunction variadic (fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3)\n var cacheKey = serializer(args)\n\n var computedValue = cache.get(cacheKey)\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args)\n cache.set(cacheKey, computedValue)\n }\n\n return computedValue\n}\n\nfunction assemble (fn, context, strategy, cache, serialize) {\n return strategy.bind(\n context,\n fn,\n cache,\n serialize\n )\n}\n\nfunction strategyDefault (fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic\n\n return assemble(\n fn,\n this,\n strategy,\n options.cache.create(),\n options.serializer\n )\n}\n\nfunction strategyVariadic (fn, options) {\n var strategy = variadic\n\n return assemble(\n fn,\n this,\n strategy,\n options.cache.create(),\n options.serializer\n )\n}\n\nfunction strategyMonadic (fn, options) {\n var strategy = monadic\n\n return assemble(\n fn,\n this,\n strategy,\n options.cache.create(),\n options.serializer\n )\n}\n\n//\n// Serializer\n//\n\nfunction serializerDefault () {\n return JSON.stringify(arguments)\n}\n\n//\n// Cache\n//\n\nfunction ObjectWithoutPrototypeCache () {\n this.cache = Object.create(null)\n}\n\nObjectWithoutPrototypeCache.prototype.has = function (key) {\n return (key in this.cache)\n}\n\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key]\n}\n\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value\n}\n\nvar cacheDefault = {\n create: function create () {\n return new ObjectWithoutPrototypeCache()\n }\n}\n\n//\n// API\n//\n\nmodule.exports = memoize\nmodule.exports.strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic\n}\n"],"names":["displayOverrideRef","isHideSeriesOverride","isSystemOverrideWithRef","seriesVisibilityConfigFactory","label","mode","fieldConfig","data","overrides","displayName","currentIndex","findIndex","SeriesVisibilityChangeMode","override","createOverride","getDisplayNames","overridesCopy","Array","from","current","splice","existing","getExistingDisplayNames","length","createExtendedOverride","allFieldsAreExcluded","names","ByNamesMatcherMode","property","id","value","viz","legend","tooltip","__systemRef","matcher","FieldMatcherID","options","prefix","undefined","readOnly","properties","find","p","index","name","push","rule","isArray","excludeName","unique","Set","frame","field","fields","type","FieldType","getFieldDisplayName","add","callback","delay","savedCallback","useRef","useEffect","interval_1","setInterval","clearInterval","Time","timeInMs","className","humanize","formatTime","inSeconds","toFixed","duration","toDuration","hours","minutes","seconds","ElapsedTime","resetKey","elapsed","setElapsed","useState","useInterval","LiveLogs","PureComponent","constructor","props","super","React","event","isPaused","onPause","this","scrollTop","clientHeight","scrollHeight","currentTarget","logRowsToRender","rowsToRender","state","slice","logRows","nextProps","render","theme","timeZone","onResume","styles","logsRowsLive","css","typography","fontFamilyMonospace","bodySmall","fontSize","logsRowFade","colors","text","tinycolor","info","transparent","setAlpha","toString","logsRowsIndicator","h6","spacing","button","fullWidth","getStyles","logsRow","logsRowLocalTime","logsRowMessage","getLogRowStyles","onScroll","cx","ref","scrollContainerRef","map","row","dateTimeFormat","timeEpochMs","hasAnsi","LogMessageAnsi","raw","entry","uid","element","liveEndDiv","scrollTo","Button","variant","onClick","Icon","stopLive","size","LiveLogsWithTheme","withTheme2","metaContainer","secondary","metaItem","error","metaLabel","fontWeightMedium","metaValue","MetaInfoItem","memo","style","useStyles2","MetaInfoText","metaItems","item","LogsMetaRow","meta","dedupStrategy","dedupCount","showDetectedFields","clearDetectedFields","hasUnescapedContent","forceEscape","onEscapeNewlines","logsMetaItem","LogsDedupStrategy","kind","LogsMetaKind","some","r","MAX_CHARACTERS","renderMetaItem","Tooltip","content","placement","LogLabels","labels","LogsNavigationPages","pages","currentPageIndex","oldestLogsFirst","loading","changeTime","time","format","systemDateFormats","createPageContent","page","Spinner","logsRange","to","useTheme2","CustomScrollbar","autoHide","pagesWrapper","pagesContainer","queryRange","line","selectedBg","selectedText","background","primary","main","v1","sm","LogsNavigation","absoluteRange","logsSortOrder","onChangeTime","scrollToTopLogs","visibleRange","queries","clearCache","addResultsToCache","setPages","setCurrentPageIndex","expectedQueriesRef","expectedRangeRef","rangeSpanRef","LogsSortOrder","onFirstPage","onLastPage","newPage","newPages","isEqual","filter","sort","a","b","sortPages","olderLogsButton","navButton","indexChange","disabled","navButtonContent","newerLogsButton","navContainer","scrollToTopButton","title","ExploreGraph","height","width","loadingState","annotations","onHiddenSeriesChanged","splitOpenFn","graphStyle","tooltipDisplayMode","TooltipDisplayMode","showAllTimeSeries","setShowAllTimeSeries","baseStructureRev","setBaseStructureRev","previousData","usePrevious","structureChangesRef","compareArrayValues","compareDataFrameStructures","structureRev","setFieldConfig","defaults","color","FieldColorModeId","custom","drawStyle","GraphDrawStyle","fillOpacity","pointSize","timeRange","dateTime","dataWithConfig","useMemo","registry","createFieldConfigRegistry","getGraphFieldConfig","defaultGraphConfig","styledFieldConfig","config","produce","draft","stacking","group","StackingMode","Error","applyGraphStyle","applyFieldOverrides","replaceVariables","fieldConfigRegistry","hiddenFrames","forEach","hideFrom","every","identity","getFrameDisplayName","seriesToShow","panelContext","eventBus","appEvents","onSplitOpen","onToggleSeriesVisibility","PanelContextProvider","timeSeriesDisclaimer","disclaimerIcon","PanelRenderer","series","pluginId","onChangeTimeRange","displayMode","LegendDisplayMode","calcs","warning","link","SETTINGS_KEYS","UnthemedLogs","createRef","showLabels","store","showTime","wrapLogMessage","prettifyLogMessage","hiddenLogLevels","isFlipping","setState","flipOrderTimer","window","setTimeout","prevState","cancelFlippingTimer","target","checked","hiddenRawLevels","level","LogLevel","preventDefault","onStartScanning","onStopScanning","key","indexOf","concat","k","memoizeOne","dedupedRows","dedupLogRows","reduce","sum","duplicates","filterLogLevels","topLogsRef","scrollIntoView","componentWillUnmount","clearTimeout","logsMeta","logsSeries","onClickFilterLabel","onClickFilterOutLabel","scanning","scanRange","showContextToggle","getFieldLinks","logsQueries","hasData","checkUnescapedContent","filteredLogs","filterRows","dedupRows","scanText","rangeUtil","infoText","onToggleLogLevel","logOptions","InlineFieldRow","InlineField","InlineSwitch","onChange","onChangeLabels","onChangewrapLogMessage","onChangePrettifyLogMessage","RadioButtonGroup","Object","values","dedupType","capitalize","description","LogsDedupDescription","onChangeDedup","radioButtons","headerButton","onChangeLogsSortOrder","logsSection","LogRows","deduplicatedRows","getRowContext","enableLogDetails","onClickShowDetectedField","showDetectedField","onClickHideDetectedField","hideDetectedField","noData","fill","onClickScan","onClickStopScan","Logs","shape","borderRadius","border","medium","logsEnter","logsEnterActive","logsExit","logsExitActive","LogsCrossFadeTransition","visible","children","CSSTransition","in","mountOnEnter","unmountOnExit","timeout","transitionDuration","classNames","enter","enterActive","exit","exitActive","LiveTailControls","controls","exploreId","dispatch","useDispatch","pause","useCallback","setPausedStateAction","resume","stop","changeRefreshInterval","RefreshPicker","runQueries","start","useLiveTailControls","LogsContainer","updateTimeRange","async","datasourceInstance","hasLogsContextSupport","getLogRowContext","rowIndex","splitOpen","range","getFieldLinksForExplore","isLive","styleOverridesForStickyNavigation","Collapse","isOpen","mapDispatchToProps","connect","explore","logsResult","logsVolumeDataProvider","logsVolumeData","getTimeZone","user","rows","isSplit","Boolean","ExploreId","QueryRows","getQueries","getDatasourceInstanceSettings","getQueryResponse","getHistory","getEventBridge","exploreItemSelector","getExploreItemSelector","createSelector","s","queryResponse","history","eventBridge","getDatasourceSrv","getInstanceSettings","makeSelectors","useSelector","dsSettings","onRunQueries","newQueries","changeQueriesAction","onAddQuery","query","refId","getNextRefIdChar","QueryEditorRows","onQueriesChange","app","CoreApp","connector","loadingInState","tableResult","TableContainer","getTableHeight","Math","max","min","onCellFilterAdded","ariaLabel","tableWidth","PANEL_BORDER","dataFrame","v","getLinks","valueRowIndex","Table","stylesFactory","container","lg","input","switch","md","retentionPeriodOptions","RichHistorySettings","retentionPeriod","starredTabAsFirstTab","activeDatasourceOnly","onChangeRetentionPeriod","toggleStarredTabAsFirstTab","toggleactiveDatasourceOnly","deleteRichHistory","useTheme","selectedOption","Field","MAX_HISTORY_ITEMS","Select","menuShouldPortal","Switch","weight","bold","ShowConfirmModalEvent","yesText","icon","onConfirm","notifyApp","createSuccessNotification","changeDatasource","updateRichHistory","setQueries","isRemoved","rigtColumnWidth","rigtColumnContentWidth","cardColor","bg2","queryCard","border1","radius","palette","orange","cardRow","xs","base","datasourceContainer","semibold","queryActionButtons","queryContainer","queryRow","updateCommentContainer","comment","regular","commentButtonRow","textArea","runButton","dsImg","activeUpdateComment","setActiveUpdateComment","setComment","queryDsInstance","setQueryDsInstance","ds","getDataSourceSrv","get","datasourceName","getQueryDsInstance","onUpdateComment","ts","onCancelUpdateComment","updateComment","TextArea","placeholder","e","IconButton","queriesToCopy","q","createQueryText","join","copyStringToClipboard","createUrlFromRichHistory","createAndCopyShortLink","starred","iconType","onKeyDown","keyEvent","shiftKey","ctrlKey","src","i","queryText","queriesToRun","importQueries","bgColor","isLight","gray5","dark4","sliderHeight","containerContent","containerSlider","slider","selectors","filterInput","multiselect","xxs","sessionName","heading","h4","footer","light","RichHistoryQueriesTab","datasourceFilters","onSelectDatasourceFilters","onChangeSortOrder","sortOrder","timeFilter","setTimeFilter","setData","searchInput","setSearchInput","debouncedSearchInput","setDebouncedSearchInput","useDebounce","datasourcesRetrievedFromQueryHistory","uniqBy","d","listOfDatasources","createDatasourcesList","filterAndSortQueries","filteredQueries","mappedQueriesToHeadings","mapQueriesToHeadings","mapNumbertoTimeInSlider","RangeSlider","tooltipAlwaysVisible","orientation","formatTooltipResult","reverse","onAfterChange","MultiSelect","FilterInput","sortOrderOptions","order","keys","idx","imgUrl","RichHistoryStarredTab","starredQueries","Tabs","SortOrder","UnThemedRichHistory","RICH_HISTORY_SETTING_KEYS","console","updateFilters","activeDatasourceInstance","componentDidMount","componentDidUpdate","prevProps","richHistory","onClose","firstTab","tabs","RichHistory","Starred","Settings","toggleActiveDatasourceOnly","TabbedContainer","defaultTab","closeIconTooltip","withTheme","extendStatics","__extends","setPrototypeOf","__proto__","prototype","hasOwnProperty","call","TypeError","String","__","create","__assign","assign","t","n","arguments","apply","top","left","cursor","right","bottom","topRight","position","bottomRight","bottomLeft","topLeft","Resizer","_super","_this","onMouseDown","onResizeStart","direction","onTouchStart","userSelect","replaceStyles","DEFAULT_SIZE","clamp","snap","round","hasDirection","dir","RegExp","test","isTouchEvent","touches","findClosestSnap","snapArray","snapGap","closestGapIndex","prev","curr","abs","gap","endsWith","str","searchStr","substr","getStringSize","getPixelSize","parentSize","innerWidth","innerHeight","Number","replace","calculateNewMax","maxWidth","maxHeight","minWidth","minHeight","definedProps","baseClassName","Resizable","ratio","resizable","parentLeft","parentTop","resizableLeft","resizableRight","resizableTop","resizableBottom","targetLeft","targetTop","appendBase","parent","parentNode","document","createElement","transform","flex","classList","appendChild","removeBase","removeChild","c","isResizing","propsSize","original","x","y","backgroundStyle","backgroundColor","opacity","zIndex","flexBasis","bind","onMouseMove","onMouseUp","defineProperty","enumerable","configurable","ownerDocument","defaultView","defaultSize","orgWidth","offsetWidth","orgHeight","offsetHeight","orgPosition","getSize","getParentSize","wrapChanged","wrap","flexWrap","bindEvents","addEventListener","capture","passive","unbindEvents","removeEventListener","computedStyle","getComputedStyle","createSizeForCssProperty","newSize","calculateNewMaxFromBoundary","boundWidth","boundHeight","boundsByDirection","widthByDirection","heightByDirection","bounds","parent_1","isFinite","calculateNewSizeFromDirection","clientX","clientY","scale","resizeRatio","_a","_b","lockAspectRatio","lockAspectRatioExtraHeight","lockAspectRatioExtraWidth","newWidth","newHeight","extraHeight","extraWidth","calculateNewSizeFromAspectRatio","computedMinWidth","computedMaxWidth","computedMinHeight","computedMaxHeight","extraMinWidth","extraMaxWidth","extraMinHeight","extraMaxHeight","lockedMinWidth","lockedMaxWidth","lockedMinHeight","lockedMaxHeight","setBoundingClientRect","parent_2","parentRect","getBoundingClientRect","targetRect","top_1","nativeEvent","isMouseEvent","parent_3","flexDirection","flexDir","startsWith","TouchEvent","stopPropagation","_c","boundaryMax","grid","newGridWidth","newGridHeight","delta","newState","onResize","onResizeStop","updateSize","renderResizer","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","handleComponent","resizers","extendsProps","acc","sizeStyle","boxSizing","flexShrink","Wrapper","as","defaultProps","drawerSlide","keyframes","weak","shadows","z3","sidemenu","drawerActive","rzHandle","shade","ExploreDrawer","drawerWidth","setHeight","_e","_dir","dataFrames","statsTab","InspectStatsTab","request","timezone","jsonTab","InspectJSONTab","dataTab","InspectDataTab","isLoading","withTransforms","withFieldConfig","QueryInspector","onRefreshQuery","errorTab","InspectErrorTab","TimeSyncButton","isSynced","ToolbarButton","ExploreTimeControls","Component","getShiftedTimeRange","dateTimeForTimeZone","onMoveTimePicker","adjustedFrom","dateMath","adjustedTo","getZoomedTimeRange","fiscalYearStartMonth","splitted","syncedTimes","onChangeTimeSync","hideText","onChangeTimeZone","onChangeFiscalYearStartMonth","timeSyncButton","timePickerCommonProps","onMoveBackward","onMoveBack","onMoveForward","onZoom","TimePickerWithHistory","onChangeTimePicker","LiveTailButton","buttonVariant","onClickMain","ButtonGroup","iconOnly","stopButtonEnter","stopButtonEnterActive","stopButtonExit","stopButtonExitActive","RunButton","isSmall","onRun","onChangeRefreshInterval","refreshInterval","showDropdown","intervals","getTimeSrv","getValidIntervals","defaultIntervals","onIntervalChanged","onRefresh","noIntervalPicker","setDashboardQueriesToUpdateOnLoad","originPanelId","roles","canEdit","contextSrv","withOriginId","isInteger","cleanQueries","context","returnToPanel","withChanges","dash","getDashboardSrv","getCurrent","titleSlug","kbn","panelId","panelInEdit","editPanel","panelInView","viewPanel","locationService","urlUtil","ButtonSelect","UnConnectedExploreToolbar","cancelQueries","syncTimes","datasourceMissing","closeSplit","split","hasLiveOption","containerWidth","showSmallDataSourcePicker","showSmallTimePicker","PageToolbar","pageIcon","leftItems","DashNavButton","location","href","DataSourcePicker","onChangeDatasource","hideTextValue","ToolbarButtonRow","ReturnToDashboardButton","onRunQuery","SetInterval","func","interval","splitClose","updateTimeZoneForSession","updateFiscalYearStartMonthForSession","ExploreToolbar","exploreItem","streaming","getFiscalYearStartMonth","NoDataSourceCallToAction","canCreateDataSource","AccessControlAction","rel","ctaElement","LinkButton","cardClassName","breakpoints","CallToActionCard","callToActionElement","message","SecondaryActions","containerMargin","HorizontalGroup","addQueryRowButtonHidden","onClickAddQueryRowButton","addQueryRowButtonDisabled","richHistoryButtonActive","onClickRichHistoryButton","queryInspectorButtonActive","onClickQueryInspectorButton","warningText","NodeGraphContainer","withTraceView","useLinks","frames","nodes","useCategorizeFrames","open","toggleOpen","useToggle","countWarning","Badge","collapsible","onToggle","NodeGraph","FadeIn","defaultStyle","transition","transitionStyles","exited","display","entering","entered","exiting","Transition","onExited","ErrorContainer","queryError","showError","alertWithTopMargin","Alert","severity","ResponseErrorContainer","LoadingState","createSpanLinkFactory","traceToLogsOptions","f","links","span","dataFrameRowIndex","getTimeRangeFromSpan","datasourceUid","dataSourceSettings","dataLink","url","internal","expr","getLokiQueryFromSpan","mapInternalLinkToExplore","internalLink","scopedVars","startMs","spanStartTimeShift","endMs","spanEndTimeShift","onClickFn","getTemplateSrv","legacyCreateSpanLinkFactory","defaultKeys","tags","filterByTraceID","filterBySpanID","keysToCheck","process","tag","includes","traceID","spanID","timeShift","adjustedStartTime","floor","startTime","spanEndMs","adjustedEndTime","UIElements","Popover","overlayClassName","popoverRef","PopoverController","hideAfter","showPopper","hidePopper","popperProps","referenceElement","wrapperClassName","onMouseLeave","onMouseEnter","Dropdown","Menu","MenuItem","Divider","Input","InputGroup","isDark","shouldDisableCollapse","allSpans","hiddenSpansIds","hasChildren","makeDetailSubsectionToggle","subSection","detailStates","setDetailStates","old","detailState","toggleTags","toggleProcess","toggleWarnings","toggleReferences","toggleStackTraces","toggleLogs","newDetailStates","Map","set","noop","TraceView","expandOne","collapseOne","childrenToggle","collapseAll","childrenHiddenIDs","expandAll","setChildrenHiddenIDs","spans","prevExpandedDepth","expandNextHiddenSpan","newChildrenHiddenIDs","res","depth","has","delete","nearestCollapsedAncestor","curSpan","useChildrenState","toggleDetail","detailLogItemToggle","detailLogsToggle","detailProcessToggle","detailReferencesToggle","detailTagsToggle","detailWarningsToggle","detailStackTracesToggle","DetailState","log","toggleLogItem","useDetailState","removeHoverIndentGuideId","addHoverIndentGuideId","hoverIndentGuideIds","setHoverIndentGuideIds","newHoverIndentGuideIds","useHoverIndentGuide","viewRange","updateViewRangeTime","updateNextViewRangeTime","setViewRange","update","prevRange","end","useViewRange","spanNameColumnWidth","setSpanNameColumnWidth","slim","setSlim","traceProp","view","DataFrameView","processes","serviceName","serviceTags","toArray","processID","flags","references","parentSpanID","refType","logs","l","timestamp","transformTraceDataFrame","transformTraceData","transformDataFrames","search","setSearch","spanFindMatches","filterSpans","useSearch","dataSourceName","jsonData","tracesToLogs","traceTheme","ThemeType","servicesColorPalette","components","TraceName","traceTimeline","shouldScrollToFirstUiFindMatch","createSpanLink","onSlimViewClicked","canCollapse","clearSearch","focusUiFindMatches","hideMap","hideSummary","nextResult","onTraceGraphViewClicked","prevResult","resultCount","slimView","textFilter","trace","traceGraphView","searchValue","onSearchValueChange","hideSearchButtons","registerAccessors","scrollToFirstVisibleSpan","findMatchesIDs","focusSpan","createLinkToExternalSpan","clearShouldScrollToFirstUiFindMatch","detailToggle","setTrace","linksGetter","uiFind","scrollElement","TraceViewContainer","LogsVolumePanel","onUpdateTimeRange","onLoadLogsVolume","parseInt","LogsVolumePanelContent","zoomRatio","selectedTimeRange","dataRange","logsLevelZoomRatio","zoomLevelInfo","contentContainer","zoomInfoContainer","ALL_GRAPH_STYLE_OPTIONS","EXPLORE_GRAPH_STYLES","toUpperCase","justifyContent","ExploreGraphLabel","onChangeGraphStyle","Explore","rawRange","operator","FILTER_FOR_OPERATOR","FILTER_OUT_OPERATOR","onModifyQueries","queryKeys","addQueryRow","action","modifyQuery","modifier","modification","modifyQueries","changeSize","scanStart","scanStopAction","changeGraphStyle","openDrawer","getNodeGraphDataFrames","renderEmptyState","renderGraphPanel","graphResult","renderLogsVolume","loadLogsVolumeData","renderTablePanel","renderLogsPanel","renderNodeGraphPanel","showTrace","memoizedGetNodeGraphDataFrames","renderTraceViewPanel","preferredVisualisationType","showMetrics","showTable","showLogs","showNodeGraph","exploreMain","showPanels","showRichHistory","showQueryInspector","autoHeightMin","scrollRefCallback","toggleShowRichHistory","toggleShowQueryInspector","disableHeight","ErrorBoundaryAlert","compose","ExplorePaneContainerUnconnected","prevUrlQuery","urlQuery","lastSavedUrl","refreshExplore","el","exploreEvents","EventBusSrv","initialized","initialDatasource","initialQueries","initialRange","initializeExplore","removeAllListeners","cleanupPaneAction","exploreClass","getRef","ensureQueriesMemoized","ensureQueries","getTimeRangeFromUrlMemoized","getTimeRangeFromUrl","urlState","parseUrlState","datasource","urlRange","lastUsedDatasourceKeyForOrgId","orgId","getTimeRange","DEFAULT_RANGE","ExplorePaneContainer","resetExploreAction","richHistoryUpdatedAction","navModel","getNavModel","navIndex","exploreState","WrapperUnconnected","getRichHistory","queryParams","datasourceTitle","documentTitle","Branding","hasSplit","removeClass","node","classes","_React$Component","_len","args","_key","appliedClasses","appear","onEnter","maybeNode","maybeAppearing","_this$resolveArgument","resolveArguments","appearing","removeClasses","addClass","onEntering","_this$resolveArgument2","onEntered","_this$resolveArgument3","onExit","onExiting","nodeRef","getClassNames","isStringClassNames","activeClassName","doneClassName","_proto","phase","_addClass","_this$appliedClasses$","active","done","_this$props","propTypes","monadic","fn","cache","serializer","arg","cacheKey","computedValue","variadic","assemble","strategy","serialize","strategyDefault","serializerDefault","JSON","stringify","ObjectWithoutPrototypeCache","cacheDefault","module","exports","strategies"],"sourceRoot":""}