From b241b98196021fd21d7d7d29588a02fd2cbb0ac8 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 2 Aug 2017 16:40:26 +0200 Subject: [PATCH] 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. --- public/app/plugins/panel/singlestat/module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index dce82f17ce2..4b7f6e2e90d 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/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; }