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H,KAAKsN,kBAAkB5F,EAAYnD,GACnC6C,IACC,SAAC,EAAA+G,MAAD,CAAOlJ,MAAM,mBAAmBpC,QAAQ,EAAMuL,UAAWpO,KAAKqO,YAA9D,UACE,SAAC5O,EAAD,CAAYK,OAAQ4H,EAAW1E,KAAMjD,KAAK,0BAW5D,MAAM+E,GAAYoB,EAAAA,EAAAA,gBAAc,KAC9B,MAAM,MAAEC,GAAUC,EAAAA,GAElB,MAAO,CACL6H,aAAc5H,EAAAA,GAAI;;;iBAGLF,EAAMG,QAAQC;MAE3BqF,cAAevF,EAAAA,GAAI;;uBAEAF,EAAMG,QAAQC;MAEjCuF,kBAAmBzF,EAAAA,GAAI;sBACLF,EAAMG,QAAQgI;MAEhC/B,yBAA0BlG,EAAAA,GAAI;;sBAEZF,EAAMG,QAAQgI;MAEhCJ,eAAgB7H,EAAAA,GAAI;;MAGpBkI,kBAAmBlI,EAAAA,GAAI,GACvBuH,iBAAkBvH,EAAAA,GAAI;sBACJF,EAAMG,QAAQI","sources":["webpack://grafana/./public/app/core/components/PluginHelp/PluginHelp.tsx","webpack://grafana/./public/app/features/query/components/QueryGroupOptions.tsx","webpack://grafana/./public/app/features/query/components/QueryGroup.tsx","webpack://grafana/./public/app/features/query/state/updateQueries.ts"],"sourcesContent":["import React, { PureComponent } from 'react';\n\nimport { renderMarkdown } from '@grafana/data';\nimport { getBackendSrv } from '@grafana/runtime';\n\ninterface Props {\n plugin: {\n name: string;\n id: string;\n };\n type: string;\n}\n\ninterface State {\n isError: boolean;\n isLoading: boolean;\n help: string;\n}\n\nexport class PluginHelp extends PureComponent<Props, State> {\n state = {\n isError: false,\n isLoading: false,\n help: '',\n };\n\n componentDidMount(): void {\n this.loadHelp();\n }\n\n constructPlaceholderInfo() {\n return 'No plugin help or readme markdown file was found';\n }\n\n loadHelp = () => {\n const { plugin, type } = this.props;\n this.setState({ isLoading: true });\n\n getBackendSrv()\n .get(`/api/plugins/${plugin.id}/markdown/${type}`)\n .then((response: string) => {\n const helpHtml = renderMarkdown(response);\n\n if (response === '' && type === 'help') {\n this.setState({\n isError: false,\n isLoading: false,\n help: this.constructPlaceholderInfo(),\n });\n } else {\n this.setState({\n isError: false,\n isLoading: false,\n help: helpHtml,\n });\n }\n })\n .catch(() => {\n this.setState({\n isError: true,\n isLoading: false,\n });\n });\n };\n\n render() {\n const { type } = this.props;\n const { isError, isLoading, help } = this.state;\n\n if (isLoading) {\n return <h2>Loading help...</h2>;\n }\n\n if (isError) {\n return <h3>'Error occurred when loading help'</h3>;\n }\n\n if (type === 'panel_help' && help === '') {\n }\n\n return <div className=\"markdown-html\" dangerouslySetInnerHTML={{ __html: help }} />;\n }\n}\n","import { css } from '@emotion/css';\nimport React, { PureComponent, ChangeEvent, FocusEvent } from 'react';\n\nimport { rangeUtil, PanelData, DataSourceApi } from '@grafana/data';\nimport { Switch, Input, InlineField, InlineFormLabel, stylesFactory } from '@grafana/ui';\nimport { QueryOperationRow } from 'app/core/components/QueryOperationRow/QueryOperationRow';\nimport { config } from 'app/core/config';\nimport { QueryGroupOptions } from 'app/types';\n\ninterface Props {\n options: QueryGroupOptions;\n dataSource: DataSourceApi;\n data: PanelData;\n onChange: (options: QueryGroupOptions) => void;\n}\n\ninterface State {\n timeRangeFrom: string;\n timeRangeShift: string;\n timeRangeHide: boolean;\n isOpen: boolean;\n relativeTimeIsValid: boolean;\n timeShiftIsValid: boolean;\n}\n\nexport class QueryGroupOptionsEditor extends PureComponent<Props, State> {\n constructor(props: Props) {\n super(props);\n\n const { options } = props;\n\n this.state = {\n timeRangeFrom: options.timeRange?.from || '',\n timeRangeShift: options.timeRange?.shift || '',\n timeRangeHide: options.timeRange?.hide ?? false,\n isOpen: false,\n relativeTimeIsValid: true,\n timeShiftIsValid: true,\n };\n }\n\n onRelativeTimeChange = (event: ChangeEvent<HTMLInputElement>) => {\n this.setState({\n timeRangeFrom: event.target.value,\n });\n };\n\n onTimeShiftChange = (event: ChangeEvent<HTMLInputElement>) => {\n this.setState({\n timeRangeShift: event.target.value,\n });\n };\n\n onOverrideTime = (event: FocusEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n\n const newValue = emptyToNull(event.target.value);\n const isValid = timeRangeValidation(newValue);\n\n if (isValid && options.timeRange?.from !== newValue) {\n onChange({\n ...options,\n timeRange: {\n ...(options.timeRange ?? {}),\n from: newValue,\n },\n });\n }\n\n this.setState({ relativeTimeIsValid: isValid });\n };\n\n onTimeShift = (event: FocusEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n\n const newValue = emptyToNull(event.target.value);\n const isValid = timeRangeValidation(newValue);\n\n if (isValid && options.timeRange?.shift !== newValue) {\n onChange({\n ...options,\n timeRange: {\n ...(options.timeRange ?? {}),\n shift: newValue,\n },\n });\n }\n\n this.setState({ timeShiftIsValid: isValid });\n };\n\n onToggleTimeOverride = () => {\n const { onChange, options } = this.props;\n\n this.setState({ timeRangeHide: !this.state.timeRangeHide }, () => {\n onChange({\n ...options,\n timeRange: {\n ...(options.timeRange ?? {}),\n hide: this.state.timeRangeHide,\n },\n });\n });\n };\n\n onCacheTimeoutBlur = (event: ChangeEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n onChange({\n ...options,\n cacheTimeout: emptyToNull(event.target.value),\n });\n };\n\n onMaxDataPointsBlur = (event: ChangeEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n\n let maxDataPoints: number | null = parseInt(event.target.value as string, 10);\n\n if (isNaN(maxDataPoints) || maxDataPoints === 0) {\n maxDataPoints = null;\n }\n\n if (maxDataPoints !== options.maxDataPoints) {\n onChange({\n ...options,\n maxDataPoints,\n });\n }\n };\n\n onMinIntervalBlur = (event: ChangeEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n const minInterval = emptyToNull(event.target.value);\n if (minInterval !== options.minInterval) {\n onChange({\n ...options,\n minInterval,\n });\n }\n };\n\n renderCacheTimeoutOption() {\n const { dataSource, options } = this.props;\n\n const tooltip = `If your time series store has a query cache this option can override the default cache timeout. Specify a\n numeric value in seconds.`;\n\n if (!dataSource.meta.queryOptions?.cacheTimeout) {\n return null;\n }\n\n return (\n <div className=\"gf-form-inline\">\n <div className=\"gf-form\">\n <InlineFormLabel width={9} tooltip={tooltip}>\n Cache timeout\n </InlineFormLabel>\n <Input\n type=\"text\"\n className=\"width-6\"\n placeholder=\"60\"\n spellCheck={false}\n onBlur={this.onCacheTimeoutBlur}\n defaultValue={options.cacheTimeout ?? ''}\n />\n </div>\n </div>\n );\n }\n\n renderMaxDataPointsOption() {\n const { data, options } = this.props;\n const realMd = data.request?.maxDataPoints;\n const value = options.maxDataPoints ?? '';\n const isAuto = value === '';\n\n return (\n <div className=\"gf-form-inline\">\n <div className=\"gf-form\">\n <InlineFormLabel\n width={9}\n tooltip={\n <>\n The maximum data points per series. Used directly by some data sources and used in calculation of auto\n interval. With streaming data this value is used for the rolling buffer.\n </>\n }\n >\n Max data points\n </InlineFormLabel>\n <Input\n type=\"number\"\n className=\"width-6\"\n placeholder={`${realMd}`}\n spellCheck={false}\n onBlur={this.onMaxDataPointsBlur}\n defaultValue={value}\n />\n {isAuto && (\n <>\n <div className=\"gf-form-label query-segment-operator\">=</div>\n <div className=\"gf-form-label\">Width of panel</div>\n </>\n )}\n </div>\n </div>\n );\n }\n\n renderIntervalOption() {\n const { data, dataSource, options } = this.props;\n const realInterval = data.request?.interval;\n const minIntervalOnDs = dataSource.interval ?? 'No limit';\n\n return (\n <>\n <div className=\"gf-form-inline\">\n <div className=\"gf-form\">\n <InlineFormLabel\n width={9}\n tooltip={\n <>\n A lower limit for the interval. Recommended to be set to write frequency, for example <code>1m</code>{' '}\n if your data is written every minute. Default value can be set in data source settings for most data\n sources.\n </>\n }\n >\n Min interval\n </InlineFormLabel>\n <Input\n type=\"text\"\n className=\"width-6\"\n placeholder={`${minIntervalOnDs}`}\n spellCheck={false}\n onBlur={this.onMinIntervalBlur}\n defaultValue={options.minInterval ?? ''}\n />\n </div>\n </div>\n <div className=\"gf-form-inline\">\n <div className=\"gf-form\">\n <InlineFormLabel\n width={9}\n tooltip={\n <>\n The evaluated interval that is sent to data source and is used in <code>$__interval</code> and{' '}\n <code>$__interval_ms</code>\n </>\n }\n >\n Interval\n </InlineFormLabel>\n <InlineFormLabel width={6}>{realInterval}</InlineFormLabel>\n <div className=\"gf-form-label query-segment-operator\">=</div>\n <div className=\"gf-form-label\">Time range / max data points</div>\n </div>\n </div>\n </>\n );\n }\n\n onOpenOptions = () => {\n this.setState({ isOpen: true });\n };\n\n onCloseOptions = () => {\n this.setState({ isOpen: false });\n };\n\n renderCollapsedText(styles: StylesType): React.ReactNode | undefined {\n const { data, options } = this.props;\n const { isOpen } = this.state;\n\n if (isOpen) {\n return undefined;\n }\n\n let mdDesc = options.maxDataPoints ?? '';\n if (mdDesc === '' && data.request) {\n mdDesc = `auto = ${data.request.maxDataPoints}`;\n }\n\n let intervalDesc = options.minInterval;\n if (data.request) {\n intervalDesc = `${data.request.interval}`;\n }\n\n return (\n <>\n {<div className={styles.collapsedText}>MD = {mdDesc}</div>}\n {<div className={styles.collapsedText}>Interval = {intervalDesc}</div>}\n </>\n );\n }\n\n render() {\n const { timeRangeHide: hideTimeOverride, relativeTimeIsValid, timeShiftIsValid } = this.state;\n const { timeRangeFrom: relativeTime, timeRangeShift: timeShift, isOpen } = this.state;\n const styles = getStyles();\n\n return (\n <QueryOperationRow\n id=\"Query options\"\n index={0}\n title=\"Query options\"\n headerElement={this.renderCollapsedText(styles)}\n isOpen={isOpen}\n onOpen={this.onOpenOptions}\n onClose={this.onCloseOptions}\n >\n {this.renderMaxDataPointsOption()}\n {this.renderIntervalOption()}\n {this.renderCacheTimeoutOption()}\n\n <div className=\"gf-form\">\n <InlineFormLabel width={9}>Relative time</InlineFormLabel>\n <Input\n type=\"text\"\n className=\"width-6\"\n placeholder=\"1h\"\n onChange={this.onRelativeTimeChange}\n onBlur={this.onOverrideTime}\n invalid={!relativeTimeIsValid}\n value={relativeTime}\n />\n </div>\n\n <div className=\"gf-form\">\n <span className=\"gf-form-label width-9\">Time shift</span>\n <Input\n type=\"text\"\n className=\"width-6\"\n placeholder=\"1h\"\n onChange={this.onTimeShiftChange}\n onBlur={this.onTimeShift}\n invalid={!timeShiftIsValid}\n value={timeShift}\n />\n </div>\n {(timeShift || relativeTime) && (\n <div className=\"gf-form-inline\">\n <InlineField label=\"Hide time info\" labelWidth={18}>\n <Switch value={hideTimeOverride} onChange={this.onToggleTimeOverride} />\n </InlineField>\n </div>\n )}\n </QueryOperationRow>\n );\n }\n}\n\nconst timeRangeValidation = (value: string | null) => {\n if (!value) {\n return true;\n }\n\n return rangeUtil.isValidTimeSpan(value);\n};\n\nconst emptyToNull = (value: string) => {\n return value === '' ? null : value;\n};\n\nconst getStyles = stylesFactory(() => {\n const { theme } = config;\n\n return {\n collapsedText: css`\n margin-left: ${theme.spacing.md};\n font-size: ${theme.typography.size.sm};\n color: ${theme.colors.textWeak};\n `,\n };\n});\n\ntype StylesType = ReturnType<typeof getStyles>;\n","import { css } from '@emotion/css';\nimport React, { PureComponent } from 'react';\nimport { Unsubscribable } from 'rxjs';\n\nimport {\n DataQuery,\n DataSourceApi,\n DataSourceInstanceSettings,\n getDefaultTimeRange,\n LoadingState,\n PanelData,\n} from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { DataSourcePicker, getDataSourceSrv } from '@grafana/runtime';\nimport { Button, CustomScrollbar, HorizontalGroup, InlineFormLabel, Modal, stylesFactory } from '@grafana/ui';\nimport { PluginHelp } from 'app/core/components/PluginHelp/PluginHelp';\nimport config from 'app/core/config';\nimport { backendSrv } from 'app/core/services/backend_srv';\nimport { addQuery } from 'app/core/utils/query';\nimport { dataSource as expressionDatasource } from 'app/features/expressions/ExpressionDatasource';\nimport { DashboardQueryEditor, isSharedDashboardQuery } from 'app/plugins/datasource/dashboard';\nimport { QueryGroupOptions } from 'app/types';\n\nimport { PanelQueryRunner } from '../state/PanelQueryRunner';\nimport { updateQueries } from '../state/updateQueries';\n\nimport { GroupActionComponents } from './QueryActionComponent';\nimport { QueryEditorRows } from './QueryEditorRows';\nimport { QueryGroupOptionsEditor } from './QueryGroupOptions';\n\ninterface Props {\n queryRunner: PanelQueryRunner;\n options: QueryGroupOptions;\n onOpenQueryInspector?: () => void;\n onRunQueries: () => void;\n onOptionsChange: (options: QueryGroupOptions) => void;\n}\n\ninterface State {\n dataSource?: DataSourceApi;\n dsSettings?: DataSourceInstanceSettings;\n queries: DataQuery[];\n helpContent: React.ReactNode;\n isLoadingHelp: boolean;\n isPickerOpen: boolean;\n isAddingMixed: boolean;\n data: PanelData;\n isHelpOpen: boolean;\n defaultDataSource?: DataSourceApi;\n scrollElement?: HTMLDivElement;\n}\n\nexport class QueryGroup extends PureComponent<Props, State> {\n backendSrv = backendSrv;\n dataSourceSrv = getDataSourceSrv();\n querySubscription: Unsubscribable | null = null;\n\n state: State = {\n isLoadingHelp: false,\n helpContent: null,\n isPickerOpen: false,\n isAddingMixed: false,\n isHelpOpen: false,\n queries: [],\n data: {\n state: LoadingState.NotStarted,\n series: [],\n timeRange: getDefaultTimeRange(),\n },\n };\n\n async componentDidMount() {\n const { queryRunner, options } = this.props;\n\n this.querySubscription = queryRunner.getData({ withTransforms: false, withFieldConfig: false }).subscribe({\n next: (data: PanelData) => this.onPanelDataUpdate(data),\n });\n\n try {\n const ds = await this.dataSourceSrv.get(options.dataSource);\n const dsSettings = this.dataSourceSrv.getInstanceSettings(options.dataSource);\n const defaultDataSource = await this.dataSourceSrv.get();\n const datasource = ds.getRef();\n const queries = options.queries.map((q) => (q.datasource ? q : { ...q, datasource }));\n this.setState({ queries, dataSource: ds, dsSettings, defaultDataSource });\n } catch (error) {\n console.log('failed to load data source', error);\n }\n }\n\n componentWillUnmount() {\n if (this.querySubscription) {\n this.querySubscription.unsubscribe();\n this.querySubscription = null;\n }\n }\n\n onPanelDataUpdate(data: PanelData) {\n this.setState({ data });\n }\n\n onChangeDataSource = async (newSettings: DataSourceInstanceSettings) => {\n const { dsSettings } = this.state;\n const currentDS = dsSettings ? await getDataSourceSrv().get(dsSettings.uid) : undefined;\n const nextDS = await getDataSourceSrv().get(newSettings.uid);\n\n // We need to pass in newSettings.uid as well here as that can be a variable expression and we want to store that in the query model not the current ds variable value\n const queries = await updateQueries(nextDS, newSettings.uid, this.state.queries, currentDS);\n\n const dataSource = await this.dataSourceSrv.get(newSettings.name);\n this.onChange({\n queries,\n dataSource: {\n name: newSettings.name,\n uid: newSettings.uid,\n type: newSettings.meta.id,\n default: newSettings.isDefault,\n },\n });\n\n this.setState({\n queries,\n dataSource: dataSource,\n dsSettings: newSettings,\n });\n };\n\n onAddQueryClick = () => {\n const { queries } = this.state;\n this.onQueriesChange(addQuery(queries, this.newQuery()));\n this.onScrollBottom();\n };\n\n newQuery(): Partial<DataQuery> {\n const { dsSettings, defaultDataSource } = this.state;\n\n const ds = !dsSettings?.meta.mixed ? dsSettings : defaultDataSource;\n\n return {\n datasource: { uid: ds?.uid, type: ds?.type },\n };\n }\n\n onChange(changedProps: Partial<QueryGroupOptions>) {\n this.props.onOptionsChange({\n ...this.props.options,\n ...changedProps,\n });\n }\n\n onAddExpressionClick = () => {\n this.onQueriesChange(addQuery(this.state.queries, expressionDatasource.newQuery()));\n this.onScrollBottom();\n };\n\n onScrollBottom = () => {\n setTimeout(() => {\n if (this.state.scrollElement) {\n this.state.scrollElement.scrollTo({ top: 10000 });\n }\n }, 20);\n };\n\n onUpdateAndRun = (options: QueryGroupOptions) => {\n this.props.onOptionsChange(options);\n this.props.onRunQueries();\n };\n\n renderTopSection(styles: QueriesTabStyles) {\n const { onOpenQueryInspector, options } = this.props;\n const { dataSource, data } = this.state;\n\n return (\n <div>\n <div className={styles.dataSourceRow}>\n <InlineFormLabel htmlFor=\"data-source-picker\" width={'auto'}>\n Data source\n </InlineFormLabel>\n <div className={styles.dataSourceRowItem}>\n <DataSourcePicker\n onChange={this.onChangeDataSource}\n current={options.dataSource}\n metrics={true}\n mixed={true}\n dashboard={true}\n variables={true}\n />\n </div>\n {dataSource && (\n <>\n <div className={styles.dataSourceRowItem}>\n <Button\n variant=\"secondary\"\n icon=\"question-circle\"\n title=\"Open data source help\"\n onClick={this.onOpenHelp}\n />\n </div>\n <div className={styles.dataSourceRowItemOptions}>\n <QueryGroupOptionsEditor\n options={options}\n dataSource={dataSource}\n data={data}\n onChange={this.onUpdateAndRun}\n />\n </div>\n {onOpenQueryInspector && (\n <div className={styles.dataSourceRowItem}>\n <Button\n variant=\"secondary\"\n onClick={onOpenQueryInspector}\n aria-label={selectors.components.QueryTab.queryInspectorButton}\n >\n Query inspector\n </Button>\n </div>\n )}\n </>\n )}\n </div>\n </div>\n );\n }\n\n onOpenHelp = () => {\n this.setState({ isHelpOpen: true });\n };\n\n onCloseHelp = () => {\n this.setState({ isHelpOpen: false });\n };\n\n renderMixedPicker = () => {\n return (\n <DataSourcePicker\n mixed={false}\n onChange={this.onAddMixedQuery}\n current={null}\n autoFocus={true}\n variables={true}\n onBlur={this.onMixedPickerBlur}\n openMenuOnFocus={true}\n />\n );\n };\n\n onAddMixedQuery = (datasource: any) => {\n this.onAddQuery({ datasource: datasource.name });\n this.setState({ isAddingMixed: false });\n };\n\n onMixedPickerBlur = () => {\n this.setState({ isAddingMixed: false });\n };\n\n onAddQuery = (query: Partial<DataQuery>) => {\n const { dsSettings, queries } = this.state;\n this.onQueriesChange(addQuery(queries, query, { type: dsSettings?.type, uid: dsSettings?.uid }));\n this.onScrollBottom();\n };\n\n onQueriesChange = (queries: DataQuery[]) => {\n this.onChange({ queries });\n this.setState({ queries });\n };\n\n renderQueries(dsSettings: DataSourceInstanceSettings) {\n const { onRunQueries } = this.props;\n const { data, queries } = this.state;\n\n if (isSharedDashboardQuery(dsSettings.name)) {\n return (\n <DashboardQueryEditor\n queries={queries}\n panelData={data}\n onChange={this.onQueriesChange}\n onRunQueries={onRunQueries}\n />\n );\n }\n\n return (\n <div aria-label={selectors.components.QueryTab.content}>\n <QueryEditorRows\n queries={queries}\n dsSettings={dsSettings}\n onQueriesChange={this.onQueriesChange}\n onAddQuery={this.onAddQuery}\n onRunQueries={onRunQueries}\n data={data}\n />\n </div>\n );\n }\n\n isExpressionsSupported(dsSettings: DataSourceInstanceSettings): boolean {\n return (dsSettings.meta.alerting || dsSettings.meta.mixed) === true;\n }\n\n renderExtraActions() {\n return GroupActionComponents.getAllExtraRenderAction()\n .map((action, index) =>\n action({\n onAddQuery: this.onAddQuery,\n onChangeDataSource: this.onChangeDataSource,\n key: index,\n })\n )\n .filter(Boolean);\n }\n\n renderAddQueryRow(dsSettings: DataSourceInstanceSettings, styles: QueriesTabStyles) {\n const { isAddingMixed } = this.state;\n const showAddButton = !(isAddingMixed || isSharedDashboardQuery(dsSettings.name));\n\n return (\n <HorizontalGroup spacing=\"md\" align=\"flex-start\">\n {showAddButton && (\n <Button\n icon=\"plus\"\n onClick={this.onAddQueryClick}\n variant=\"secondary\"\n aria-label={selectors.components.QueryTab.addQuery}\n >\n Query\n </Button>\n )}\n {config.expressionsEnabled && this.isExpressionsSupported(dsSettings) && (\n <Button\n icon=\"plus\"\n onClick={this.onAddExpressionClick}\n variant=\"secondary\"\n className={styles.expressionButton}\n >\n <span>Expression </span>\n </Button>\n )}\n {this.renderExtraActions()}\n </HorizontalGroup>\n );\n }\n\n setScrollRef = (scrollElement: HTMLDivElement): void => {\n this.setState({ scrollElement });\n };\n\n render() {\n const { isHelpOpen, dsSettings } = this.state;\n const styles = getStyles();\n\n return (\n <CustomScrollbar autoHeightMin=\"100%\" scrollRefCallback={this.setScrollRef}>\n <div className={styles.innerWrapper}>\n {this.renderTopSection(styles)}\n {dsSettings && (\n <>\n <div className={styles.queriesWrapper}>{this.renderQueries(dsSettings)}</div>\n {this.renderAddQueryRow(dsSettings, styles)}\n {isHelpOpen && (\n <Modal title=\"Data source help\" isOpen={true} onDismiss={this.onCloseHelp}>\n <PluginHelp plugin={dsSettings.meta} type=\"query_help\" />\n </Modal>\n )}\n </>\n )}\n </div>\n </CustomScrollbar>\n );\n }\n}\n\nconst getStyles = stylesFactory(() => {\n const { theme } = config;\n\n return {\n innerWrapper: css`\n display: flex;\n flex-direction: column;\n padding: ${theme.spacing.md};\n `,\n dataSourceRow: css`\n display: flex;\n margin-bottom: ${theme.spacing.md};\n `,\n dataSourceRowItem: css`\n margin-right: ${theme.spacing.inlineFormMargin};\n `,\n dataSourceRowItemOptions: css`\n flex-grow: 1;\n margin-right: ${theme.spacing.inlineFormMargin};\n `,\n queriesWrapper: css`\n padding-bottom: 16px;\n `,\n expressionWrapper: css``,\n expressionButton: css`\n margin-right: ${theme.spacing.sm};\n `,\n };\n});\n\ntype QueriesTabStyles = ReturnType<typeof getStyles>;\n","import { DataQuery, DataSourceApi, hasQueryExportSupport, hasQueryImportSupport } from '@grafana/data';\nimport { isExpressionReference } from '@grafana/runtime/src/utils/DataSourceWithBackend';\n\nexport async function updateQueries(\n nextDS: DataSourceApi,\n nextDSUidOrVariableExpression: string,\n queries: DataQuery[],\n currentDS?: DataSourceApi\n): Promise<DataQuery[]> {\n let nextQueries = queries;\n const datasource = { type: nextDS.type, uid: nextDSUidOrVariableExpression };\n\n // we are changing data source type\n if (currentDS?.meta.id !== nextDS.meta.id) {\n // If changing to mixed do nothing\n if (nextDS.meta.mixed) {\n return queries;\n }\n // when both data sources support abstract queries\n else if (hasQueryExportSupport(currentDS) && hasQueryImportSupport(nextDS)) {\n const abstractQueries = await currentDS.exportToAbstractQueries(queries);\n nextQueries = await nextDS.importFromAbstractQueries(abstractQueries);\n }\n // when datasource supports query import\n else if (currentDS && nextDS.importQueries) {\n nextQueries = await nextDS.importQueries(queries, currentDS);\n }\n // Otherwise clear queries\n else {\n return [{ refId: 'A', datasource }];\n }\n }\n\n if (nextQueries.length === 0) {\n return [{ refId: 'A', datasource }];\n }\n\n // Set data source on all queries except expression queries\n return nextQueries.map((query) => {\n if (!isExpressionReference(query.datasource) && !nextDS.meta.mixed) {\n query.datasource = datasource;\n }\n return query;\n });\n}\n"],"names":["PluginHelp","PureComponent","isError","isLoading","help","plugin","type","this","props","setState","getBackendSrv","get","id","then","response","helpHtml","renderMarkdown","constructPlaceholderInfo","catch","componentDidMount","loadHelp","render","state","className","dangerouslySetInnerHTML","__html","QueryGroupOptionsEditor","constructor","super","event","timeRangeFrom","target","value","timeRangeShift","options","onChange","newValue","emptyToNull","isValid","timeRangeValidation","timeRange","from","relativeTimeIsValid","shift","timeShiftIsValid","timeRangeHide","hide","cacheTimeout","maxDataPoints","parseInt","isNaN","minInterval","isOpen","renderCacheTimeoutOption","dataSource","meta","queryOptions","InlineFormLabel","width","tooltip","Input","placeholder","spellCheck","onBlur","onCacheTimeoutBlur","defaultValue","renderMaxDataPointsOption","data","realMd","request","isAuto","onMaxDataPointsBlur","renderIntervalOption","realInterval","interval","minIntervalOnDs","onMinIntervalBlur","renderCollapsedText","styles","mdDesc","intervalDesc","collapsedText","hideTimeOverride","relativeTime","timeShift","getStyles","QueryOperationRow","index","title","headerElement","onOpen","onOpenOptions","onClose","onCloseOptions","onRelativeTimeChange","onOverrideTime","invalid","onTimeShiftChange","onTimeShift","InlineField","label","labelWidth","Switch","onToggleTimeOverride","rangeUtil","stylesFactory","theme","config","css","spacing","md","typography","size","sm","colors","textWeak","QueryGroup","backendSrv","getDataSourceSrv","isLoadingHelp","helpContent","isPickerOpen","isAddingMixed","isHelpOpen","queries","LoadingState","series","getDefaultTimeRange","async","dsSettings","currentDS","uid","undefined","nextDS","newSettings","nextDSUidOrVariableExpression","nextQueries","datasource","mixed","hasQueryExportSupport","hasQueryImportSupport","abstractQueries","exportToAbstractQueries","importFromAbstractQueries","importQueries","refId","length","map","query","isExpressionReference","updateQueries","dataSourceSrv","name","default","isDefault","onQueriesChange","addQuery","newQuery","onScrollBottom","expressionDatasource","setTimeout","scrollElement","scrollTo","top","onOptionsChange","onRunQueries","DataSourcePicker","onAddMixedQuery","current","autoFocus","variables","onMixedPickerBlur","openMenuOnFocus","onAddQuery","queryRunner","querySubscription","getData","withTransforms","withFieldConfig","subscribe","next","onPanelDataUpdate","ds","getInstanceSettings","defaultDataSource","getRef","q","error","console","log","componentWillUnmount","unsubscribe","changedProps","renderTopSection","onOpenQueryInspector","dataSourceRow","htmlFor","dataSourceRowItem","onChangeDataSource","metrics","dashboard","Button","variant","icon","onClick","onOpenHelp","dataSourceRowItemOptions","onUpdateAndRun","selectors","renderQueries","isSharedDashboardQuery","panelData","QueryEditorRows","isExpressionsSupported","alerting","renderExtraActions","GroupActionComponents","action","key","filter","Boolean","renderAddQueryRow","showAddButton","HorizontalGroup","align","onAddQueryClick","onAddExpressionClick","expressionButton","CustomScrollbar","autoHeightMin","scrollRefCallback","setScrollRef","innerWrapper","queriesWrapper","Modal","onDismiss","onCloseHelp","inlineFormMargin","expressionWrapper"],"sourceRoot":""}
|