浏览代码

Fix: Graphite query ast to string fix (#16297)

Fixes #16291
Torkel Ödegaard 6 年之前
父节点
当前提交
74ae756d02
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      public/app/plugins/datasource/graphite/graphite_query.ts

+ 4 - 1
public/app/plugins/datasource/graphite/graphite_query.ts

@@ -19,6 +19,7 @@ export default class GraphiteQuery {
     this.datasource = datasource;
     this.target = target;
     this.templateSrv = templateSrv;
+    this.scopedVars = scopedVars;
     this.parseTarget();
 
     this.removeTagValue = '-- remove tag --';
@@ -162,7 +163,9 @@ export default class GraphiteQuery {
 
   updateModelTarget(targets) {
     const wrapFunction = (target: string, func: any) => {
-      return func.render(target, this.templateSrv.replace);
+      return func.render(target, (value: string) => {
+        return this.templateSrv.replace(value, this.scopedVars);
+      });
     };
 
     if (!this.target.textEditor) {