diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-05 13:42:22 +0545 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-05 10:47:21 -0200 |
commit | e551eed05f71c46c3601790ddb6f2d6d15f8bd52 (patch) | |
tree | bbb49c970f6b3eadb632705d21f011e8a47d6b2d /src/usr/local/www | |
parent | 46237e23f35db70a917939609061dce7b7f955f9 (diff) | |
download | pfsense-e551eed05f71c46c3601790ddb6f2d6d15f8bd52.zip pfsense-e551eed05f71c46c3601790ddb6f2d6d15f8bd52.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.
(cherry picked from commit 0c5d4e8d3e4dc81a9c7eb883a40296493e9faa2b)
Diffstat (limited to 'src/usr/local/www')
-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 f4f3680..6233636 100644 --- a/src/usr/local/www/status_gateways.php +++ b/src/usr/local/www/status_gateways.php @@ -172,11 +172,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 f015efd..3c0f546 100644 --- a/src/usr/local/www/widgets/widgets/gateways.widget.php +++ b/src/usr/local/www/widgets/widgets/gateways.widget.php @@ -265,7 +265,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"); |