Explorar o código

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 %!s(int64=8) %!d(string=hai) anos
pai
achega
b241b98196
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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;
     }