diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-05 13:42:22 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2017-01-05 13:42:22 +0545 |
commit | 0c5d4e8d3e4dc81a9c7eb883a40296493e9faa2b (patch) | |
tree | c09751db5184a90994d8e479eb79e78e669dc711 /src/usr | |
parent | cd45956e512dd5efc122974bb87ca2bcd05010ca (diff) | |
download | pfsense-0c5d4e8d3e4dc81a9c7eb883a40296493e9faa2b.zip pfsense-0c5d4e8d3e4dc81a9c7eb883a40296493e9faa2b.tar.gz |
Correctly report unmonitored gateway status
If an alternate monitor IP has been entered and saved, then the user
checks "Disable Gateway Monitoring" and saves, the alternate monitor IP
is retained in the config - that is handy for when unchecking "Disable
Gateway Monitoring" later on.
But the Gateways widget and Status Gateways do not correctly understand
this combination. The gateway status shows as "Online" when it is
intended to show "Online (unmonitored)".
This PR corrects this.
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/status_gateways.php | 10 | ||||
-rw-r--r-- | src/usr/local/www/widgets/widgets/gateways.widget.php | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/usr/local/www/status_gateways.php b/src/usr/local/www/status_gateways.php index d633fab..5b5125c 100644 --- a/src/usr/local/www/status_gateways.php +++ b/src/usr/local/www/status_gateways.php @@ -140,11 +140,17 @@ display_top_tabs($tab_array); $online = gettext("Warning, Latency") . ': ' . $status['delay']; $bgcolor = "bg-warning"; } elseif ($status['status'] == "none") { - $online = gettext("Online"); + if ($status['monitor_disable'] || ($status['monitorip'] == "none")) { + $online = gettext("Online (unmonitored)"); + } else { + $online = gettext("Online"); + } $bgcolor = "bg-success"; } } else if (isset($gateway['monitor_disable'])) { - $online = gettext("Online"); + // Note: return_gateways_status() always returns an array entry for all gateways, + // so this "else if" never happens. + $online = gettext("Online (unmonitored)"); $bgcolor = "bg-success"; } else { $online = gettext("Pending"); diff --git a/src/usr/local/www/widgets/widgets/gateways.widget.php b/src/usr/local/www/widgets/widgets/gateways.widget.php index 34f4d2e..c7c92bd 100644 --- a/src/usr/local/www/widgets/widgets/gateways.widget.php +++ b/src/usr/local/www/widgets/widgets/gateways.widget.php @@ -233,7 +233,7 @@ function compose_table_body_contents() { $online = gettext("Latency"); $bgcolor = "warning"; // khaki } elseif ($gateways_status[$gname]['status'] == "none") { - if ($gateways_status[$gname]['monitorip'] == "none") { + if ($gateways_status[$gname]['monitor_disable'] || ($gateways_status[$gname]['monitorip'] == "none")) { $online = gettext("Online <br/>(unmonitored)"); } else { $online = gettext("Online"); |