소스 검색

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
Daniel Lee 9 년 전
부모
커밋
e5f5c1724a
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      public/app/core/services/datasource_srv.js

+ 4 - 0
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]);
       }