Show status in Gauge if value is undefined

If the value in a Gauge is undefined, show the status, like Grid does.
This commit is contained in:
Diego Zamboni 2015-03-03 17:25:06 -06:00
parent 70ce9ee1bf
commit 8c58bfa3ca

View file

@ -37,7 +37,11 @@
this.sub = subs.subscribe(this.query, function(e) {
self.currentEvent = e;
me.box.attr('class', 'box state ' + e.state);
value.text(format.float(e.metric, 2, me.commaSeparateThousands));
if (e.metric != undefined) {
value.text(format.float(e.metric, 2, me.commaSeparateThousands));
} else if (e.state != undefined) {
value.text(e.state)
}
value.attr('title', e.description);
// The first time, do a full-height reflow.