diff options
author | Phil Davis <phil@jankaritech.com> | 2017-04-29 21:17:58 +0545 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-29 21:17:58 +0545 |
commit | b22fceb2d7973b8c80a55b4ec492819ddd5ae9f9 (patch) | |
tree | f81bbd7e006cceadeea3f2a669ba8725ca155ff5 /src/usr/local | |
parent | d87a9a1c9720f2093b57979d1b0f1e69e38750af (diff) | |
download | pfsense-b22fceb2d7973b8c80a55b4ec492819ddd5ae9f9.zip pfsense-b22fceb2d7973b8c80a55b4ec492819ddd5ae9f9.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.
Diffstat (limited to 'src/usr/local')
-rw-r--r-- | src/usr/local/www/widgets/widgets/interface_statistics.widget.php | 10 |
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 ac1301a..cb3b463 100644 --- a/src/usr/local/www/widgets/widgets/interface_statistics.widget.php +++ b/src/usr/local/www/widgets/widgets/interface_statistics.widget.php @@ -49,7 +49,8 @@ if ($_REQUEST && $_REQUEST['ajax']) { ); $skipinterfaces = explode(",", $user_settings['widgets'][$_REQUEST['widgetkey']]['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>"); @@ -60,17 +61,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>"); |