summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-10-14 13:33:47 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-10-14 13:33:47 +0000
commitaf4afea77f9abda7093bba594f203134ef1d6cff (patch)
tree1c765055183b38daa9f6e0f37f289449dfe79206 /modules/admin-full
parent8e6336170d7c6a79115d5770694b0961386a13b2 (diff)
modules/admin-full: fix JavaScript issues in live statistics
Diffstat (limited to 'modules/admin-full')
-rw-r--r--modules/admin-full/luasrc/view/admin_status/bandwidth.htm11
-rw-r--r--modules/admin-full/luasrc/view/admin_status/wireless.htm2
2 files changed, 8 insertions, 5 deletions
diff --git a/modules/admin-full/luasrc/view/admin_status/bandwidth.htm b/modules/admin-full/luasrc/view/admin_status/bandwidth.htm
index da68373706..b8a21bd33c 100644
--- a/modules/admin-full/luasrc/view/admin_status/bandwidth.htm
+++ b/modules/admin-full/luasrc/view/admin_status/bandwidth.htm
@@ -188,11 +188,14 @@ $Id$
continue;
/* normalize difference against time interval */
- var time_delta = data[i][TIME] - data[i-1][TIME];
- if (time_delta)
+ if (i > 0)
+ {
+ var time_delta = data[i][TIME] - data[i-1][TIME];
+ if (time_delta)
{
- data_rx.push((data[i][RXB] - data[i-1][RXB]) / time_delta);
- data_tx.push((data[i][TXB] - data[i-1][TXB]) / time_delta);
+ data_rx.push((data[i][RXB] - data[i-1][RXB]) / time_delta);
+ data_tx.push((data[i][TXB] - data[i-1][TXB]) / time_delta);
+ }
}
}
diff --git a/modules/admin-full/luasrc/view/admin_status/wireless.htm b/modules/admin-full/luasrc/view/admin_status/wireless.htm
index eb91ae649f..f70e3b26fc 100644
--- a/modules/admin-full/luasrc/view/admin_status/wireless.htm
+++ b/modules/admin-full/luasrc/view/admin_status/wireless.htm
@@ -213,7 +213,7 @@ $Id$
data_rssi.push(data[i][RSSI] - noise_floor);
data_noise.push(data[i][NOISE] - noise_floor);
- data_rate.push(Math.floor(data[i][RATE] / 100));
+ data_rate.push(Math.floor(data[i][RATE] / 1000));
}
/* cut off outdated entries */