From aeb35534914faea3b39778dcf5ab36de514a2ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 11 Mar 2019 18:36:49 +0100 Subject: [PATCH] Added scopedVars argument in datasourceSrv.get in DataPanel --- public/app/features/dashboard/dashgrid/DataPanel.tsx | 2 +- public/app/features/plugins/datasource_srv.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/dashgrid/DataPanel.tsx b/public/app/features/dashboard/dashgrid/DataPanel.tsx index 09864d85960..82d94669cd6 100644 --- a/public/app/features/dashboard/dashgrid/DataPanel.tsx +++ b/public/app/features/dashboard/dashgrid/DataPanel.tsx @@ -116,7 +116,7 @@ export class DataPanel extends Component { this.setState({ loading: LoadingState.Loading }); try { - const ds = await this.dataSourceSrv.get(datasource); + const ds = await this.dataSourceSrv.get(datasource, scopedVars); // TODO interpolate variables const minInterval = this.props.minInterval || ds.interval; diff --git a/public/app/features/plugins/datasource_srv.ts b/public/app/features/plugins/datasource_srv.ts index a98ac99eaf1..fde17ba8f48 100644 --- a/public/app/features/plugins/datasource_srv.ts +++ b/public/app/features/plugins/datasource_srv.ts @@ -26,6 +26,7 @@ export class DatasourceSrv { return this.get(config.defaultDatasource); } + // Interpolation here is to support template variable in data source selection name = this.templateSrv.replace(name, scopedVars, (value, variable) => { if (Array.isArray(value)) { return value[0];