瀏覽代碼

support template variables with multiple values

bergquist 7 年之前
父節點
當前提交
19c7dd9834
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      public/app/plugins/datasource/grafana/datasource.ts

+ 5 - 2
public/app/plugins/datasource/grafana/datasource.ts

@@ -57,8 +57,11 @@ class GrafanaDatasource {
         return this.$q.when([]);
       }
       const tags = [];
-      for (let t of params.tags) {
-        tags.push(this.templateSrv.replace(t));
+      for (const t of params.tags) {
+        const renderedValues = this.templateSrv.replace(t, {}, 'pipe');
+        for (const tt of renderedValues.split('|')) {
+          tags.push(tt);
+        }
       }
       params.tags = tags;
     }