From 00f23f60f6af76c9a1b772e2e41c94138f59bb3b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 15 Oct 2011 05:10:58 +0000 Subject: [PATCH] modules/admin-full: move realtime stats into submenu --- .../luasrc/controller/admin/status.lua | 19 ++++++++++--------- .../luasrc/view/admin_status/bandwidth.htm | 4 ++-- .../luasrc/view/admin_status/connections.htm | 2 +- .../luasrc/view/admin_status/load.htm | 2 +- .../luasrc/view/admin_status/wireless.htm | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/modules/admin-full/luasrc/controller/admin/status.lua b/modules/admin-full/luasrc/controller/admin/status.lua index 413bc6ec16..f77d91b343 100644 --- a/modules/admin-full/luasrc/controller/admin/status.lua +++ b/modules/admin-full/luasrc/controller/admin/status.lua @@ -22,20 +22,21 @@ function index() entry({"admin", "status", "routes"}, template("admin_status/routes"), _("Routes"), 3) entry({"admin", "status", "syslog"}, call("action_syslog"), _("System Log"), 4) entry({"admin", "status", "dmesg"}, call("action_dmesg"), _("Kernel Log"), 5) + entry({"admin", "status", "processes"}, cbi("admin_status/processes"), _("Processes"), 6) - entry({"admin", "status", "load"}, template("admin_status/load"), _("Realtime Load"), 6).leaf = true - entry({"admin", "status", "load_status"}, call("action_load")).leaf = true + entry({"admin", "status", "realtime"}, alias("admin", "status", "realtime", "load"), _("Realtime Graphs"), 7) - entry({"admin", "status", "bandwidth"}, template("admin_status/bandwidth"), _("Realtime Traffic"), 7).leaf = true - entry({"admin", "status", "bandwidth_status"}, call("action_bandwidth")).leaf = true + entry({"admin", "status", "realtime", "load"}, template("admin_status/load"), _("Load"), 1).leaf = true + entry({"admin", "status", "realtime", "load_status"}, call("action_load")).leaf = true - entry({"admin", "status", "wireless"}, template("admin_status/wireless"), _("Realtime Wireless"), 8).leaf = true - entry({"admin", "status", "wireless_status"}, call("action_wireless")).leaf = true + entry({"admin", "status", "realtime", "bandwidth"}, template("admin_status/bandwidth"), _("Traffic"), 2).leaf = true + entry({"admin", "status", "realtime", "bandwidth_status"}, call("action_bandwidth")).leaf = true - entry({"admin", "status", "connections"}, template("admin_status/connections"), _("Realtime Connections"), 9).leaf = true - entry({"admin", "status", "connections_status"}, call("action_connections")).leaf = true + entry({"admin", "status", "realtime", "wireless"}, template("admin_status/wireless"), _("Wireless"), 3).leaf = true + entry({"admin", "status", "realtime", "wireless_status"}, call("action_wireless")).leaf = true - entry({"admin", "status", "processes"}, cbi("admin_status/processes"), _("Processes"), 20) + entry({"admin", "status", "realtime", "connections"}, template("admin_status/connections"), _("Connections"), 4).leaf = true + entry({"admin", "status", "realtime", "connections_status"}, call("action_connections")).leaf = true end function action_syslog() diff --git a/modules/admin-full/luasrc/view/admin_status/bandwidth.htm b/modules/admin-full/luasrc/view/admin_status/bandwidth.htm index b8a21bd33c..e793dde866 100644 --- a/modules/admin-full/luasrc/view/admin_status/bandwidth.htm +++ b/modules/admin-full/luasrc/view/admin_status/bandwidth.htm @@ -169,7 +169,7 @@ $Id$ label_scale.innerHTML = String.format('<%:(%d minute window, %d second interval)%>', data_wanted / 60, 3); /* render datasets, start update interval */ - XHR.poll(3, '<%=build_url("admin/status/bandwidth_status", curdev)%>', null, + XHR.poll(3, '<%=build_url("admin/status/realtime/bandwidth_status", curdev)%>', null, function(x, data) { var data_max = 0; @@ -192,7 +192,7 @@ $Id$ { 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); } diff --git a/modules/admin-full/luasrc/view/admin_status/connections.htm b/modules/admin-full/luasrc/view/admin_status/connections.htm index dfd12f0717..c296cfb6ea 100644 --- a/modules/admin-full/luasrc/view/admin_status/connections.htm +++ b/modules/admin-full/luasrc/view/admin_status/connections.htm @@ -141,7 +141,7 @@ $Id$ label_scale.innerHTML = String.format('<%:(%d minute window, %d second interval)%>', data_wanted / 60, 3); /* render datasets, start update interval */ - XHR.poll(3, '<%=build_url("admin/status/connections_status")%>', null, + XHR.poll(3, '<%=build_url("admin/status/realtime/connections_status")%>', null, function(x, json) { var conn = json.connections; diff --git a/modules/admin-full/luasrc/view/admin_status/load.htm b/modules/admin-full/luasrc/view/admin_status/load.htm index e1e163c705..4537645ca0 100644 --- a/modules/admin-full/luasrc/view/admin_status/load.htm +++ b/modules/admin-full/luasrc/view/admin_status/load.htm @@ -138,7 +138,7 @@ $Id$ label_scale.innerHTML = String.format('<%:(%d minute window, %d second interval)%>', data_wanted / 60, 3); /* render datasets, start update interval */ - XHR.poll(3, '<%=build_url("admin/status/load_status")%>', null, + XHR.poll(3, '<%=build_url("admin/status/realtime/load_status")%>', null, function(x, data) { var data_max = 0; diff --git a/modules/admin-full/luasrc/view/admin_status/wireless.htm b/modules/admin-full/luasrc/view/admin_status/wireless.htm index f70e3b26fc..006cee7011 100644 --- a/modules/admin-full/luasrc/view/admin_status/wireless.htm +++ b/modules/admin-full/luasrc/view/admin_status/wireless.htm @@ -179,7 +179,7 @@ $Id$ label_scale_2.innerHTML = String.format('<%:(%d minute window, %d second interval)%>', data_wanted / 60, 3); /* render datasets, start update interval */ - XHR.poll(3, '<%=build_url("admin/status/wireless_status", curdev)%>', null, + XHR.poll(3, '<%=build_url("admin/status/realtime/wireless_status", curdev)%>', null, function(x, data) { var noise_floor = 255; -- 2.30.2