mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelMenu: Allow showing panel menu when data source does not exist (#94545)
This commit is contained in:
parent
9811725c59
commit
97037580df
@ -1,4 +1,4 @@
|
|||||||
import { PanelMenuItem } from '@grafana/data';
|
import { DataSourceApi, PanelMenuItem } from '@grafana/data';
|
||||||
import { PromQuery } from '@grafana/prometheus';
|
import { PromQuery } from '@grafana/prometheus';
|
||||||
import { getDataSourceSrv } from '@grafana/runtime';
|
import { getDataSourceSrv } from '@grafana/runtime';
|
||||||
import { SceneTimeRangeState, VizPanel } from '@grafana/scenes';
|
import { SceneTimeRangeState, VizPanel } from '@grafana/scenes';
|
||||||
@ -34,7 +34,13 @@ export async function addDataTrailPanelAction(dashboard: DashboardScene, panel:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataSourceApi = await getDataSourceSrv().get(datasource);
|
let dataSourceApi: DataSourceApi | undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
dataSourceApi = await getDataSourceSrv().get(datasource);
|
||||||
|
} catch (e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (dataSourceApi.interpolateVariablesInQueries == null) {
|
if (dataSourceApi.interpolateVariablesInQueries == null) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user