summaryrefslogtreecommitdiffstats
path: root/usr/local/www/javascript
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-12-05 17:54:30 +0545
committerRenato Botelho <garga@FreeBSD.org>2014-12-05 11:06:45 -0200
commita911f2e2767b74e03f5ef5e659162e61b67ad227 (patch)
tree5f9b7fba8e4f3b423e4e414efb6567f2df661a76 /usr/local/www/javascript
parent3002168fab6b40ff6009eaa991d98cd0b162afac (diff)
downloadpfsense-a911f2e2767b74e03f5ef5e659162e61b67ad227.zip
pfsense-a911f2e2767b74e03f5ef5e659162e61b67ad227.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/www/javascript')
-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