mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
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.
This commit is contained in:
parent
beb7d9e332
commit
95d045fcd7
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user