diff options
author | Scott Dale <sdale@pfsense.org> | 2007-07-15 19:14:26 +0000 |
---|---|---|
committer | Scott Dale <sdale@pfsense.org> | 2007-07-15 19:14:26 +0000 |
commit | 20e75f7f4f83eae085eb75ebb0ea664ec0059c70 (patch) | |
tree | be0760fc009b1e204c116ea694db9b40365b06b5 | |
parent | 8b35e9c3df7c20343b714b756a10bedb63465c72 (diff) | |
download | pfsense-20e75f7f4f83eae085eb75ebb0ea664ec0059c70.zip pfsense-20e75f7f4f83eae085eb75ebb0ea664ec0059c70.tar.gz |
do not show disabled interfaces
-rw-r--r-- | usr/local/www/widgets/widgets/interface_statistics.widget.php | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/usr/local/www/widgets/widgets/interface_statistics.widget.php b/usr/local/www/widgets/widgets/interface_statistics.widget.php index 570786b..b91dbcc 100644 --- a/usr/local/www/widgets/widgets/interface_statistics.widget.php +++ b/usr/local/www/widgets/widgets/interface_statistics.widget.php @@ -48,24 +48,24 @@ //build data arrays foreach ($ifdescrs as $ifdescr => $ifname){ $ifinfo = get_interface_info($ifdescr); - - $array_in_packets[] = $ifinfo['inpkts']; - $array_out_packets[] = $ifinfo['outpkts']; - $array_in_bytes[] = format_bytes($ifinfo['inbytes']); - $array_out_bytes[] = format_bytes($ifinfo['outbytes']); - if (isset($ifinfo['inerrs'])){ - $array_in_errors[] = $ifinfo['inerrs']; - $array_out_errors[] = $ifinfo['outerrs']; - } - else{ - $array_in_errors[] = "n/a"; - $array_out_errors[] = "n/a"; + if ($ifinfo['status'] != "down"){ + $array_in_packets[] = $ifinfo['inpkts']; + $array_out_packets[] = $ifinfo['outpkts']; + $array_in_bytes[] = format_bytes($ifinfo['inbytes']); + $array_out_bytes[] = format_bytes($ifinfo['outbytes']); + if (isset($ifinfo['inerrs'])){ + $array_in_errors[] = $ifinfo['inerrs']; + $array_out_errors[] = $ifinfo['outerrs']; + } + else{ + $array_in_errors[] = "n/a"; + $array_out_errors[] = "n/a"; + } + if (isset($ifinfo['collisions'])) + $array_collisions[] = htmlspecialchars($ifinfo['collisions']); + else + $array_collisions[] = "n/a"; } - if (isset($ifinfo['collisions'])) - $array_collisions[] = htmlspecialchars($ifinfo['collisions']); - else - $array_collisions[] = "n/a"; - }//end for @@ -106,11 +106,14 @@ <tr> <tr> <?php - foreach ($ifdescrs as $ifdescr => $ifname): ?> + foreach ($ifdescrs as $ifdescr => $ifname): + $ifinfo = get_interface_info($ifdescr); + if ($ifinfo['status'] != "down"){ ?> <td class="widgetsubheader" nowrap style="height:25px"> <?=htmlspecialchars($ifname);?> </td> - <?php endforeach; ?> + <?php } + endforeach; ?> </tr> <tr> |