summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-12-05 17:54:30 +0545
committerPhil Davis <phil.davis@inf.org>2014-12-05 17:54:30 +0545
commit95d045fcd76b09d84d1174f187faae863eb2fefb (patch)
tree803e005ed5643362ca8b82dbb766e234a0e57f42 /usr/local
parentbeb7d9e33261c5d3e7fa387f7d61054f0c55ad99 (diff)
downloadpfsense-95d045fcd76b09d84d1174f187faae863eb2fefb.zip
pfsense-95d045fcd76b09d84d1174f187faae863eb2fefb.tar.gz
Set text and color of Gateways Widget Status
getstats.php calls functions.inc.php get_stats(), which calls get_gatewaystats(). get_gatewaystats() now returns the text for each field and an optional color separated by "/" - "text/color" e.g. "Online/#90EE90" Parse the the new format, separating out text and color. If color is specified, then also set it with jQuery to css.
Diffstat (limited to 'usr/local')
-rw-r--r--usr/local/www/javascript/index/ajax.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr/local/www/javascript/index/ajax.js b/usr/local/www/javascript/index/ajax.js
index 2fc6ab6..5b62e12 100644
--- a/usr/local/www/javascript/index/ajax.js
+++ b/usr/local/www/javascript/index/ajax.js
@@ -111,8 +111,12 @@ function updateGatewayStats(x){
if (widgetActive("gateways")){
gateways_split = x.split(",");
for (var y=0; y<gateways_split.length; y++){
+ gateways_field_split = gateways_split[y].split("/");
if(jQuery('#gateway' + (y + 1))) {
- jQuery('#gateway' + (y + 1)).html(gateways_split[y]);
+ jQuery('#gateway' + (y + 1)).html(gateways_field_split[0]);
+ if(gateways_field_split[1]) {
+ jQuery('#gateway' + (y + 1)).css('background-color',gateways_field_split[1]);
+ }
}
}
}
OpenPOWER on IntegriCloud