summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil@jankaritech.com>2017-04-29 21:17:58 +0545
committerRenato Botelho <renato@netgate.com>2017-05-03 09:27:09 -0300
commitc180fdbedeb534b3a4b32c83db754baad6a16a7e (patch)
tree5ef95beb722bfe8479a8f79061de65dca70ed623
parente639325a7c96a3a90c53a2dc58f64f0df574b197 (diff)
downloadpfsense-c180fdbedeb534b3a4b32c83db754baad6a16a7e.zip
pfsense-c180fdbedeb534b3a4b32c83db754baad6a16a7e.tar.gz
Let he user know if all selected interfaces are down
in the interface statistics widget. At the moment, if all the selected interfaces are down, the widget will just display no columns. That will make users wonder what happened. (cherry picked from commit b22fceb2d7973b8c80a55b4ec492819ddd5ae9f9)
-rw-r--r--src/usr/local/www/widgets/widgets/interface_statistics.widget.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/usr/local/www/widgets/widgets/interface_statistics.widget.php b/src/usr/local/www/widgets/widgets/interface_statistics.widget.php
index 0ea20bb..ff2cc29 100644
--- a/src/usr/local/www/widgets/widgets/interface_statistics.widget.php
+++ b/src/usr/local/www/widgets/widgets/interface_statistics.widget.php
@@ -81,7 +81,8 @@ if ($_REQUEST && $_REQUEST['ajax']) {
);
$skipinterfaces = explode(",", $user_settings['widgets']['interface_statistics']['iffilter']);
- $interface_is_displayed = false;
+ $an_interface_is_selected = false; // decide if at least 1 interface is selected for display
+ $an_interface_is_displayed = false; // decide if at least 1 interface is displayed (i.e. not down)
print("<thead>");
print( "<tr>");
@@ -92,17 +93,20 @@ if ($_REQUEST && $_REQUEST['ajax']) {
continue;
}
- $interface_is_displayed = true;
+ $an_interface_is_selected = true;
$ifinfo_arr[$ifdescr] = get_interface_info($ifdescr);
$ifinfo_arr[$ifdescr]['inbytes'] = format_bytes($ifinfo_arr[$ifdescr]['inbytes']);
$ifinfo_arr[$ifdescr]['outbytes'] = format_bytes($ifinfo_arr[$ifdescr]['outbytes']);
if ($ifinfo_arr[$ifdescr]['status'] != "down") {
+ $an_interface_is_displayed = true;
print("<th>" . $ifname . "</th>");
}
}
- if (!$interface_is_displayed) {
+ if (!$an_interface_is_selected) {
print("<th>" . gettext('All interfaces are hidden.') . "</th>");
+ } else if (!$an_interface_is_displayed) {
+ print("<th>" . gettext('All selected interfaces are down.') . "</th>");
}
print( "</tr>");
OpenPOWER on IntegriCloud