From: Jo-Philipp Wich Date: Tue, 10 Dec 2019 07:49:24 +0000 (+0100) Subject: luci-mod-status: convert menu nodes to JSON X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f3b7f4101f715f1dbf470476f98bd68181ed012c;p=project%2Fluci.git luci-mod-status: convert menu nodes to JSON Signed-off-by: Jo-Philipp Wich (backported from commit c698cd5ab9ad9021ac7b92a45d7ba401cb3617d0) --- diff --git a/modules/luci-mod-status/luasrc/controller/admin/status.lua b/modules/luci-mod-status/luasrc/controller/admin/status.lua deleted file mode 100644 index c78a83b787..0000000000 --- a/modules/luci-mod-status/luasrc/controller/admin/status.lua +++ /dev/null @@ -1,27 +0,0 @@ --- Copyright 2008 Steven Barth --- Copyright 2011 Jo-Philipp Wich --- Licensed to the public under the Apache License 2.0. - -module("luci.controller.admin.status", package.seeall) - -function index() - local page - - entry({"admin", "status", "overview"}, template("admin_status/index"), _("Overview"), 1) - - entry({"admin", "status", "iptables"}, view("status/iptables"), _("Firewall"), 2).leaf = true - - entry({"admin", "status", "routes"}, view("status/routes"), _("Routes"), 3) - entry({"admin", "status", "syslog"}, view("status/syslog"), _("System Log"), 4) - entry({"admin", "status", "dmesg"}, view("status/dmesg"), _("Kernel Log"), 5) - entry({"admin", "status", "processes"}, view("status/processes"), _("Processes"), 6) - - entry({"admin", "status", "realtime"}, alias("admin", "status", "realtime", "load"), _("Realtime Graphs"), 7) - - entry({"admin", "status", "realtime", "load"}, view("status/load"), _("Load"), 1) - entry({"admin", "status", "realtime", "bandwidth"}, view("status/bandwidth"), _("Traffic"), 2) - entry({"admin", "status", "realtime", "wireless"}, view("status/wireless"), _("Wireless"), 3).uci_depends = { wireless = true } - entry({"admin", "status", "realtime", "connections"}, view("status/connections"), _("Connections"), 4) - - entry({"admin", "status", "nameinfo"}, call("action_nameinfo")).leaf = true -end diff --git a/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json b/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json new file mode 100644 index 0000000000..0dcf6e8435 --- /dev/null +++ b/modules/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json @@ -0,0 +1,103 @@ +{ + "admin/status/overview": { + "title": "Overview", + "order": 1, + "action": { + "type": "template", + "path": "admin_status/index" + } + }, + + "admin/status/iptables": { + "title": "Firewall", + "order": 2, + "action": { + "type": "view", + "path": "status/iptables" + } + }, + + "admin/status/routes": { + "title": "Routes", + "order": 3, + "action": { + "type": "view", + "path": "status/routes" + } + }, + + "admin/status/syslog": { + "title": "System Log", + "order": 4, + "action": { + "type": "view", + "path": "status/syslog" + } + }, + + "admin/status/dmesg": { + "title": "Kernel Log", + "order": 5, + "action": { + "type": "view", + "path": "status/dmesg" + } + }, + + "admin/status/processes": { + "title": "Processes", + "order": 6, + "action": { + "type": "view", + "path": "status/processes" + } + }, + + "admin/status/realtime": { + "title": "Realtime Graphs", + "order": 7, + "action": { + "type": "alias", + "path": "admin/status/realtime/load" + } + }, + + "admin/status/realtime/load": { + "title": "Load", + "order": 1, + "action": { + "type": "view", + "path": "status/load" + } + }, + + "admin/status/realtime/bandwidth": { + "title": "Traffic", + "order": 2, + "action": { + "type": "view", + "path": "status/bandwidth" + } + }, + + "admin/status/realtime/wireless": { + "title": "Wireless", + "order": 3, + "action": { + "type": "view", + "path": "status/wireless" + }, + "depends": { + "uci": { "wireless": { "@wifi-device": true } } + } + }, + + "admin/status/realtime/connections": { + "title": "Connections", + "order": 4, + "action": { + "type": "view", + "path": "status/connections" + } + } +}