summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_graph.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2013-03-08 00:10:09 +0545
committerPhil Davis <phil.davis@world.inf.org>2013-03-08 00:10:09 +0545
commit5356362ca3f71efadfd06814ef9f14cf1ff51a56 (patch)
tree92898edd1041a51f02941fd8b16bdbaa2c0441a8 /usr/local/www/status_graph.php
parent1dedfdd1b7eeca5f41f8e85c237a70cc6ab22fbd (diff)
downloadpfsense-5356362ca3f71efadfd06814ef9f14cf1ff51a56.zip
pfsense-5356362ca3f71efadfd06814ef9f14cf1ff51a56.tar.gz
Fix stale bandwidth-by-IP table entries
When the number of valid rows in the table reduced by more than 1 between updates, stale entries were left displayed at the end - e.g. 8 rows (0-7), then next update has only 5 rows (0-4). Row 5 is hidden but rows 6 and 7 remain displayed.
Diffstat (limited to 'usr/local/www/status_graph.php')
-rwxr-xr-xusr/local/www/status_graph.php42
1 files changed, 20 insertions, 22 deletions
diff --git a/usr/local/www/status_graph.php b/usr/local/www/status_graph.php
index 636f5d9..2342700 100755
--- a/usr/local/www/status_graph.php
+++ b/usr/local/www/status_graph.php
@@ -153,32 +153,30 @@ function updateBandwidthHosts(data){
d = document;
//parse top ten bandwidth abuser hosts
for (var y=0; y<10; y++){
- if (hosts_split[y] != "" && hosts_split[y] != "no info"){
- if (hosts_split[y]) {
- hostinfo = hosts_split[y].split(";");
+ if ((y < hosts_split.length) && (hosts_split[y] != "") && (hosts_split[y] != "no info")) {
+ hostinfo = hosts_split[y].split(";");
- //update host ip info
- var HostIpID = "hostip" + y;
- var hostip = d.getElementById(HostIpID);
- hostip.innerHTML = hostinfo[0];
+ //update host ip info
+ var HostIpID = "hostip" + y;
+ var hostip = d.getElementById(HostIpID);
+ hostip.innerHTML = hostinfo[0];
- //update bandwidth inbound to host
- var hostbandwidthInID = "bandwidthin" + y;
- var hostbandwidthin = d.getElementById(hostbandwidthInID);
- hostbandwidthin.innerHTML = hostinfo[1] + " Bits/sec";
+ //update bandwidth inbound to host
+ var hostbandwidthInID = "bandwidthin" + y;
+ var hostbandwidthin = d.getElementById(hostbandwidthInID);
+ hostbandwidthin.innerHTML = hostinfo[1] + " Bits/sec";
- //update bandwidth outbound from host
- var hostbandwidthOutID = "bandwidthout" + y;
- var hostbandwidthOut = d.getElementById(hostbandwidthOutID);
- hostbandwidthOut.innerHTML = hostinfo[2] + " Bits/sec";
+ //update bandwidth outbound from host
+ var hostbandwidthOutID = "bandwidthout" + y;
+ var hostbandwidthOut = d.getElementById(hostbandwidthOutID);
+ hostbandwidthOut.innerHTML = hostinfo[2] + " Bits/sec";
- //make the row appear if hidden
- var rowid = "#host" + y;
- if (jQuery(rowid).css('display') == "none"){
- //hide rows that contain no data
- jQuery(rowid).show(1000);
- }
- }
+ //make the row appear if hidden
+ var rowid = "#host" + y;
+ if (jQuery(rowid).css('display') == "none"){
+ //hide rows that contain no data
+ jQuery(rowid).show(1000);
+ }
}
else
{
OpenPOWER on IntegriCloud