From e5f5c1724a048e95395d894e29abcbaa540cb1fe Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Tue, 21 Feb 2017 17:27:21 +0100 Subject: [PATCH] templating: check for default data source (#7636) For data source template variables, check if the selected value is default and if so load the default data source. Fixes #7586 --- public/app/core/services/datasource_srv.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/app/core/services/datasource_srv.js b/public/app/core/services/datasource_srv.js index 7c876ebd941..e722aae355b 100644 --- a/public/app/core/services/datasource_srv.js +++ b/public/app/core/services/datasource_srv.js @@ -21,6 +21,10 @@ function (angular, _, coreModule, config) { name = templateSrv.replace(name); + if (name === 'default') { + return this.get(config.defaultDatasource); + } + if (this.datasources[name]) { return $q.when(this.datasources[name]); }