diff options
author | Michele Di Maria <michele@nt2.it> | 2013-01-31 09:07:36 +0100 |
---|---|---|
committer | Michele Di Maria <michele@nt2.it> | 2013-01-31 09:07:36 +0100 |
commit | 6ba3121b277ad0840f253e2248353d5c6e64f6f2 (patch) | |
tree | 2ee147afa4b09b71e9682e3182843357e84ef0ff /usr | |
parent | 73eeee9347445b5ee0cb3c13eae9d9ead4084c8d (diff) | |
download | pfsense-6ba3121b277ad0840f253e2248353d5c6e64f6f2.zip pfsense-6ba3121b277ad0840f253e2248353d5c6e64f6f2.tar.gz |
Fixes links and PPS
This change fixes:
- Interface value in the links to the "Firewall: Traffic Shaper" page;
- Read the proper PPS value from the qstats XML file.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/status_queues.php | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/usr/local/www/status_queues.php b/usr/local/www/status_queues.php index 8ca445c..8dedf7d 100755 --- a/usr/local/www/status_queues.php +++ b/usr/local/www/status_queues.php @@ -50,8 +50,8 @@ header("Pragma: no-cache"); // HTTP/1.0 require("guiconfig.inc"); class QueueStats { public $queuename; - public $pps; - public $bandwidth; + public $pps; + public $bandwidth; public $borrows; public $suspends; public $drops; @@ -150,7 +150,9 @@ if(!is_array($config['shaper']['queue']) || count($config['shaper']['queue']) < <td class="listhdr" width="1%"><?=gettext("Suspends"); ?></td> <td class="listhdr" width="1%"><?=gettext("Drops"); ?></td> </tr> - <?php processQueues($altqstats, 0)?> + <?php + $if_queue_list = get_configured_interface_list_by_realif(false, true); + processQueues($altqstats, 0)?> <?php endif; ?> </table> <p> @@ -164,19 +166,26 @@ if(!is_array($config['shaper']['queue']) || count($config['shaper']['queue']) < <?php function processQueues($altqstats, $level){ global $g; - foreach ($altqstats['queue'] as $q) {?> + global $if_queue_list; + foreach ($altqstats['queue'] as $q) { + $if_name = ""; + foreach ($if_queue_list as $oif => $real_name) + { + if ($oif == $q['interface']) + { + $if_name = $real_name; + break; + } + } + ?> <tr> <td bgcolor="#DDDDDD" style="padding-left: <?php echo $level * 20?>px;"> <font color="#000000"> <? if (strstr($q['name'], "root_")) - { - echo "<a href=\"firewall_shaper.php?interface={$q['interface']}&queue={$q['interface']}\">" . htmlspecialchars(convert_real_interface_to_friendly_descr($q['interface'])) . "</a>"; - } + echo "<a href=\"firewall_shaper.php?interface={$if_name}&queue={$if_name}&action=show\">" . htmlspecialchars(convert_real_interface_to_friendly_descr($q['interface'])) . "</a>"; else - { - echo "<a href=\"firewall_shaper.php?interface={$q['interface']}&queue={$q['name']}\">" . htmlspecialchars($q['name']) . "</a>"; - } + echo "<a href=\"firewall_shaper.php?interface={$if_name}&queue={$q['name']}&action=show\">" . htmlspecialchars($q['name']) . "</a>"; ?> </font> </td> @@ -195,11 +204,9 @@ function processQueues($altqstats, $level){ echo "<td width=\"1%\" bgcolor=\"#DDDDDD\"><input style='border: 0px solid white; background-color:#DDDDDD; color:#000000;width:80px;text-align:right;' size='10' name='queue{$q['name']}{$q['interface']}drops' id='queue{$q['name']}{$q['interface']}drops' value='' align='right'></td>"; ?> </tr> - <?php + <?php if (is_array($q['queue'])) - { - processQueues($q, $level + 1); - } + processQueues($q, $level + 1); }; } function statsQueues($xml){ @@ -207,7 +214,7 @@ function statsQueues($xml){ $current = new QueueStats(); $child = new QueueStats(); $current->queuename = $xml['name'] . $xml['interface']; - $current->pps = intval($xml['pkts']); + $current->pps = intval($xml['measured']); $current->bandwidth = intval($xml['measuredspeedint']); $current->borrows = intval($xml['borrows']); $current->suspends = intval($xml['suspends']); |