summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-status
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-10-31 18:49:23 +0100
committerJo-Philipp Wich <jo@mein.io>2019-11-01 12:03:33 +0100
commit22beb3f1df2f7876ebe6fed2ef5f4ce748b671c2 (patch)
tree4941daf00f2b6ac0d39d1e350a71ccee26a21d5d /modules/luci-mod-status
parent1ca168c2e9fba09e30b6800b4f0f9e537616d09f (diff)
luci-mod-status: use declarative dependencies in controller
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-status')
-rw-r--r--modules/luci-mod-status/luasrc/controller/admin/status.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/luci-mod-status/luasrc/controller/admin/status.lua b/modules/luci-mod-status/luasrc/controller/admin/status.lua
index 0d955c95f..d09cb6e2f 100644
--- a/modules/luci-mod-status/luasrc/controller/admin/status.lua
+++ b/modules/luci-mod-status/luasrc/controller/admin/status.lua
@@ -5,6 +5,8 @@
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"}, template("admin_status/iptables"), _("Firewall"), 2).leaf = true
@@ -24,10 +26,13 @@ function index()
entry({"admin", "status", "realtime", "bandwidth"}, template("admin_status/bandwidth"), _("Traffic"), 2).leaf = true
entry({"admin", "status", "realtime", "bandwidth_status"}, call("action_bandwidth")).leaf = true
- if nixio.fs.access("/etc/config/wireless") then
- entry({"admin", "status", "realtime", "wireless"}, template("admin_status/wireless"), _("Wireless"), 3).leaf = true
- entry({"admin", "status", "realtime", "wireless_status"}, call("action_wireless")).leaf = true
- end
+ page = entry({"admin", "status", "realtime", "wireless"}, template("admin_status/wireless"), _("Wireless"), 3)
+ page.uci_depends = { wireless = true }
+ page.leaf = true
+
+ page = entry({"admin", "status", "realtime", "wireless_status"}, call("action_wireless"))
+ page.uci_depends = { wireless = true }
+ page.leaf = true
entry({"admin", "status", "realtime", "connections"}, template("admin_status/connections"), _("Connections"), 4).leaf = true
entry({"admin", "status", "realtime", "connections_status"}, call("action_connections")).leaf = true