Browse Source

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 years ago
parent
commit
b241b98196
1 changed files with 2 additions and 2 deletions
  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;
     }