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QU,EAAAA,EAAAA,GAA2B,CACjCxW,MAAO2V,EACPK,SAAU7f,EAAM6f,YAGpBxc,KAAM,cAKVsH,EAAU,QAAc,CACtB3K,MAAO,CACLggB,IAAKhgB,EAAMmgB,QAAQD,QACnBA,QAASlgB,EAAMmgB,QAAQD,QACvB7c,MAAM+c,EAAAA,EAAAA,IAAuBpgB,EAAMmgB,SACnCG,KAAMtgB,EAAMe,MAEdsC,KAAM,cAIVyP,QAAQC,IAAI,QAAS/S,GAGvB,MAAMgY,EAA+B,CAAChY,EAAeugB,EAA8BC,KACjF,MAAMC,EAAwB,OAAH,UACrB9V,EACD4V,GAEL,OAAO3L,EAAiB5U,EAAOygB,EAAWD,IAG5C,OAAO5V,EAAM5H,KAAKqG,IACTqX,EAAAA,EAAAA,MAAaC,mBAAmBtX,EAAM2O,EAAShY,QAMjD6K,EAAyB9G,IACpC,MAAM6G,EAAQ7G,EAAM6G,MAEpB,GAAKA,GAA0B,IAAjBA,EAAM7L,OAIpB,MAAO,CACLoZ,SAAU,IACDvN,EAAM5H,KAAKqG,IACTqX,EAAAA,EAAAA,MAAaC,mBAAmBtX,EAAMtF,EAAM6Q,iBAAkB7Q,Q,gBClJtE,SAASK,EAAsB/D,EAAmBqZ,GACvD,OAAOrZ,EAAMyW,OAAO4C,EAAMtD,K","sources":["webpack://grafana/./public/app/features/dashboard/dashgrid/LazyLoader.tsx","webpack://grafana/./public/app/plugins/panel/timeseries/overrides/colorSeriesConfigFactory.ts","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderLoadingIndicator.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuTrigger.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenu.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuProvider.tsx","webpack://grafana/./public/app/features/dashboard/utils/getPanelMenu.ts","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuWrapper.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderNotice.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderNotices.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelHeader/PanelHeader.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelChrome.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelChromeAngular.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/DashboardPanel.tsx","webpack://grafana/./public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderCorner.tsx","webpack://grafana/./public/app/features/dashboard/state/initDashboard.ts","webpack://grafana/./public/app/features/dashboard/state/analyticsProcessor.ts","webpack://grafana/./public/app/features/dashboard/utils/loadSnapshotData.ts","webpack://grafana/./public/app/features/panel/panellinks/linkSuppliers.ts","webpack://grafana/./public/app/features/panel/state/selectors.ts"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { useEffectOnce } from 'react-use';\n\nimport { useUniqueId } from 'app/plugins/datasource/influxdb/components/useUniqueId';\n\nexport interface Props {\n children: React.ReactNode | (({ isInView }: { isInView: boolean }) => React.ReactNode);\n width?: number;\n height?: number;\n onLoad?: () => void;\n onChange?: (isInView: boolean) => void;\n}\n\nexport function LazyLoader({ children, width, height, onLoad, onChange }: Props) {\n const id = useUniqueId();\n const [loaded, setLoaded] = useState(false);\n const [isInView, setIsInView] = useState(false);\n const wrapperRef = useRef(null);\n\n useEffectOnce(() => {\n LazyLoader.addCallback(id, (entry) => {\n if (!loaded && entry.isIntersecting) {\n setLoaded(true);\n onLoad?.();\n }\n\n setIsInView(entry.isIntersecting);\n onChange?.(entry.isIntersecting);\n });\n\n const wrapperEl = wrapperRef.current;\n\n if (wrapperEl) {\n LazyLoader.observer.observe(wrapperEl);\n }\n\n return () => {\n delete LazyLoader.callbacks[id];\n wrapperEl && LazyLoader.observer.unobserve(wrapperEl);\n if (Object.keys(LazyLoader.callbacks).length === 0) {\n LazyLoader.observer.disconnect();\n }\n };\n });\n\n return (\n
\n {loaded && (typeof children === 'function' ? children({ isInView }) : children)}\n
\n );\n}\n\nLazyLoader.callbacks = {} as Record void>;\nLazyLoader.addCallback = (id: string, c: (e: IntersectionObserverEntry) => void) => (LazyLoader.callbacks[id] = c);\nLazyLoader.observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n LazyLoader.callbacks[entry.target.id](entry);\n }\n },\n { rootMargin: '100px' }\n);\n","import {\n ConfigOverrideRule,\n DynamicConfigValue,\n FieldColorModeId,\n FieldConfigSource,\n FieldMatcherID,\n} from '@grafana/data';\n\nexport const changeSeriesColorConfigFactory = (\n label: string,\n color: string,\n fieldConfig: FieldConfigSource\n): FieldConfigSource => {\n const { overrides } = fieldConfig;\n const currentIndex = fieldConfig.overrides.findIndex((override) => {\n return override.matcher.id === FieldMatcherID.byName && override.matcher.options === label;\n });\n\n if (currentIndex < 0) {\n return {\n ...fieldConfig,\n overrides: [...fieldConfig.overrides, createOverride(label, color)],\n };\n }\n\n const overridesCopy = Array.from(overrides);\n const existing = overridesCopy[currentIndex];\n const propertyIndex = existing.properties.findIndex((p) => p.id === 'color');\n\n if (propertyIndex < 0) {\n overridesCopy[currentIndex] = {\n ...existing,\n properties: [...existing.properties, createProperty(color)],\n };\n\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n }\n\n const propertiesCopy = Array.from(existing.properties);\n propertiesCopy[propertyIndex] = createProperty(color);\n\n overridesCopy[currentIndex] = {\n ...existing,\n properties: propertiesCopy,\n };\n\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n};\n\nconst createOverride = (label: string, color: string): ConfigOverrideRule => {\n return {\n matcher: {\n id: FieldMatcherID.byName,\n options: label,\n },\n properties: [createProperty(color)],\n };\n};\n\nconst createProperty = (color: string): DynamicConfigValue => {\n return {\n id: 'color',\n value: {\n mode: FieldColorModeId.Fixed,\n fixedColor: color,\n },\n };\n};\n","import { css } from '@emotion/css';\nimport React, { FC } from 'react';\n\nimport { GrafanaTheme, LoadingState } from '@grafana/data';\nimport { Icon, Tooltip, useStyles } from '@grafana/ui';\n\ninterface Props {\n state: LoadingState;\n onClick: () => void;\n}\n\nexport const PanelHeaderLoadingIndicator: FC = ({ state, onClick }) => {\n const styles = useStyles(getStyles);\n\n if (state === LoadingState.Loading) {\n return (\n
\n \n \n \n
\n );\n }\n\n if (state === LoadingState.Streaming) {\n return (\n
\n
\n
\n );\n }\n\n return null;\n};\n\nfunction getStyles(theme: GrafanaTheme) {\n return {\n streamIndicator: css`\n width: 10px;\n height: 10px;\n background: ${theme.colors.textFaint};\n box-shadow: 0 0 2px ${theme.colors.textFaint};\n border-radius: 50%;\n position: relative;\n top: 6px;\n right: 1px;\n `,\n };\n}\n","import React, { FC, HTMLAttributes, MouseEvent, ReactElement, useCallback, useState } from 'react';\n\nimport { CartesianCoords2D } from '@grafana/data';\n\ninterface PanelHeaderMenuTriggerApi {\n panelMenuOpen: boolean;\n closeMenu: () => void;\n}\n\ninterface Props extends HTMLAttributes {\n children: (props: PanelHeaderMenuTriggerApi) => ReactElement;\n}\n\nexport const PanelHeaderMenuTrigger: FC = ({ children, ...divProps }) => {\n const [clickCoordinates, setClickCoordinates] = useState({ x: 0, y: 0 });\n const [panelMenuOpen, setPanelMenuOpen] = useState(false);\n\n const onMenuToggle = useCallback(\n (event: MouseEvent) => {\n if (!isClick(clickCoordinates, eventToClickCoordinates(event))) {\n return;\n }\n\n setPanelMenuOpen(!panelMenuOpen);\n },\n [clickCoordinates, panelMenuOpen, setPanelMenuOpen]\n );\n\n const onMouseDown = useCallback(\n (event: MouseEvent) => {\n setClickCoordinates(eventToClickCoordinates(event));\n },\n [setClickCoordinates]\n );\n\n return (\n
\n {children({ panelMenuOpen, closeMenu: () => setPanelMenuOpen(false) })}\n
\n );\n};\n\nfunction isClick(current: CartesianCoords2D, clicked: CartesianCoords2D, deadZone = 3.5): boolean {\n // A \"deadzone\" radius is added so that if the cursor is moved within this radius\n // between mousedown and mouseup, it's still considered a click and not a drag.\n const clickDistance = Math.sqrt((current.x - clicked.x) ** 2 + (current.y - clicked.y) ** 2);\n return clickDistance <= deadZone;\n}\n\nfunction eventToClickCoordinates(event: MouseEvent): CartesianCoords2D {\n return {\n x: event.clientX,\n y: event.clientY,\n };\n}\n","import React, { PureComponent } from 'react';\n\nimport { PanelMenuItem } from '@grafana/data';\n\nimport { PanelHeaderMenuItem } from './PanelHeaderMenuItem';\n\nexport interface Props {\n items: PanelMenuItem[];\n}\n\nexport class PanelHeaderMenu extends PureComponent {\n renderItems = (menu: PanelMenuItem[], isSubMenu = false) => {\n return (\n
    \n {menu.map((menuItem, idx: number) => {\n return (\n \n {menuItem.subMenu && this.renderItems(menuItem.subMenu, true)}\n \n );\n })}\n
\n );\n };\n\n render() {\n return
{this.renderItems(this.props.items)}
;\n }\n}\n","import { FC, ReactElement, useEffect, useState } from 'react';\n\nimport { PanelMenuItem } from '@grafana/data';\nimport { getPanelStateForModel } from 'app/features/panel/state/selectors';\nimport { useSelector } from 'app/types';\n\nimport { DashboardModel, PanelModel } from '../../state';\nimport { getPanelMenu } from '../../utils/getPanelMenu';\n\ninterface PanelHeaderMenuProviderApi {\n items: PanelMenuItem[];\n}\n\ninterface Props {\n panel: PanelModel;\n dashboard: DashboardModel;\n children: (props: PanelHeaderMenuProviderApi) => ReactElement;\n}\n\nexport const PanelHeaderMenuProvider: FC = ({ panel, dashboard, children }) => {\n const [items, setItems] = useState([]);\n const angularComponent = useSelector((state) => getPanelStateForModel(state, panel)?.angularComponent);\n\n useEffect(() => {\n setItems(getPanelMenu(dashboard, panel, angularComponent));\n }, [dashboard, panel, angularComponent, setItems]);\n\n return children({ items });\n};\n","import { t } from '@lingui/macro';\n\nimport { PanelMenuItem } from '@grafana/data';\nimport { AngularComponent, getDataSourceSrv, locationService, reportInteraction } from '@grafana/runtime';\nimport { PanelCtrl } from 'app/angular/panel/panel_ctrl';\nimport config from 'app/core/config';\nimport { contextSrv } from 'app/core/services/context_srv';\nimport { getExploreUrl } from 'app/core/utils/explore';\nimport { DashboardModel } from 'app/features/dashboard/state/DashboardModel';\nimport { PanelModel } from 'app/features/dashboard/state/PanelModel';\nimport {\n addLibraryPanel,\n copyPanel,\n duplicatePanel,\n removePanel,\n sharePanel,\n toggleLegend,\n unlinkLibraryPanel,\n} from 'app/features/dashboard/utils/panel';\nimport { InspectTab } from 'app/features/inspector/types';\nimport { isPanelModelLibraryPanel } from 'app/features/library-panels/guard';\nimport { store } from 'app/store/store';\n\nimport { navigateToExplore } from '../../explore/state/main';\nimport { getTimeSrv } from '../services/TimeSrv';\n\nexport function getPanelMenu(\n dashboard: DashboardModel,\n panel: PanelModel,\n angularComponent?: AngularComponent | null\n): PanelMenuItem[] {\n const onViewPanel = (event: React.MouseEvent) => {\n event.preventDefault();\n locationService.partial({\n viewPanel: panel.id,\n });\n };\n\n const onEditPanel = (event: React.MouseEvent) => {\n event.preventDefault();\n locationService.partial({\n editPanel: panel.id,\n });\n };\n\n const onSharePanel = (event: React.MouseEvent) => {\n event.preventDefault();\n sharePanel(dashboard, panel);\n };\n\n const onAddLibraryPanel = (event: React.MouseEvent) => {\n event.preventDefault();\n addLibraryPanel(dashboard, panel);\n };\n\n const onUnlinkLibraryPanel = (event: React.MouseEvent) => {\n event.preventDefault();\n unlinkLibraryPanel(panel);\n };\n\n const onInspectPanel = (tab?: InspectTab) => {\n locationService.partial({\n inspect: panel.id,\n inspectTab: tab,\n });\n\n reportInteraction('grafana_panel_menu_inspect', {\n tab: tab ?? InspectTab.Data,\n });\n };\n\n const onMore = (event: React.MouseEvent) => {\n event.preventDefault();\n };\n\n const onDuplicatePanel = (event: React.MouseEvent) => {\n event.preventDefault();\n duplicatePanel(dashboard, panel);\n };\n\n const onCopyPanel = (event: React.MouseEvent) => {\n event.preventDefault();\n copyPanel(panel);\n };\n\n const onRemovePanel = (event: React.MouseEvent) => {\n event.preventDefault();\n removePanel(dashboard, panel, true);\n };\n\n const onNavigateToExplore = (event: React.MouseEvent) => {\n event.preventDefault();\n const openInNewWindow =\n event.ctrlKey || event.metaKey ? (url: string) => window.open(`${config.appSubUrl}${url}`) : undefined;\n store.dispatch(navigateToExplore(panel, { getDataSourceSrv, getTimeSrv, getExploreUrl, openInNewWindow }) as any);\n };\n\n const onToggleLegend = (event: React.MouseEvent) => {\n event.preventDefault();\n toggleLegend(panel);\n };\n const menu: PanelMenuItem[] = [];\n\n if (!panel.isEditing) {\n const viewTextTranslation = t({\n id: 'panel.header-menu.view',\n message: `View`,\n });\n menu.push({\n text: viewTextTranslation,\n iconClassName: 'eye',\n onClick: onViewPanel,\n shortcut: 'v',\n });\n }\n\n if (dashboard.canEditPanel(panel) && !panel.isEditing) {\n menu.push({\n text: 'Edit',\n iconClassName: 'edit',\n onClick: onEditPanel,\n shortcut: 'e',\n });\n }\n\n const shareTextTranslation = t({\n id: 'panel.header-menu.share',\n message: `Share`,\n });\n\n menu.push({\n text: shareTextTranslation,\n iconClassName: 'share-alt',\n onClick: onSharePanel,\n shortcut: 'p s',\n });\n\n if (contextSrv.hasAccessToExplore() && !(panel.plugin && panel.plugin.meta.skipDataQuery)) {\n menu.push({\n text: 'Explore',\n iconClassName: 'compass',\n onClick: onNavigateToExplore,\n shortcut: 'x',\n });\n }\n\n const inspectMenu: PanelMenuItem[] = [];\n\n // Only show these inspect actions for data plugins\n if (panel.plugin && !panel.plugin.meta.skipDataQuery) {\n const dataTextTranslation = t({\n id: 'panel.header-menu.inspect-data',\n message: `Data`,\n });\n\n inspectMenu.push({\n text: dataTextTranslation,\n onClick: (e: React.MouseEvent) => onInspectPanel(InspectTab.Data),\n });\n\n if (dashboard.meta.canEdit) {\n inspectMenu.push({\n text: 'Query',\n onClick: (e: React.MouseEvent) => onInspectPanel(InspectTab.Query),\n });\n }\n }\n\n const jsonTextTranslation = t({\n id: 'panel.header-menu.inspect-json',\n message: `Panel JSON`,\n });\n\n inspectMenu.push({\n text: jsonTextTranslation,\n onClick: (e: React.MouseEvent) => onInspectPanel(InspectTab.JSON),\n });\n\n const inspectTextTranslation = t({\n id: 'panel.header-menu.inspect',\n message: `Inspect`,\n });\n\n menu.push({\n type: 'submenu',\n text: inspectTextTranslation,\n iconClassName: 'info-circle',\n onClick: (e: React.MouseEvent) => onInspectPanel(),\n shortcut: 'i',\n subMenu: inspectMenu,\n });\n\n const subMenu: PanelMenuItem[] = [];\n const canEdit = dashboard.canEditPanel(panel);\n\n if (canEdit && !(panel.isViewing || panel.isEditing)) {\n subMenu.push({\n text: 'Duplicate',\n onClick: onDuplicatePanel,\n shortcut: 'p d',\n });\n\n subMenu.push({\n text: 'Copy',\n onClick: onCopyPanel,\n });\n\n if (isPanelModelLibraryPanel(panel)) {\n subMenu.push({\n text: 'Unlink library panel',\n onClick: onUnlinkLibraryPanel,\n });\n } else {\n subMenu.push({\n text: 'Create library panel',\n onClick: onAddLibraryPanel,\n });\n }\n }\n\n // add old angular panel options\n if (angularComponent) {\n const scope = angularComponent.getScope();\n const panelCtrl: PanelCtrl = scope.$$childHead.ctrl;\n const angularMenuItems = panelCtrl.getExtendedMenu();\n\n for (const item of angularMenuItems) {\n const reactItem: PanelMenuItem = {\n text: item.text,\n href: item.href,\n shortcut: item.shortcut,\n };\n\n if (item.click) {\n reactItem.onClick = () => {\n scope.$eval(item.click, { ctrl: panelCtrl });\n };\n }\n\n subMenu.push(reactItem);\n }\n }\n\n if (panel.options.legend) {\n subMenu.push({\n text: panel.options.legend.showLegend ? 'Hide legend' : 'Show legend',\n onClick: onToggleLegend,\n shortcut: 'p l',\n });\n }\n\n // When editing hide most actions\n if (panel.isEditing) {\n subMenu.length = 0;\n }\n\n if (canEdit && panel.plugin && !panel.plugin.meta.skipDataQuery) {\n subMenu.push({\n text: 'Get help',\n onClick: (e: React.MouseEvent) => onInspectPanel(InspectTab.Help),\n });\n }\n\n if (subMenu.length) {\n const moreTextTranslation = t({\n id: 'panel.header-menu.more',\n message: `More...`,\n });\n menu.push({\n type: 'submenu',\n text: moreTextTranslation,\n iconClassName: 'cube',\n subMenu,\n onClick: onMore,\n });\n }\n\n if (dashboard.canEditPanel(panel) && !panel.isEditing && !panel.isViewing) {\n menu.push({ type: 'divider', text: '' });\n\n menu.push({\n text: 'Remove',\n iconClassName: 'trash-alt',\n onClick: onRemovePanel,\n shortcut: 'p r',\n });\n }\n\n return menu;\n}\n","import React, { FC } from 'react';\n\nimport { DashboardModel, PanelModel } from '../../state';\n\nimport { PanelHeaderMenu } from './PanelHeaderMenu';\nimport { PanelHeaderMenuProvider } from './PanelHeaderMenuProvider';\n\ninterface Props {\n panel: PanelModel;\n dashboard: DashboardModel;\n onClose: () => void;\n}\n\nexport const PanelHeaderMenuWrapper: FC = ({ panel, dashboard }) => {\n return (\n \n {({ items }) => {\n return ;\n }}\n \n );\n};\n","import React, { FC } from 'react';\n\nimport { QueryResultMetaNotice } from '@grafana/data';\nimport { Icon, Tooltip } from '@grafana/ui';\n\ninterface Props {\n notice: QueryResultMetaNotice;\n onClick: (e: React.SyntheticEvent, tab: string) => void;\n}\n\nexport const PanelHeaderNotice: FC = ({ notice, onClick }) => {\n const iconName =\n notice.severity === 'error' || notice.severity === 'warning' ? 'exclamation-triangle' : 'info-circle';\n\n return (\n \n {notice.inspect ? (\n
onClick(e, notice.inspect!)}>\n \n
\n ) : (\n \n \n \n )}\n
\n );\n};\n","import React, { FC, useCallback } from 'react';\n\nimport { DataFrame, QueryResultMetaNotice } from '@grafana/data';\nimport { locationService } from '@grafana/runtime';\n\nimport { PanelHeaderNotice } from './PanelHeaderNotice';\n\ninterface Props {\n panelId: number;\n frames: DataFrame[];\n}\n\nexport const PanelHeaderNotices: FC = ({ frames, panelId }) => {\n const openInspect = useCallback(\n (e: React.SyntheticEvent, tab: string) => {\n e.stopPropagation();\n locationService.partial({ inspect: panelId, inspectTab: tab });\n },\n [panelId]\n );\n\n // dedupe on severity\n const notices: Record = {};\n for (const frame of frames) {\n if (!frame.meta || !frame.meta.notices) {\n continue;\n }\n\n for (const notice of frame.meta.notices) {\n notices[notice.severity] = notice;\n }\n }\n\n return (\n <>\n {Object.values(notices).map((notice) => (\n \n ))}\n \n );\n};\n","import { css, cx } from '@emotion/css';\nimport React, { FC } from 'react';\n\nimport { DataLink, GrafanaTheme2, PanelData } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { Icon, useStyles2, ClickOutsideWrapper } from '@grafana/ui';\nimport { DashboardModel } from 'app/features/dashboard/state/DashboardModel';\nimport { PanelModel } from 'app/features/dashboard/state/PanelModel';\nimport { getPanelLinksSupplier } from 'app/features/panel/panellinks/linkSuppliers';\n\nimport PanelHeaderCorner from './PanelHeaderCorner';\nimport { PanelHeaderLoadingIndicator } from './PanelHeaderLoadingIndicator';\nimport { PanelHeaderMenuTrigger } from './PanelHeaderMenuTrigger';\nimport { PanelHeaderMenuWrapper } from './PanelHeaderMenuWrapper';\nimport { PanelHeaderNotices } from './PanelHeaderNotices';\n\nexport interface Props {\n panel: PanelModel;\n dashboard: DashboardModel;\n title?: string;\n description?: string;\n links?: DataLink[];\n error?: string;\n alertState?: string;\n isViewing: boolean;\n isEditing: boolean;\n data: PanelData;\n}\n\nexport const PanelHeader: FC = ({ panel, error, isViewing, isEditing, data, alertState, dashboard }) => {\n const onCancelQuery = () => panel.getQueryRunner().cancelQuery();\n const title = panel.getDisplayTitle();\n const className = cx('panel-header', !(isViewing || isEditing) ? 'grid-drag-handle' : '');\n const styles = useStyles2(panelStyles);\n\n return (\n <>\n \n \n
\n \n {({ closeMenu, panelMenuOpen }) => {\n return (\n \n
\n \n {alertState ? (\n \n ) : null}\n

{title}

\n {!dashboard.meta.publicDashboardAccessToken && (\n
\n \n {panelMenuOpen ? (\n \n ) : null}\n
\n )}\n {data.request && data.request.timeInfo && (\n \n {data.request.timeInfo}\n \n )}\n
\n
\n );\n }}\n
\n
\n \n );\n};\n\nconst panelStyles = (theme: GrafanaTheme2) => {\n return {\n titleText: css`\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n max-width: calc(100% - 38px);\n cursor: pointer;\n font-weight: ${theme.typography.fontWeightMedium};\n font-size: ${theme.typography.body.fontSize};\n margin: 0;\n\n &:hover {\n color: ${theme.colors.text.primary};\n }\n .panel-has-alert & {\n max-width: calc(100% - 54px);\n }\n `,\n };\n};\n","import classNames from 'classnames';\nimport React, { PureComponent } from 'react';\nimport { Subscription } from 'rxjs';\n\nimport {\n AbsoluteTimeRange,\n AnnotationChangeEvent,\n AnnotationEventUIModel,\n CoreApp,\n DashboardCursorSync,\n EventFilterOptions,\n FieldConfigSource,\n getDefaultTimeRange,\n LoadingState,\n PanelData,\n PanelPlugin,\n PanelPluginMeta,\n TimeRange,\n toDataFrameDTO,\n toUtc,\n} from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { config, locationService, RefreshEvent } from '@grafana/runtime';\nimport { VizLegendOptions } from '@grafana/schema';\nimport { ErrorBoundary, PanelContext, PanelContextProvider, SeriesVisibilityChangeMode } from '@grafana/ui';\nimport { PANEL_BORDER } from 'app/core/constants';\nimport { profiler } from 'app/core/profiler';\nimport { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel';\nimport { changeSeriesColorConfigFactory } from 'app/plugins/panel/timeseries/overrides/colorSeriesConfigFactory';\nimport { RenderEvent } from 'app/types/events';\n\nimport { isSoloRoute } from '../../../routes/utils';\nimport { deleteAnnotation, saveAnnotation, updateAnnotation } from '../../annotations/api';\nimport { getDashboardQueryRunner } from '../../query/state/DashboardQueryRunner/DashboardQueryRunner';\nimport { getTimeSrv, TimeSrv } from '../services/TimeSrv';\nimport { DashboardModel, PanelModel } from '../state';\nimport { loadSnapshotData } from '../utils/loadSnapshotData';\n\nimport { PanelHeader } from './PanelHeader/PanelHeader';\nimport { seriesVisibilityConfigFactory } from './SeriesVisibilityConfigFactory';\nimport { liveTimer } from './liveTimer';\n\nconst DEFAULT_PLUGIN_ERROR = 'Error in plugin';\n\nexport interface Props {\n panel: PanelModel;\n dashboard: DashboardModel;\n plugin: PanelPlugin;\n isViewing: boolean;\n isEditing: boolean;\n isInView: boolean;\n width: number;\n height: number;\n onInstanceStateChange: (value: any) => void;\n}\n\nexport interface State {\n isFirstLoad: boolean;\n renderCounter: number;\n errorMessage?: string;\n refreshWhenInView: boolean;\n context: PanelContext;\n data: PanelData;\n liveTime?: TimeRange;\n}\n\nexport class PanelChrome extends PureComponent {\n private readonly timeSrv: TimeSrv = getTimeSrv();\n private subs = new Subscription();\n private eventFilter: EventFilterOptions = { onlyLocal: true };\n\n constructor(props: Props) {\n super(props);\n\n // Can this eventBus be on PanelModel? when we have more complex event filtering, that may be a better option\n const eventBus = props.dashboard.events.newScopedBus(`panel:${props.panel.id}`, this.eventFilter);\n\n this.state = {\n isFirstLoad: true,\n renderCounter: 0,\n refreshWhenInView: false,\n context: {\n eventBus,\n app: this.getPanelContextApp(),\n sync: this.getSync,\n onSeriesColorChange: this.onSeriesColorChange,\n onToggleSeriesVisibility: this.onSeriesVisibilityChange,\n onAnnotationCreate: this.onAnnotationCreate,\n onAnnotationUpdate: this.onAnnotationUpdate,\n onAnnotationDelete: this.onAnnotationDelete,\n onInstanceStateChange: this.onInstanceStateChange,\n onToggleLegendSort: this.onToggleLegendSort,\n canAddAnnotations: props.dashboard.canAddAnnotations.bind(props.dashboard),\n canEditAnnotations: props.dashboard.canEditAnnotations.bind(props.dashboard),\n canDeleteAnnotations: props.dashboard.canDeleteAnnotations.bind(props.dashboard),\n },\n data: this.getInitialPanelDataState(),\n };\n }\n\n // Due to a mutable panel model we get the sync settings via function that proactively reads from the model\n getSync = () => (this.props.isEditing ? DashboardCursorSync.Off : this.props.dashboard.graphTooltip);\n\n onInstanceStateChange = (value: any) => {\n this.props.onInstanceStateChange(value);\n\n this.setState({\n context: {\n ...this.state.context,\n instanceState: value,\n },\n });\n };\n\n getPanelContextApp() {\n if (this.props.isEditing) {\n return CoreApp.PanelEditor;\n }\n if (this.props.isViewing) {\n return CoreApp.PanelViewer;\n }\n\n return CoreApp.Dashboard;\n }\n\n onSeriesColorChange = (label: string, color: string) => {\n this.onFieldConfigChange(changeSeriesColorConfigFactory(label, color, this.props.panel.fieldConfig));\n };\n\n onSeriesVisibilityChange = (label: string, mode: SeriesVisibilityChangeMode) => {\n this.onFieldConfigChange(\n seriesVisibilityConfigFactory(label, mode, this.props.panel.fieldConfig, this.state.data.series)\n );\n };\n\n onToggleLegendSort = (sortKey: string) => {\n const legendOptions: VizLegendOptions = this.props.panel.options.legend;\n\n // We don't want to do anything when legend options are not available\n if (!legendOptions) {\n return;\n }\n\n let sortDesc = legendOptions.sortDesc;\n let sortBy = legendOptions.sortBy;\n if (sortKey !== sortBy) {\n sortDesc = undefined;\n }\n\n // if already sort ascending, disable sorting\n if (sortDesc === false) {\n sortBy = undefined;\n sortDesc = undefined;\n } else {\n sortDesc = !sortDesc;\n sortBy = sortKey;\n }\n\n this.onOptionsChange({\n ...this.props.panel.options,\n legend: { ...legendOptions, sortBy, sortDesc },\n });\n };\n\n getInitialPanelDataState(): PanelData {\n return {\n state: LoadingState.NotStarted,\n series: [],\n timeRange: getDefaultTimeRange(),\n };\n }\n\n componentDidMount() {\n const { panel, dashboard } = this.props;\n\n // Subscribe to panel events\n this.subs.add(panel.events.subscribe(RefreshEvent, this.onRefresh));\n this.subs.add(panel.events.subscribe(RenderEvent, this.onRender));\n\n dashboard.panelInitialized(this.props.panel);\n\n // Move snapshot data into the query response\n if (this.hasPanelSnapshot) {\n this.setState({\n data: loadSnapshotData(panel, dashboard),\n isFirstLoad: false,\n });\n return;\n }\n\n if (!this.wantsQueryExecution) {\n this.setState({ isFirstLoad: false });\n }\n\n this.subs.add(\n panel\n .getQueryRunner()\n .getData({ withTransforms: true, withFieldConfig: true })\n .subscribe({\n next: (data) => this.onDataUpdate(data),\n })\n );\n\n // Listen for live timer events\n liveTimer.listen(this);\n }\n\n componentWillUnmount() {\n this.subs.unsubscribe();\n liveTimer.remove(this);\n }\n\n liveTimeChanged(liveTime: TimeRange) {\n const { data } = this.state;\n if (data.timeRange) {\n const delta = liveTime.to.valueOf() - data.timeRange.to.valueOf();\n if (delta < 100) {\n // 10hz\n console.log('Skip tick render', this.props.panel.title, delta);\n return;\n }\n }\n this.setState({ liveTime });\n }\n\n componentDidUpdate(prevProps: Props) {\n const { isInView, width } = this.props;\n const { context } = this.state;\n\n const app = this.getPanelContextApp();\n\n if (context.app !== app) {\n this.setState({\n context: {\n ...context,\n app,\n },\n });\n }\n\n // View state has changed\n if (isInView !== prevProps.isInView) {\n if (isInView) {\n // Check if we need a delayed refresh\n if (this.state.refreshWhenInView) {\n this.onRefresh();\n }\n }\n }\n\n // The timer depends on panel width\n if (width !== prevProps.width) {\n liveTimer.updateInterval(this);\n }\n }\n\n // Updates the response with information from the stream\n // The next is outside a react synthetic event so setState is not batched\n // So in this context we can only do a single call to setState\n onDataUpdate(data: PanelData) {\n const { dashboard, panel, plugin } = this.props;\n\n // Ignore this data update if we are now a non data panel\n if (plugin.meta.skipDataQuery) {\n this.setState({ data: this.getInitialPanelDataState() });\n return;\n }\n\n let { isFirstLoad } = this.state;\n let errorMessage: string | undefined;\n\n switch (data.state) {\n case LoadingState.Loading:\n // Skip updating state data if it is already in loading state\n // This is to avoid rendering partial loading responses\n if (this.state.data.state === LoadingState.Loading) {\n return;\n }\n break;\n case LoadingState.Error:\n const { error } = data;\n if (error) {\n if (errorMessage !== error.message) {\n errorMessage = error.message;\n }\n }\n break;\n case LoadingState.Done:\n // If we are doing a snapshot save data in panel model\n if (dashboard.snapshot) {\n panel.snapshotData = data.series.map((frame) => toDataFrameDTO(frame));\n }\n if (isFirstLoad) {\n isFirstLoad = false;\n }\n break;\n }\n\n this.setState({ isFirstLoad, errorMessage, data, liveTime: undefined });\n }\n\n onRefresh = () => {\n const { dashboard, panel, isInView, width } = this.props;\n\n if (!isInView) {\n this.setState({ refreshWhenInView: true });\n return;\n }\n\n const timeData = applyPanelTimeOverrides(panel, this.timeSrv.timeRange());\n\n // Issue Query\n if (this.wantsQueryExecution) {\n if (width < 0) {\n return;\n }\n\n if (this.state.refreshWhenInView) {\n this.setState({ refreshWhenInView: false });\n }\n panel.runAllPanelQueries({\n dashboardId: dashboard.id,\n dashboardUID: dashboard.uid,\n dashboardTimezone: dashboard.getTimezone(),\n publicDashboardAccessToken: dashboard.meta.publicDashboardAccessToken,\n timeData,\n width,\n });\n } else {\n // The panel should render on refresh as well if it doesn't have a query, like clock panel\n this.setState({\n data: { ...this.state.data, timeRange: this.timeSrv.timeRange() },\n renderCounter: this.state.renderCounter + 1,\n liveTime: undefined,\n });\n }\n };\n\n onRender = () => {\n const stateUpdate = { renderCounter: this.state.renderCounter + 1 };\n this.setState(stateUpdate);\n };\n\n onOptionsChange = (options: any) => {\n this.props.panel.updateOptions(options);\n };\n\n onFieldConfigChange = (config: FieldConfigSource) => {\n this.props.panel.updateFieldConfig(config);\n };\n\n onPanelError = (error: Error) => {\n const errorMessage = error.message || DEFAULT_PLUGIN_ERROR;\n if (this.state.errorMessage !== errorMessage) {\n this.setState({ errorMessage });\n }\n };\n\n onPanelErrorRecover = () => {\n this.setState({ errorMessage: undefined });\n };\n\n onAnnotationCreate = async (event: AnnotationEventUIModel) => {\n const isRegion = event.from !== event.to;\n const anno = {\n dashboardUID: this.props.dashboard.uid,\n panelId: this.props.panel.id,\n isRegion,\n time: event.from,\n timeEnd: isRegion ? event.to : 0,\n tags: event.tags,\n text: event.description,\n };\n await saveAnnotation(anno);\n getDashboardQueryRunner().run({ dashboard: this.props.dashboard, range: this.timeSrv.timeRange() });\n this.state.context.eventBus.publish(new AnnotationChangeEvent(anno));\n };\n\n onAnnotationDelete = async (id: string) => {\n await deleteAnnotation({ id });\n getDashboardQueryRunner().run({ dashboard: this.props.dashboard, range: this.timeSrv.timeRange() });\n this.state.context.eventBus.publish(new AnnotationChangeEvent({ id }));\n };\n\n onAnnotationUpdate = async (event: AnnotationEventUIModel) => {\n const isRegion = event.from !== event.to;\n const anno = {\n id: event.id,\n dashboardUID: this.props.dashboard.uid,\n panelId: this.props.panel.id,\n isRegion,\n time: event.from,\n timeEnd: isRegion ? event.to : 0,\n tags: event.tags,\n text: event.description,\n };\n await updateAnnotation(anno);\n\n getDashboardQueryRunner().run({ dashboard: this.props.dashboard, range: this.timeSrv.timeRange() });\n this.state.context.eventBus.publish(new AnnotationChangeEvent(anno));\n };\n\n get hasPanelSnapshot() {\n const { panel } = this.props;\n return panel.snapshotData && panel.snapshotData.length;\n }\n\n get wantsQueryExecution() {\n return !(this.props.plugin.meta.skipDataQuery || this.hasPanelSnapshot);\n }\n\n onChangeTimeRange = (timeRange: AbsoluteTimeRange) => {\n this.timeSrv.setTime({\n from: toUtc(timeRange.from),\n to: toUtc(timeRange.to),\n });\n };\n\n shouldSignalRenderingCompleted(loadingState: LoadingState, pluginMeta: PanelPluginMeta) {\n return loadingState === LoadingState.Done || pluginMeta.skipDataQuery;\n }\n\n skipFirstRender(loadingState: LoadingState) {\n const { isFirstLoad } = this.state;\n return (\n this.wantsQueryExecution &&\n isFirstLoad &&\n (loadingState === LoadingState.Loading || loadingState === LoadingState.NotStarted)\n );\n }\n\n renderPanel(width: number, height: number) {\n const { panel, plugin, dashboard } = this.props;\n const { renderCounter, data } = this.state;\n const { theme } = config;\n const { state: loadingState } = data;\n\n // do not render component until we have first data\n if (this.skipFirstRender(loadingState)) {\n return null;\n }\n\n // This is only done to increase a counter that is used by backend\n // image rendering to know when to capture image\n if (this.shouldSignalRenderingCompleted(loadingState, plugin.meta)) {\n profiler.renderingCompleted();\n }\n\n const PanelComponent = plugin.panel!;\n const timeRange = this.state.liveTime ?? data.timeRange ?? this.timeSrv.timeRange();\n const headerHeight = this.hasOverlayHeader() ? 0 : theme.panelHeaderHeight;\n const chromePadding = plugin.noPadding ? 0 : theme.panelPadding;\n const panelWidth = width - chromePadding * 2 - PANEL_BORDER;\n const innerPanelHeight = height - headerHeight - chromePadding * 2 - PANEL_BORDER;\n const panelContentClassNames = classNames({\n 'panel-content': true,\n 'panel-content--no-padding': plugin.noPadding,\n });\n const panelOptions = panel.getOptions();\n\n // Update the event filter (dashboard settings may have changed)\n // Yes this is called ever render for a function that is triggered on every mouse move\n this.eventFilter.onlyLocal = dashboard.graphTooltip === 0;\n\n return (\n <>\n
\n \n \n \n
\n \n );\n }\n\n hasOverlayHeader() {\n const { panel } = this.props;\n const { data } = this.state;\n\n // always show normal header if we have time override\n if (data.request && data.request.timeInfo) {\n return false;\n }\n\n return !panel.hasTitle();\n }\n\n render() {\n const { dashboard, panel, isViewing, isEditing, width, height, plugin } = this.props;\n const { errorMessage, data } = this.state;\n const { transparent } = panel;\n\n const alertState = data.alertState?.state;\n\n const containerClassNames = classNames({\n 'panel-container': true,\n 'panel-container--absolute': isSoloRoute(locationService.getLocation().pathname),\n 'panel-container--transparent': transparent,\n 'panel-container--no-title': this.hasOverlayHeader(),\n [`panel-alert-state--${alertState}`]: alertState !== undefined,\n });\n\n return (\n \n \n \n {({ error }) => {\n if (error) {\n return null;\n }\n return this.renderPanel(width, height);\n }}\n \n \n );\n }\n}\n","import classNames from 'classnames';\nimport React, { PureComponent } from 'react';\nimport { connect, MapDispatchToProps, MapStateToProps } from 'react-redux';\nimport { Subscription } from 'rxjs';\n\nimport { getDefaultTimeRange, LoadingState, PanelData, PanelPlugin } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { AngularComponent, getAngularLoader, locationService } from '@grafana/runtime';\nimport config from 'app/core/config';\nimport { PANEL_BORDER } from 'app/core/constants';\nimport { setPanelAngularComponent } from 'app/features/panel/state/reducers';\nimport { getPanelStateForModel } from 'app/features/panel/state/selectors';\nimport { StoreState } from 'app/types';\n\nimport { isSoloRoute } from '../../../routes/utils';\nimport { getTimeSrv, TimeSrv } from '../services/TimeSrv';\nimport { DashboardModel, PanelModel } from '../state';\n\nimport { PanelHeader } from './PanelHeader/PanelHeader';\n\ninterface OwnProps {\n panel: PanelModel;\n dashboard: DashboardModel;\n plugin: PanelPlugin;\n isViewing: boolean;\n isEditing: boolean;\n isInView: boolean;\n width: number;\n height: number;\n}\n\ninterface ConnectedProps {\n angularComponent?: AngularComponent;\n}\n\ninterface DispatchProps {\n setPanelAngularComponent: typeof setPanelAngularComponent;\n}\n\nexport type Props = OwnProps & ConnectedProps & DispatchProps;\n\nexport interface State {\n data: PanelData;\n errorMessage?: string;\n}\n\ninterface AngularScopeProps {\n panel: PanelModel;\n dashboard: DashboardModel;\n size: {\n height: number;\n width: number;\n };\n}\n\nexport class PanelChromeAngularUnconnected extends PureComponent {\n element: HTMLElement | null = null;\n timeSrv: TimeSrv = getTimeSrv();\n scopeProps?: AngularScopeProps;\n subs = new Subscription();\n\n constructor(props: Props) {\n super(props);\n this.state = {\n data: {\n state: LoadingState.NotStarted,\n series: [],\n timeRange: getDefaultTimeRange(),\n },\n };\n }\n\n componentDidMount() {\n const { panel } = this.props;\n this.loadAngularPanel();\n\n // subscribe to data events\n const queryRunner = panel.getQueryRunner();\n\n // we are not displaying any of this data so no need for transforms or field config\n this.subs.add(\n queryRunner.getData({ withTransforms: false, withFieldConfig: false }).subscribe({\n next: (data: PanelData) => this.onPanelDataUpdate(data),\n })\n );\n }\n\n onPanelDataUpdate(data: PanelData) {\n let errorMessage: string | undefined;\n\n if (data.state === LoadingState.Error) {\n const { error } = data;\n if (error) {\n if (errorMessage !== error.message) {\n errorMessage = error.message;\n }\n }\n }\n\n this.setState({ data, errorMessage });\n }\n\n componentWillUnmount() {\n this.subs.unsubscribe();\n }\n\n componentDidUpdate(prevProps: Props, prevState: State) {\n const { plugin, height, width, panel } = this.props;\n\n if (prevProps.plugin !== plugin) {\n this.loadAngularPanel();\n }\n\n if (prevProps.width !== width || prevProps.height !== height) {\n if (this.scopeProps) {\n this.scopeProps.size.height = this.getInnerPanelHeight();\n this.scopeProps.size.width = this.getInnerPanelWidth();\n panel.render();\n }\n }\n }\n\n getInnerPanelHeight() {\n const { plugin, height } = this.props;\n const { theme } = config;\n\n const headerHeight = this.hasOverlayHeader() ? 0 : theme.panelHeaderHeight;\n const chromePadding = plugin.noPadding ? 0 : theme.panelPadding;\n return height - headerHeight - chromePadding * 2 - PANEL_BORDER;\n }\n\n getInnerPanelWidth() {\n const { plugin, width } = this.props;\n const { theme } = config;\n\n const chromePadding = plugin.noPadding ? 0 : theme.panelPadding;\n return width - chromePadding * 2 - PANEL_BORDER;\n }\n\n loadAngularPanel() {\n const { panel, dashboard, setPanelAngularComponent } = this.props;\n\n // if we have no element or already have loaded the panel return\n if (!this.element) {\n return;\n }\n\n const loader = getAngularLoader();\n const template = '';\n\n this.scopeProps = {\n panel: panel,\n dashboard: dashboard,\n size: { width: this.getInnerPanelWidth(), height: this.getInnerPanelHeight() },\n };\n\n setPanelAngularComponent({\n key: panel.key,\n angularComponent: loader.load(this.element, this.scopeProps, template),\n });\n }\n\n hasOverlayHeader() {\n const { panel } = this.props;\n const { data } = this.state;\n\n // always show normal header if we have time override\n if (data.request && data.request.timeInfo) {\n return false;\n }\n\n return !panel.hasTitle();\n }\n\n render() {\n const { dashboard, panel, isViewing, isEditing, plugin } = this.props;\n const { errorMessage, data } = this.state;\n const { transparent } = panel;\n\n const alertState = data.alertState?.state;\n\n const containerClassNames = classNames({\n 'panel-container': true,\n 'panel-container--absolute': isSoloRoute(locationService.getLocation().pathname),\n 'panel-container--transparent': transparent,\n 'panel-container--no-title': this.hasOverlayHeader(),\n 'panel-has-alert': panel.alert !== undefined,\n [`panel-alert-state--${alertState}`]: alertState !== undefined,\n });\n\n const panelContentClassNames = classNames({\n 'panel-content': true,\n 'panel-content--no-padding': plugin.noPadding,\n });\n\n return (\n
\n \n
\n
(this.element = element)} className=\"panel-height-helper\" />\n
\n
\n );\n }\n}\n\nconst mapStateToProps: MapStateToProps = (state, props) => {\n return {\n angularComponent: getPanelStateForModel(state, props.panel)?.angularComponent,\n };\n};\n\nconst mapDispatchToProps: MapDispatchToProps = { setPanelAngularComponent };\n\nexport const PanelChromeAngular = connect(mapStateToProps, mapDispatchToProps)(PanelChromeAngularUnconnected);\n","import React, { PureComponent } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\n\nimport { StoreState } from 'app/types';\n\nimport { initPanelState } from '../../panel/state/actions';\nimport { setPanelInstanceState } from '../../panel/state/reducers';\nimport { DashboardModel, PanelModel } from '../state';\n\nimport { LazyLoader } from './LazyLoader';\nimport { PanelChrome } from './PanelChrome';\nimport { PanelChromeAngular } from './PanelChromeAngular';\n\nexport interface OwnProps {\n panel: PanelModel;\n stateKey: string;\n dashboard: DashboardModel;\n isEditing: boolean;\n isViewing: boolean;\n width: number;\n height: number;\n lazy?: boolean;\n}\n\nconst mapStateToProps = (state: StoreState, props: OwnProps) => {\n const panelState = state.panels[props.stateKey];\n if (!panelState) {\n return { plugin: null };\n }\n\n return {\n plugin: panelState.plugin,\n instanceState: panelState.instanceState,\n };\n};\n\nconst mapDispatchToProps = {\n initPanelState,\n setPanelInstanceState,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\nexport type Props = OwnProps & ConnectedProps;\n\nexport class DashboardPanelUnconnected extends PureComponent {\n static defaultProps: Partial = {\n lazy: true,\n };\n\n componentDidMount() {\n this.props.panel.isInView = !this.props.lazy;\n if (!this.props.lazy) {\n this.onPanelLoad();\n }\n }\n\n onInstanceStateChange = (value: any) => {\n this.props.setPanelInstanceState({ key: this.props.stateKey, value });\n };\n\n onVisibilityChange = (v: boolean) => {\n this.props.panel.isInView = v;\n };\n\n onPanelLoad = () => {\n if (!this.props.plugin) {\n this.props.initPanelState(this.props.panel);\n }\n };\n\n render() {\n const { dashboard, panel, isViewing, isEditing, width, height, lazy, plugin } = this.props;\n\n const renderPanelChrome = (isInView: boolean) =>\n plugin &&\n (plugin.angularPanelCtrl ? (\n \n ) : (\n \n ));\n\n return lazy ? (\n \n {({ isInView }) => renderPanelChrome(isInView)}\n \n ) : (\n renderPanelChrome(true)\n );\n }\n}\n\nexport const DashboardPanel = connector(DashboardPanelUnconnected);\n","import React, { Component } from 'react';\n\nimport { renderMarkdown, LinkModelSupplier, ScopedVars } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { locationService, getTemplateSrv } from '@grafana/runtime';\nimport { Tooltip, PopoverContent } from '@grafana/ui';\nimport { getTimeSrv, TimeSrv } from 'app/features/dashboard/services/TimeSrv';\nimport { PanelModel } from 'app/features/dashboard/state/PanelModel';\nimport { InspectTab } from 'app/features/inspector/types';\n\nenum InfoMode {\n Error = 'Error',\n Info = 'Info',\n Links = 'Links',\n}\n\nexport interface Props {\n panel: PanelModel;\n title?: string;\n description?: string;\n scopedVars?: ScopedVars;\n links?: LinkModelSupplier;\n error?: string;\n}\n\nexport class PanelHeaderCorner extends Component {\n timeSrv: TimeSrv = getTimeSrv();\n\n getInfoMode = () => {\n const { panel, error } = this.props;\n if (error) {\n return InfoMode.Error;\n }\n if (!!panel.description) {\n return InfoMode.Info;\n }\n if (panel.links && panel.links.length) {\n return InfoMode.Links;\n }\n\n return undefined;\n };\n\n getInfoContent = (): JSX.Element => {\n const { panel } = this.props;\n const markdown = panel.description || '';\n const interpolatedMarkdown = getTemplateSrv().replace(markdown, panel.scopedVars);\n const markedInterpolatedMarkdown = renderMarkdown(interpolatedMarkdown);\n const links = this.props.links && this.props.links.getLinks(panel.replaceVariables);\n\n return (\n
\n
\n\n {links && links.length > 0 && (\n \n )}\n
\n );\n };\n\n /**\n * Open the Panel Inspector when we click on an error\n */\n onClickError = () => {\n locationService.partial({\n inspect: this.props.panel.id,\n inspectTab: InspectTab.Error,\n });\n };\n\n renderCornerType(infoMode: InfoMode, content: PopoverContent, onClick?: () => void) {\n const theme = infoMode === InfoMode.Error ? 'error' : 'info';\n const className = `panel-info-corner panel-info-corner--${infoMode.toLowerCase()}`;\n const ariaLabel = selectors.components.Panels.Panel.headerCornerInfo(infoMode.toLowerCase());\n\n return (\n \n
\n \n \n
\n
\n );\n }\n\n render() {\n const { error } = this.props;\n const infoMode: InfoMode | undefined = this.getInfoMode();\n\n if (!infoMode) {\n return null;\n }\n\n if (infoMode === InfoMode.Error && error) {\n return this.renderCornerType(infoMode, error, this.onClickError);\n }\n\n if (infoMode === InfoMode.Info || infoMode === InfoMode.Links) {\n return this.renderCornerType(infoMode, this.getInfoContent);\n }\n\n return null;\n }\n}\n\nexport default PanelHeaderCorner;\n","import { DataQuery, locationUtil, setWeekStart, DashboardLoadedEvent } from '@grafana/data';\nimport { config, isFetchError, locationService } from '@grafana/runtime';\nimport { notifyApp } from 'app/core/actions';\nimport appEvents from 'app/core/app_events';\nimport { createErrorNotification } from 'app/core/copy/appNotification';\nimport { backendSrv } from 'app/core/services/backend_srv';\nimport { KeybindingSrv } from 'app/core/services/keybindingSrv';\nimport store from 'app/core/store';\nimport { dashboardLoaderSrv } from 'app/features/dashboard/services/DashboardLoaderSrv';\nimport { DashboardSrv, getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';\nimport { getTimeSrv, TimeSrv } from 'app/features/dashboard/services/TimeSrv';\nimport { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher';\nimport { playlistSrv } from 'app/features/playlist/PlaylistSrv';\nimport { toStateKey } from 'app/features/variables/utils';\nimport { DashboardDTO, DashboardInitPhase, DashboardRoutes, StoreState, ThunkDispatch, ThunkResult } from 'app/types';\n\nimport { createDashboardQueryRunner } from '../../query/state/DashboardQueryRunner/DashboardQueryRunner';\nimport { initVariablesTransaction } from '../../variables/state/actions';\nimport { getIfExistsLastKey } from '../../variables/state/selectors';\n\nimport { DashboardModel } from './DashboardModel';\nimport { PanelModel } from './PanelModel';\nimport { emitDashboardViewEvent } from './analyticsProcessor';\nimport { dashboardInitCompleted, dashboardInitFailed, dashboardInitFetching, dashboardInitServices } from './reducers';\n\nexport interface InitDashboardArgs {\n urlUid?: string;\n urlSlug?: string;\n urlType?: string;\n urlFolderId?: string;\n panelType?: string;\n accessToken?: string;\n routeName?: string;\n fixUrl: boolean;\n keybindingSrv: KeybindingSrv;\n}\n\nasync function fetchDashboard(\n args: InitDashboardArgs,\n dispatch: ThunkDispatch,\n getState: () => StoreState\n): Promise {\n // When creating new or adding panels to a dashboard from explore we load it from local storage\n const model = store.getObject(DASHBOARD_FROM_LS_KEY);\n if (model) {\n removeDashboardToFetchFromLocalStorage();\n return model;\n }\n\n try {\n switch (args.routeName) {\n case DashboardRoutes.Home: {\n // load home dash\n const dashDTO: DashboardDTO = await backendSrv.get('/api/dashboards/home');\n\n // if user specified a custom home dashboard redirect to that\n if (dashDTO.redirectUri) {\n const newUrl = locationUtil.stripBaseFromUrl(dashDTO.redirectUri);\n locationService.replace(newUrl);\n return null;\n }\n\n // disable some actions on the default home dashboard\n dashDTO.meta.canSave = false;\n dashDTO.meta.canShare = false;\n dashDTO.meta.canStar = false;\n return dashDTO;\n }\n case DashboardRoutes.Public: {\n return await dashboardLoaderSrv.loadDashboard('public', args.urlSlug, args.accessToken);\n }\n case DashboardRoutes.Normal: {\n const dashDTO: DashboardDTO = await dashboardLoaderSrv.loadDashboard(args.urlType, args.urlSlug, args.urlUid);\n\n if (args.fixUrl && dashDTO.meta.url && !playlistSrv.isPlaying) {\n // check if the current url is correct (might be old slug)\n const dashboardUrl = locationUtil.stripBaseFromUrl(dashDTO.meta.url);\n const currentPath = locationService.getLocation().pathname;\n\n if (dashboardUrl !== currentPath) {\n // Spread current location to persist search params used for navigation\n locationService.replace({\n ...locationService.getLocation(),\n pathname: dashboardUrl,\n });\n console.log('not correct url correcting', dashboardUrl, currentPath);\n }\n }\n return dashDTO;\n }\n case DashboardRoutes.New: {\n return getNewDashboardModelData(args.urlFolderId, args.panelType);\n }\n case DashboardRoutes.Path: {\n const path = args.urlSlug ?? '';\n return await dashboardLoaderSrv.loadDashboard(DashboardRoutes.Path, path, path);\n }\n default:\n throw { message: 'Unknown route ' + args.routeName };\n }\n } catch (err) {\n // Ignore cancelled errors\n if (isFetchError(err) && err.cancelled) {\n return null;\n }\n\n dispatch(dashboardInitFailed({ message: 'Failed to fetch dashboard', error: err }));\n console.error(err);\n return null;\n }\n}\n\nconst getQueriesByDatasource = (\n panels: PanelModel[],\n queries: { [datasourceId: string]: DataQuery[] } = {}\n): { [datasourceId: string]: DataQuery[] } => {\n panels.forEach((panel) => {\n if (panel.panels) {\n getQueriesByDatasource(panel.panels, queries);\n } else if (panel.targets) {\n panel.targets.forEach((target) => {\n if (target.datasource?.type) {\n if (queries[target.datasource.type]) {\n queries[target.datasource.type].push(target);\n } else {\n queries[target.datasource.type] = [target];\n }\n }\n });\n }\n });\n return queries;\n};\n\n/**\n * This action (or saga) does everything needed to bootstrap a dashboard & dashboard model.\n * First it handles the process of fetching the dashboard, correcting the url if required (causing redirects/url updates)\n *\n * This is used both for single dashboard & solo panel routes, home & new dashboard routes.\n *\n * Then it handles the initializing of the old angular services that the dashboard components & panels still depend on\n *\n */\nexport function initDashboard(args: InitDashboardArgs): ThunkResult {\n return async (dispatch, getState) => {\n // set fetching state\n dispatch(dashboardInitFetching());\n\n // fetch dashboard data\n const dashDTO = await fetchDashboard(args, dispatch, getState);\n\n // returns null if there was a redirect or error\n if (!dashDTO) {\n return;\n }\n\n // set initializing state\n dispatch(dashboardInitServices());\n\n // create model\n let dashboard: DashboardModel;\n try {\n dashboard = new DashboardModel(dashDTO.dashboard, dashDTO.meta);\n } catch (err) {\n dispatch(dashboardInitFailed({ message: 'Failed create dashboard model', error: err }));\n console.error(err);\n return;\n }\n\n // add missing orgId query param\n const storeState = getState();\n const queryParams = locationService.getSearchObject();\n\n if (!queryParams.orgId) {\n // TODO this is currently not possible with the LocationService API\n locationService.partial({ orgId: storeState.user.orgId }, true);\n }\n\n // init services\n const timeSrv: TimeSrv = getTimeSrv();\n const dashboardSrv: DashboardSrv = getDashboardSrv();\n\n // legacy srv state, we need this value updated for built-in annotations\n dashboardSrv.setCurrent(dashboard);\n\n timeSrv.init(dashboard);\n\n const dashboardUid = toStateKey(args.urlUid ?? dashboard.uid);\n // template values service needs to initialize completely before the rest of the dashboard can load\n await dispatch(initVariablesTransaction(dashboardUid, dashboard));\n\n // DashboardQueryRunner needs to run after all variables have been resolved so that any annotation query including a variable\n // will be correctly resolved\n const runner = createDashboardQueryRunner({ dashboard, timeSrv });\n runner.run({ dashboard, range: timeSrv.timeRange() });\n\n if (getIfExistsLastKey(getState()) !== dashboardUid) {\n // if a previous dashboard has slow running variable queries the batch uid will be the new one\n // but the args.urlUid will be the same as before initVariablesTransaction was called so then we can't continue initializing\n // the previous dashboard.\n return;\n }\n\n // If dashboard is in a different init phase it means it cancelled during service init\n if (getState().dashboard.initPhase !== DashboardInitPhase.Services) {\n return;\n }\n\n try {\n dashboard.processRepeats();\n\n // handle auto fix experimental feature\n if (queryParams.autofitpanels) {\n dashboard.autoFitPanels(window.innerHeight, queryParams.kiosk);\n }\n\n args.keybindingSrv.setupDashboardBindings(dashboard);\n } catch (err) {\n if (err instanceof Error) {\n dispatch(notifyApp(createErrorNotification('Dashboard init failed', err)));\n }\n console.error(err);\n }\n\n // send open dashboard event\n if (args.routeName !== DashboardRoutes.New) {\n emitDashboardViewEvent(dashboard);\n\n // Listen for changes on the current dashboard\n dashboardWatcher.watch(dashboard.uid);\n } else {\n dashboardWatcher.leave();\n }\n\n // set week start\n if (dashboard.weekStart !== '') {\n setWeekStart(dashboard.weekStart);\n } else {\n setWeekStart(config.bootData.user.weekStart);\n }\n\n // Propagate an app-wide event about the dashboard being loaded\n appEvents.publish(\n new DashboardLoadedEvent({\n dashboardId: dashboard.uid,\n orgId: storeState.user.orgId,\n userId: storeState.user.user?.id,\n grafanaVersion: config.buildInfo.version,\n queries: getQueriesByDatasource(dashboard.panels),\n })\n );\n\n // yay we are done\n dispatch(dashboardInitCompleted(dashboard));\n };\n}\n\nexport function getNewDashboardModelData(urlFolderId?: string, panelType?: string): any {\n const data = {\n meta: {\n canStar: false,\n canShare: false,\n canDelete: false,\n isNew: true,\n folderId: 0,\n },\n dashboard: {\n title: 'New dashboard',\n panels: [\n {\n type: panelType ?? 'add-panel',\n gridPos: { x: 0, y: 0, w: 12, h: 9 },\n title: 'Panel Title',\n },\n ],\n },\n };\n\n if (urlFolderId) {\n data.meta.folderId = parseInt(urlFolderId, 10);\n }\n\n return data;\n}\n\nconst DASHBOARD_FROM_LS_KEY = 'DASHBOARD_FROM_LS_KEY';\n\nexport function setDashboardToFetchFromLocalStorage(model: DashboardDTO) {\n store.setObject(DASHBOARD_FROM_LS_KEY, model);\n}\n\nexport function removeDashboardToFetchFromLocalStorage() {\n store.delete(DASHBOARD_FROM_LS_KEY);\n}\n","import { reportMetaAnalytics, MetaAnalyticsEventName, DashboardViewEventPayload } from '@grafana/runtime';\n\nimport { DashboardModel } from './DashboardModel';\n\nexport function emitDashboardViewEvent(dashboard: DashboardModel) {\n const eventData: DashboardViewEventPayload = {\n dashboardId: dashboard.id,\n dashboardName: dashboard.title,\n dashboardUid: dashboard.uid,\n folderName: dashboard.meta.folderTitle,\n eventName: MetaAnalyticsEventName.DashboardView,\n publicDashboardUid: dashboard.meta.publicDashboardUid,\n };\n\n reportMetaAnalytics(eventData);\n}\n","import { applyFieldOverrides, ArrayDataFrame, getDefaultTimeRange, LoadingState, PanelData } from '@grafana/data';\nimport { config } from 'app/core/config';\n\nimport { SnapshotWorker } from '../../query/state/DashboardQueryRunner/SnapshotWorker';\nimport { getProcessedDataFrames } from '../../query/state/runRequest';\nimport { getTimeSrv } from '../services/TimeSrv';\nimport { DashboardModel, PanelModel } from '../state';\n\nimport { applyPanelTimeOverrides } from './panel';\n\nexport function loadSnapshotData(panel: PanelModel, dashboard: DashboardModel): PanelData {\n const data = getProcessedDataFrames(panel.snapshotData);\n const worker = new SnapshotWorker();\n const options = { dashboard, range: getDefaultTimeRange() };\n const annotationEvents = worker.canWork(options) ? worker.getAnnotationsInSnapshot(dashboard, panel.id) : [];\n const annotations = [new ArrayDataFrame(annotationEvents)];\n const timeData = applyPanelTimeOverrides(panel, getTimeSrv().timeRange());\n\n return {\n timeRange: timeData.timeRange,\n state: LoadingState.Done,\n series: applyFieldOverrides({\n data,\n fieldConfig: {\n defaults: {},\n overrides: [],\n },\n replaceVariables: panel.replaceVariables,\n fieldConfigRegistry: panel.plugin!.fieldConfigRegistry,\n theme: config.theme2,\n timeZone: dashboard.getTimezone(),\n }),\n annotations,\n };\n}\n","import {\n DataLink,\n DisplayValue,\n FieldDisplay,\n formattedValueToString,\n getFieldDisplayValuesProxy,\n getTimeField,\n InterpolateFunction,\n Labels,\n LinkModelSupplier,\n ScopedVar,\n ScopedVars,\n} from '@grafana/data';\nimport { PanelModel } from 'app/features/dashboard/state/PanelModel';\n\nimport { getLinkSrv } from './link_srv';\n\ninterface SeriesVars {\n name?: string;\n refId?: string;\n}\n\ninterface FieldVars {\n name: string;\n labels?: Labels;\n}\n\ninterface ValueVars {\n raw: any;\n numeric: number;\n text: string;\n time?: number;\n calc?: string;\n}\n\ninterface DataViewVars {\n name?: string;\n refId?: string;\n fields?: Record;\n}\n\ninterface DataLinkScopedVars extends ScopedVars {\n __series: ScopedVar;\n __field: ScopedVar;\n __value: ScopedVar;\n __data: ScopedVar;\n}\n\n/**\n * Link suppliers creates link models based on a link origin\n */\nexport const getFieldLinksSupplier = (value: FieldDisplay): LinkModelSupplier | undefined => {\n const links = value.field.links;\n if (!links || links.length === 0) {\n return undefined;\n }\n\n return {\n getLinks: (replaceVariables: InterpolateFunction) => {\n const scopedVars: Partial = {};\n\n if (value.view) {\n const { dataFrame } = value.view;\n\n scopedVars['__series'] = {\n value: {\n name: dataFrame.name,\n refId: dataFrame.refId,\n },\n text: 'Series',\n };\n\n const field = value.colIndex !== undefined ? dataFrame.fields[value.colIndex] : undefined;\n\n if (field) {\n scopedVars['__field'] = {\n value: {\n name: field.name,\n labels: field.labels,\n },\n text: 'Field',\n };\n\n if (value.rowIndex !== undefined && value.rowIndex >= 0) {\n const { timeField } = getTimeField(dataFrame);\n scopedVars['__value'] = {\n value: {\n raw: field.values.get(value.rowIndex),\n numeric: value.display.numeric,\n text: formattedValueToString(value.display),\n time: timeField ? timeField.values.get(value.rowIndex) : undefined,\n },\n text: 'Value',\n };\n }\n\n // Expose other values on the row\n if (value.view) {\n scopedVars['__data'] = {\n value: {\n name: dataFrame.name,\n refId: dataFrame.refId,\n fields: getFieldDisplayValuesProxy({\n frame: dataFrame,\n rowIndex: value.rowIndex!,\n }),\n },\n text: 'Data',\n };\n }\n } else {\n // calculation\n scopedVars['__value'] = {\n value: {\n raw: value.display.numeric,\n numeric: value.display.numeric,\n text: formattedValueToString(value.display),\n calc: value.name,\n },\n text: 'Value',\n };\n }\n } else {\n console.log('VALUE', value);\n }\n\n const replace: InterpolateFunction = (value: string, vars: ScopedVars | undefined, fmt?: string | Function) => {\n const finalVars: ScopedVars = {\n ...(scopedVars as ScopedVars),\n ...vars,\n };\n return replaceVariables(value, finalVars, fmt);\n };\n\n return links.map((link: DataLink) => {\n return getLinkSrv().getDataLinkUIModel(link, replace, value);\n });\n },\n };\n};\n\nexport const getPanelLinksSupplier = (panel: PanelModel): LinkModelSupplier | undefined => {\n const links = panel.links;\n\n if (!links || links.length === 0) {\n return undefined;\n }\n\n return {\n getLinks: () => {\n return links.map((link) => {\n return getLinkSrv().getDataLinkUIModel(link, panel.replaceVariables, panel);\n });\n },\n };\n};\n","import { PanelModel } from 'app/features/dashboard/state';\nimport { StoreState } from 'app/types';\n\nimport { PanelState } from './reducers';\n\nexport function getPanelStateForModel(state: StoreState, model: PanelModel): PanelState | undefined {\n return state.panels[model.key];\n}\n"],"names":["LazyLoader","children","width","height","onLoad","onChange","id","useUniqueId","loaded","setLoaded","useState","isInView","setIsInView","wrapperRef","useRef","useEffectOnce","addCallback","entry","isIntersecting","wrapperEl","current","observer","observe","callbacks","unobserve","Object","keys","length","disconnect","ref","style","c","IntersectionObserver","entries","target","rootMargin","createOverride","label","color","matcher","FieldMatcherID","options","properties","createProperty","value","mode","FieldColorModeId","fixedColor","PanelHeaderLoadingIndicator","state","onClick","styles","useStyles","getStyles","LoadingState","className","Tooltip","content","Icon","name","title","streamIndicator","theme","css","colors","textFaint","PanelHeaderMenuTrigger","divProps","clickCoordinates","setClickCoordinates","x","y","panelMenuOpen","setPanelMenuOpen","onMenuToggle","useCallback","event","clicked","deadZone","Math","sqrt","isClick","eventToClickCoordinates","onMouseDown","closeMenu","clientX","clientY","PanelHeaderMenu","PureComponent","menu","isSubMenu","role","map","menuItem","idx","PanelHeaderMenuItem","type","text","iconClassName","shortcut","subMenu","renderItems","render","this","props","items","PanelHeaderMenuProvider","panel","dashboard","setItems","angularComponent","useSelector","getPanelStateForModel","useEffect","onViewPanel","preventDefault","locationService","viewPanel","onEditPanel","editPanel","onAddLibraryPanel","addLibraryPanel","onUnlinkLibraryPanel","unlinkLibraryPanel","onInspectPanel","tab","inspect","inspectTab","reportInteraction","InspectTab","onMore","onDuplicatePanel","duplicatePanel","onCopyPanel","copyPanel","onRemovePanel","removePanel","onNavigateToExplore","openInNewWindow","ctrlKey","metaKey","url","window","open","config","undefined","store","navigateToExplore","getDataSourceSrv","getTimeSrv","getExploreUrl","onToggleLegend","toggleLegend","isEditing","viewTextTranslation","push","canEditPanel","shareTextTranslation","sharePanel","contextSrv","plugin","meta","skipDataQuery","inspectMenu","dataTextTranslation","e","canEdit","jsonTextTranslation","inspectTextTranslation","isViewing","isPanelModelLibraryPanel","scope","getScope","panelCtrl","$$childHead","ctrl","angularMenuItems","getExtendedMenu","item","reactItem","href","click","$eval","legend","showLegend","moreTextTranslation","getPanelMenu","PanelHeaderMenuWrapper","PanelHeaderNotice","notice","iconName","severity","marginRight","link","rel","PanelHeaderNotices","frames","panelId","openInspect","stopPropagation","notices","frame","values","PanelHeader","error","data","alertState","getDisplayTitle","cx","useStyles2","panelStyles","getQueryRunner","cancelQuery","PanelHeaderCorner","description","scopedVars","links","getPanelLinksSupplier","selectors","ClickOutsideWrapper","parent","document","series","size","titleText","publicDashboardAccessToken","onClose","request","timeInfo","typography","fontWeightMedium","body","fontSize","primary","PanelChrome","constructor","super","Subscription","onlyLocal","DashboardCursorSync","graphTooltip","onInstanceStateChange","setState","context","instanceState","onFieldConfigChange","fieldConfig","overrides","currentIndex","findIndex","override","overridesCopy","Array","from","existing","propertyIndex","p","propertiesCopy","changeSeriesColorConfigFactory","seriesVisibilityConfigFactory","sortKey","legendOptions","sortDesc","sortBy","onOptionsChange","refreshWhenInView","timeData","applyPanelTimeOverrides","timeSrv","timeRange","wantsQueryExecution","runAllPanelQueries","dashboardId","dashboardUID","uid","dashboardTimezone","getTimezone","renderCounter","liveTime","stateUpdate","updateOptions","updateFieldConfig","errorMessage","message","async","isRegion","to","anno","time","timeEnd","tags","saveAnnotation","getDashboardQueryRunner","run","range","eventBus","publish","AnnotationChangeEvent","deleteAnnotation","updateAnnotation","setTime","toUtc","events","newScopedBus","eventFilter","isFirstLoad","app","getPanelContextApp","sync","getSync","onSeriesColorChange","onToggleSeriesVisibility","onSeriesVisibilityChange","onAnnotationCreate","onAnnotationUpdate","onAnnotationDelete","onToggleLegendSort","canAddAnnotations","bind","canEditAnnotations","canDeleteAnnotations","getInitialPanelDataState","CoreApp","getDefaultTimeRange","componentDidMount","subs","add","subscribe","RefreshEvent","onRefresh","RenderEvent","onRender","panelInitialized","hasPanelSnapshot","loadSnapshotData","getData","withTransforms","withFieldConfig","next","onDataUpdate","liveTimer","componentWillUnmount","unsubscribe","liveTimeChanged","delta","valueOf","console","log","componentDidUpdate","prevProps","snapshot","snapshotData","toDataFrameDTO","shouldSignalRenderingCompleted","loadingState","pluginMeta","skipFirstRender","renderPanel","profiler","PanelComponent","headerHeight","hasOverlayHeader","panelHeaderHeight","chromePadding","noPadding","panelPadding","panelWidth","PANEL_BORDER","innerPanelHeight","panelContentClassNames","classNames","panelOptions","getOptions","PanelContext","timeZone","transparent","replaceVariables","onChangeTimeRange","hasTitle","containerClassNames","isSoloRoute","pathname","ErrorBoundary","dependencies","onError","onPanelError","onRecover","onPanelErrorRecover","PanelChromeAngularUnconnected","loadAngularPanel","queryRunner","onPanelDataUpdate","prevState","scopeProps","getInnerPanelHeight","getInnerPanelWidth","setPanelAngularComponent","element","loader","getAngularLoader","key","load","alert","mapDispatchToProps","PanelChromeAngular","connect","initPanelState","setPanelInstanceState","connector","panelState","panels","stateKey","DashboardPanelUnconnected","v","lazy","onPanelLoad","renderPanelChrome","angularPanelCtrl","onVisibilityChange","DashboardPanel","InfoMode","Component","Error","Info","Links","markdown","interpolatedMarkdown","getTemplateSrv","replace","markedInterpolatedMarkdown","renderMarkdown","getLinks","dangerouslySetInnerHTML","__html","renderCornerType","infoMode","toLowerCase","ariaLabel","placement","interactive","getInfoMode","onClickError","getInfoContent","getQueriesByDatasource","queries","forEach","targets","datasource","initDashboard","args","dispatch","getState","dashboardInitFetching","dashDTO","model","DASHBOARD_FROM_LS_KEY","removeDashboardToFetchFromLocalStorage","routeName","DashboardRoutes","backendSrv","redirectUri","newUrl","locationUtil","canSave","canShare","canStar","dashboardLoaderSrv","urlSlug","accessToken","urlType","urlUid","fixUrl","playlistSrv","dashboardUrl","currentPath","getNewDashboardModelData","urlFolderId","panelType","path","err","isFetchError","cancelled","dashboardInitFailed","fetchDashboard","dashboardInitServices","DashboardModel","storeState","queryParams","orgId","user","getDashboardSrv","setCurrent","init","dashboardUid","toStateKey","initVariablesTransaction","createDashboardQueryRunner","getIfExistsLastKey","initPhase","DashboardInitPhase","processRepeats","autofitpanels","autoFitPanels","innerHeight","kiosk","keybindingSrv","setupDashboardBindings","notifyApp","createErrorNotification","eventData","dashboardName","folderName","folderTitle","eventName","MetaAnalyticsEventName","publicDashboardUid","reportMetaAnalytics","emitDashboardViewEvent","dashboardWatcher","weekStart","setWeekStart","appEvents","DashboardLoadedEvent","userId","grafanaVersion","dashboardInitCompleted","canDelete","isNew","folderId","gridPos","w","h","parseInt","setDashboardToFetchFromLocalStorage","getProcessedDataFrames","worker","SnapshotWorker","annotationEvents","canWork","getAnnotationsInSnapshot","annotations","ArrayDataFrame","applyFieldOverrides","defaults","fieldConfigRegistry","getFieldLinksSupplier","field","view","dataFrame","refId","colIndex","fields","labels","rowIndex","timeField","getTimeField","raw","get","numeric","display","formattedValueToString","getFieldDisplayValuesProxy","calc","vars","fmt","finalVars","getLinkSrv","getDataLinkUIModel"],"sourceRoot":""}