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.
This commit is contained in:
Daniel Lee 2017-08-02 16:40:26 +02:00
parent 814d164e5b
commit b241b98196

View File

@ -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;
}