summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2012-06-04 12:37:15 +0200
committersmos <seth.mos@dds.nl>2012-06-04 12:37:15 +0200
commit603f19f007149348639c9e09366881ea95b28aa4 (patch)
treef9a21350e36dcaee88d5f52825af401d258ede26
parent4a67fc61ad854691252b5239116a0aec8905991e (diff)
downloadpfsense-603f19f007149348639c9e09366881ea95b28aa4.zip
pfsense-603f19f007149348639c9e09366881ea95b28aa4.tar.gz
Some minor enhancements from renaming the Gathering Data to Pending.
When it doesn't exist in the array it's really unknown. Make that lightblue. show a ~
-rw-r--r--etc/inc/gwlb.inc4
-rw-r--r--usr/local/www/includes/functions.inc.php19
-rwxr-xr-xusr/local/www/status_gateways.php6
3 files changed, 16 insertions, 13 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index f4a281a..9ebdf43 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -286,8 +286,8 @@ function return_gateways_status($byname = false) {
$status[$target]['srcip'] = $info[1];
$status[$target]['name'] = $info[2];
$status[$target]['lastcheck'] = $info[5] ? date('r', $info[5]) : date('r');
- $status[$target]['delay'] = empty($info[6]) ? 0 : $info[6];
- $status[$target]['loss'] = empty($info[7]) ? "0.0%" : $info[7] . "";
+ $status[$target]['delay'] = empty($info[6]) ? "0ms" : round($info[6], 1) ."ms" ;
+ $status[$target]['loss'] = empty($info[7]) ? "0.0%" : round($info[7], 1) . "%";
$status[$target]['status'] = trim($info[8]);
}
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php
index 3ad1c5a..b6afbff 100644
--- a/usr/local/www/includes/functions.inc.php
+++ b/usr/local/www/includes/functions.inc.php
@@ -36,8 +36,8 @@ function get_gatewaystats() {
$data .= ",";
$isfirst = false;
$data .= $gw['name'] . ",";
- $data .= lookup_gateway_ip_by_name($gname) . ",";
if ($gateways_status[$gname]) {
+ $data .= lookup_gateway_ip_by_name($gname) . ",";
$gws = $gateways_status[$gname];
switch(strtolower($gws['status'])) {
case "none":
@@ -49,22 +49,25 @@ function get_gatewaystats() {
$bgcolor = "lightcoral";
break;
case "delay":
- $online = "Warning: Latency";
+ $online = "Latency";
$bgcolor = "khaki";
break;
case "loss":
- $online = "Warning: Packetloss";
+ $online = "Packetloss";
$bgcolor = "khaki";
break;
default:
- $online = "Gathering data";
+ $online = "Pending";
break;
}
} else {
- $online = "Gathering data";
- $bgcolor = "lightgray";
+ $data .= "~,";
+ $gws['delay'] = "~";
+ $gws['loss'] = "~";
+ $online = "Unknown";
+ $bgcolor = "lightblue";
}
- $data .= ($online == "Gathering data") ? "{$online},{$online}," : "{$gws['delay']},{$gws['loss']},";
+ $data .= ($online == "Pending") ? "{$online},{$online}," : "{$gws['delay']},{$gws['loss']},";
$data .= "<table><tr><td bgcolor=\"$bgcolor\" > $online </td></td></tr></table>";
}
return $data;
@@ -309,4 +312,4 @@ function get_interfacestatus() {
return $data;
}
-?> \ No newline at end of file
+?>
diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php
index 0feba2a..7d7ebbc 100755
--- a/usr/local/www/status_gateways.php
+++ b/usr/local/www/status_gateways.php
@@ -97,7 +97,7 @@ include("head.inc");
<?php if ($gateways_status[$gname])
echo $gateways_status[$gname]['delay'];
else
- echo gettext("Gathering data");
+ echo gettext("Pending");
?>
<?php $counter++; ?>
</td>
@@ -105,7 +105,7 @@ include("head.inc");
<?php if ($gateways_status[$gname])
echo $gateways_status[$gname]['loss'];
else
- echo gettext("Gathering data");
+ echo gettext("Pending");
?>
<?php $counter++; ?>
</td>
@@ -131,7 +131,7 @@ include("head.inc");
$online = gettext("Online");
$bgcolor = "lightgreen";
} else {
- $online = gettext("Gathering data");
+ $online = gettext("Pending");
$bgcolor = "lightgray";
}
echo "<tr><td><table width='100%'><tr><td bgcolor=\"$bgcolor\" > $online </td></tr><tr><td>";
OpenPOWER on IntegriCloud