浏览代码

singlestat: fix for variable

in the prefix or postfix fields and when adding a gauge.
Previously the template variable substition was only done
when not rendering the gauge.
Daniel Lee 8 年之前
父节点
当前提交
b241b98196
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      public/app/plugins/panel/singlestat/module.ts

+ 2 - 2
public/app/plugins/panel/singlestat/module.ts

@@ -402,9 +402,9 @@ class SingleStatCtrl extends MetricsPanelCtrl {
     }
 
     function getValueText() {
-      var result = panel.prefix ? panel.prefix : '';
+      var result = panel.prefix ? templateSrv.replace(panel.prefix, data.scopedVars) : '';
       result += data.valueFormatted;
-      result += panel.postfix ? panel.postfix : '';
+      result += panel.postfix ? templateSrv.replace(panel.postfix, data.scopedVars) : '';
 
       return result;
     }