From 6385c335159c9f208e9165d6e03e61563e1b3f29 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 11 Dec 2014 07:13:01 +0545 Subject: [PATCH 1/2] Gateway Status Widget keep IP address bold Forum: https://forum.pfsense.org/index.php?topic=85187.msg467438#msg467438 The bold is specified literally in gateways.widget.php for the gateway IP box, so we need to send it bold from here also when providing an update. Because this now uses a "/" in the string (to terminate the bold) have to choose another delimiter between the status text and status color - picked "^" because I can't think where it will appear elsewhere in the real data. This whole string of stuff that is returned by getstats.php back to the browser is a long string with a bunch of delimiters inside delimiters already (vertical bar separated fields, inside that comma-separated fields...) and is already subject to stuff going wrong if any of the real text in the fields contains a vertical bar or comma or... Not about to try to re-engineer all that right now! --- usr/local/www/includes/functions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php index e8203f65a3..f2d8cf0332 100644 --- a/usr/local/www/includes/functions.inc.php +++ b/usr/local/www/includes/functions.inc.php @@ -42,7 +42,7 @@ function get_gatewaystats() { $isfirst = false; $data .= $gw['name'] . ","; if ($gateways_status[$gname]) { - $data .= lookup_gateway_ip_by_name($gname) . ","; + $data .= "" . lookup_gateway_ip_by_name($gname) . ","; $gws = $gateways_status[$gname]; switch(strtolower($gws['status'])) { case "none": @@ -73,7 +73,7 @@ function get_gatewaystats() { $bgcolor = "#ADD8E6"; // lightblue } $data .= ($online == "Pending") ? "{$online},{$online}," : "{$gws['delay']},{$gws['loss']},"; - $data .= "{$online}/{$bgcolor}"; + $data .= "{$online}^{$bgcolor}"; } return $data; } From 2cc10e2cdee54d72921a0f5e1dc527b436eff0f0 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 11 Dec 2014 07:15:09 +0545 Subject: [PATCH 2/2] Change text and color delimiter to carat sign To match change made in functions.inc.php --- usr/local/www/javascript/index/ajax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/javascript/index/ajax.js b/usr/local/www/javascript/index/ajax.js index 5b62e126a3..47c1ee7c4f 100644 --- a/usr/local/www/javascript/index/ajax.js +++ b/usr/local/www/javascript/index/ajax.js @@ -111,7 +111,7 @@ function updateGatewayStats(x){ if (widgetActive("gateways")){ gateways_split = x.split(","); for (var y=0; y