diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-09-04 11:35:23 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-09-04 11:35:23 +0000 |
commit | f16df257b8ba224661d3707f7f69b43b4d47e36b (patch) | |
tree | 8b6909dba197f0562a72d30711cb0f52ab6e0c26 /modules/admin-full | |
parent | 8fab048554b38760584b1aa348516e6d44b804c1 (diff) |
modules/admin-full: dynamically order lines in connection live status
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules/admin-full')
-rw-r--r-- | modules/admin-full/luasrc/view/admin_status/connections.htm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/admin-full/luasrc/view/admin_status/connections.htm b/modules/admin-full/luasrc/view/admin_status/connections.htm index 6525391aa..80c8b70e3 100644 --- a/modules/admin-full/luasrc/view/admin_status/connections.htm +++ b/modules/admin-full/luasrc/view/admin_status/connections.htm @@ -281,6 +281,18 @@ You may obtain a copy of the License at pt_otr += ' ' + width + ',' + y_otr + ' ' + width + ',' + height; + var order = [ + [ line_udp, data_udp[data_udp.length-1] ], + [ line_tcp, data_tcp[data_tcp.length-1] ], + [ line_otr, data_otr[data_otr.length-1] ] + ]; + + order.sort(function(a, b) { return b[1] - a[1] }); + + for (var i = 0; i < order.length; i++) + order[i][0].parentNode.appendChild(order[i][0]); + + line_udp.setAttribute('points', pt_udp); line_tcp.setAttribute('points', pt_tcp); line_otr.setAttribute('points', pt_otr); |