mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(singlestat): rerender singlestat and reevaluate thresholds on render, fixes #4920
This commit is contained in:
parent
70f7177025
commit
c7e7a0cd16
@ -91,11 +91,6 @@ class SingleStatCtrl extends MetricsPanelCtrl {
|
|||||||
var data: any = {};
|
var data: any = {};
|
||||||
this.setValues(data);
|
this.setValues(data);
|
||||||
|
|
||||||
data.thresholds = this.panel.thresholds.split(',').map(function(strVale) {
|
|
||||||
return Number(strVale.trim());
|
|
||||||
});
|
|
||||||
|
|
||||||
data.colorMap = this.panel.colors;
|
|
||||||
this.data = data;
|
this.data = data;
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
@ -435,8 +430,14 @@ class SingleStatCtrl extends MetricsPanelCtrl {
|
|||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
if (!ctrl.data) { return; }
|
if (!ctrl.data) { return; }
|
||||||
ctrl.setValues(ctrl.data);
|
|
||||||
data = ctrl.data;
|
data = ctrl.data;
|
||||||
|
|
||||||
|
// get thresholds
|
||||||
|
data.thresholds = panel.thresholds.split(',').map(function(strVale) {
|
||||||
|
return Number(strVale.trim());
|
||||||
|
});
|
||||||
|
data.colorMap = panel.colors;
|
||||||
|
|
||||||
setElementHeight();
|
setElementHeight();
|
||||||
|
|
||||||
var body = panel.gauge.show ? '' : getBigValueHtml();
|
var body = panel.gauge.show ? '' : getBigValueHtml();
|
||||||
|
Loading…
Reference in New Issue
Block a user