From 2691ed7a81368cdb653be392fd8f84ca52f834fe Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 15 Apr 2015 16:09:07 +0100 Subject: [PATCH] Colourise data if it's zero. --- contrib/status/js/eddn.js | 13 +++++++++++++ contrib/status/status.html | 30 +++++++++++++++--------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/contrib/status/js/eddn.js b/contrib/status/js/eddn.js index ff97f9d..541bd62 100644 --- a/contrib/status/js/eddn.js +++ b/contrib/status/js/eddn.js @@ -15,6 +15,7 @@ displayGatewayStats = function(stats) { $("#gateway_outbound_60min").html((stats["outbound"] || {})["60min"] || 0); d = new Date(); $("#update_timestamp").html(d.toString("yyyy-MM-dd HH:mm:ss")); + formatStats(); } displayRelayStats = function(stats) { @@ -27,6 +28,18 @@ displayRelayStats = function(stats) { $("#relay_outbound_60min").html((stats["outbound"] || {})["60min"] || 0); d = new Date(); $("#update_timestamp").html(d.toString("yyyy-MM-dd HH:mm:ss")); + formatStats(); +} + +formatStats = function() { + $(".stat").each(function() { + if ($(this).html() == "0") { + $(this).addClass("warning"); + } + else { + $(this).removeClass("warning"); + } + }); } function doUpdate(url, success, failure) { diff --git a/contrib/status/status.html b/contrib/status/status.html index af0e999..20b403c 100644 --- a/contrib/status/status.html +++ b/contrib/status/status.html @@ -40,21 +40,21 @@ Messages received - 0 - 0 - 0 + 0 + 0 + 0 Invalid messages - 0 - 0 - 0 + 0 + 0 + 0 Messages passed to relay - 0 - 0 - 0 + 0 + 0 + 0 @@ -71,15 +71,15 @@ Messages received - 0 - 0 - 0 + 0 + 0 + 0 Messages passed to relay - 0 - 0 - 0 + 0 + 0 + 0