diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-10-31 19:04:04 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-11-01 12:03:33 +0100 |
commit | 470464ae4a33e5efbfbd1a389f965567a86fa31e (patch) | |
tree | 875b47464c51e07d83fbb0c559e8a4c04845d4e3 /modules/luci-mod-system | |
parent | 22beb3f1df2f7876ebe6fed2ef5f4ce748b671c2 (diff) |
luci-mod-system: use declarative dependencies in controller
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-system')
-rw-r--r-- | modules/luci-mod-system/luasrc/controller/admin/system.lua | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/modules/luci-mod-system/luasrc/controller/admin/system.lua b/modules/luci-mod-system/luasrc/controller/admin/system.lua index 2913a23ef2..1e0bebb4f9 100644 --- a/modules/luci-mod-system/luasrc/controller/admin/system.lua +++ b/modules/luci-mod-system/luasrc/controller/admin/system.lua @@ -5,29 +5,25 @@ module("luci.controller.admin.system", package.seeall) function index() - local fs = require "nixio.fs" - entry({"admin", "system", "system"}, view("system/system"), _("System"), 1) entry({"admin", "system", "admin"}, firstchild(), _("Administration"), 2) entry({"admin", "system", "admin", "password"}, view("system/password"), _("Router Password"), 1) - if fs.access("/etc/config/dropbear") then - entry({"admin", "system", "admin", "dropbear"}, view("system/dropbear"), _("SSH Access"), 2) - entry({"admin", "system", "admin", "sshkeys"}, view("system/sshkeys"), _("SSH-Keys"), 3) - end + entry({"admin", "system", "admin", "dropbear"}, view("system/dropbear"), _("SSH Access"), 2) + .uci_depends = { dropbear = true } + + entry({"admin", "system", "admin", "sshkeys"}, view("system/sshkeys"), _("SSH-Keys"), 3) + .uci_depends = { dropbear = true } entry({"admin", "system", "startup"}, view("system/startup"), _("Startup"), 45) entry({"admin", "system", "crontab"}, view("system/crontab"), _("Scheduled Tasks"), 46) - if fs.access("/sbin/block") and fs.access("/etc/config/fstab") then - entry({"admin", "system", "mounts"}, view("system/mounts"), _("Mount Points"), 50) - end + entry({"admin", "system", "mounts"}, view("system/mounts"), _("Mount Points"), 50) + .file_depends = { "/sbin/block" } - local nodes, number = fs.glob("/sys/class/leds/*") - if number > 0 then - entry({"admin", "system", "leds"}, view("system/leds"), _("<abbr title=\"Light Emitting Diode\">LED</abbr> Configuration"), 60) - end + entry({"admin", "system", "leds"}, view("system/leds"), _("<abbr title=\"Light Emitting Diode\">LED</abbr> Configuration"), 60) + .file_depends = { "/sys/class/leds" } entry({"admin", "system", "flash"}, view("system/flash"), _("Backup / Flash Firmware"), 70) |