treewide: convert simple Lua controllers to declarative JSON
authorJo-Philipp Wich <jo@mein.io>
Wed, 5 Feb 2020 15:51:19 +0000 (16:51 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 5 Feb 2020 15:52:58 +0000 (16:52 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
89 files changed:
applications/luci-app-attendedsysupgrade/luasrc/controller/attendedsysupgrade.lua [deleted file]
applications/luci-app-attendedsysupgrade/root/usr/share/luci/menu.d/luci-app-attendedsysupgrade.json [new file with mode: 0644]
applications/luci-app-bcp38/luasrc/controller/bcp38.lua [deleted file]
applications/luci-app-bcp38/root/usr/share/luci/menu.d/luci-app-bcp38.json [new file with mode: 0644]
applications/luci-app-clamav/luasrc/controller/clamav.lua [deleted file]
applications/luci-app-clamav/root/usr/share/luci/menu.d/luci-app-clamav.json [new file with mode: 0644]
applications/luci-app-coovachilli/luasrc/controller/coovachilli.lua [deleted file]
applications/luci-app-coovachilli/root/usr/share/luci/menu.d/luci-app-coovachilli.json [new file with mode: 0644]
applications/luci-app-dcwapd/luasrc/controller/dcwapd.lua [deleted file]
applications/luci-app-dcwapd/root/usr/share/luci/menu.d/luci-app-dcwapd.json [new file with mode: 0644]
applications/luci-app-ddns/luasrc/controller/ddns.lua [deleted file]
applications/luci-app-ddns/root/usr/share/luci/menu.d/luci-app-ddns.json [new file with mode: 0644]
applications/luci-app-diag-core/luasrc/controller/luci_diag.lua [deleted file]
applications/luci-app-diag-core/root/usr/share/luci/menu.d/luci-app-diag-core.json [new file with mode: 0644]
applications/luci-app-dump1090/luasrc/controller/dump1090.lua [deleted file]
applications/luci-app-dump1090/root/usr/share/luci/menu.d/luci-app-dump1090.json [new file with mode: 0644]
applications/luci-app-dynapoint/luasrc/controller/dynapoint.lua [deleted file]
applications/luci-app-dynapoint/root/usr/share/luci/menu.d/luci-app-dynapoint.json [new file with mode: 0644]
applications/luci-app-fwknopd/luasrc/controller/fwknopd.lua [deleted file]
applications/luci-app-fwknopd/root/usr/share/luci/menu.d/luci-app-fwknopd.json [new file with mode: 0644]
applications/luci-app-hd-idle/luasrc/controller/hd_idle.lua [deleted file]
applications/luci-app-hd-idle/root/usr/share/luci/menu.d/luci-app-hd-idle.json [new file with mode: 0644]
applications/luci-app-ksmbd/luasrc/controller/ksmbd.lua [deleted file]
applications/luci-app-ksmbd/root/usr/share/luci/menu.d/luci-app-ksmbd.json [new file with mode: 0644]
applications/luci-app-mjpg-streamer/luasrc/controller/mjpg-streamer.lua [deleted file]
applications/luci-app-mjpg-streamer/root/usr/share/luci/menu.d/luci-app-mjpg-streamer.json [new file with mode: 0644]
applications/luci-app-mosquitto/luasrc/controller/mosquitto.lua [deleted file]
applications/luci-app-mosquitto/root/usr/share/luci/menu.d/luci-app-mosquitto.json [new file with mode: 0644]
applications/luci-app-nextdns/luasrc/controller/nextdns.lua [deleted file]
applications/luci-app-nextdns/root/usr/share/luci/menu.d/luci-app-nextdns.json [new file with mode: 0644]
applications/luci-app-noddos/luasrc/controller/noddos.lua [deleted file]
applications/luci-app-noddos/root/usr/share/luci/menu.d/luci-app-noddos.json [new file with mode: 0644]
applications/luci-app-ntpc/luasrc/controller/ntpc.lua [deleted file]
applications/luci-app-ntpc/root/usr/share/luci/menu.d/luci-app-ntpc.json [new file with mode: 0644]
applications/luci-app-nut/luasrc/controller/nut.lua [deleted file]
applications/luci-app-nut/root/usr/share/luci/menu.d/luci-app-nut.json [new file with mode: 0644]
applications/luci-app-olsr-viz/luasrc/controller/olsr-viz.lua [deleted file]
applications/luci-app-olsr-viz/root/usr/share/luci/menu.d/luci-app-olsr-viz.json [new file with mode: 0644]
applications/luci-app-omcproxy/luasrc/controller/omcproxy.lua [deleted file]
applications/luci-app-omcproxy/root/usr/share/luci/menu.d/luci-app-omcproxy.json [new file with mode: 0644]
applications/luci-app-p910nd/luasrc/controller/p910nd.lua [deleted file]
applications/luci-app-p910nd/root/usr/share/luci/menu.d/luci-app-p910nd.json [new file with mode: 0644]
applications/luci-app-pagekitec/luasrc/controller/pagekitec.lua [deleted file]
applications/luci-app-pagekitec/root/usr/share/luci/menu.d/luci-app-pagekitec.json [new file with mode: 0644]
applications/luci-app-polipo/luasrc/controller/polipo.lua [deleted file]
applications/luci-app-polipo/root/usr/share/luci/menu.d/luci-app-polipo.json [new file with mode: 0644]
applications/luci-app-qos/luasrc/controller/qos.lua [deleted file]
applications/luci-app-qos/root/usr/share/luci/menu.d/luci-app-qos.json [new file with mode: 0644]
applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua [deleted file]
applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json [new file with mode: 0644]
applications/luci-app-rp-pppoe-server/luasrc/controller/rp-pppoe-server.lua [deleted file]
applications/luci-app-rp-pppoe-server/root/usr/share/luci/menu.d/luci-app-rp-pppoe-server.json [new file with mode: 0644]
applications/luci-app-samba/luasrc/controller/samba.lua [deleted file]
applications/luci-app-samba/root/usr/share/luci/menu.d/luci-app-samba.json [new file with mode: 0644]
applications/luci-app-samba4/luasrc/controller/samba4.lua [deleted file]
applications/luci-app-samba4/root/usr/share/luci/menu.d/luci-app-samba4.json [new file with mode: 0644]
applications/luci-app-ser2net/luasrc/controller/ser2net.lua [deleted file]
applications/luci-app-ser2net/root/usr/share/luci/menu.d/luci-app-ser2net.json [new file with mode: 0644]
applications/luci-app-shadowsocks-libev/luasrc/controller/shadowsocks-libev.lua [deleted file]
applications/luci-app-shadowsocks-libev/root/usr/share/luci/menu.d/luci-app-shadowsocks-libev.json [new file with mode: 0644]
applications/luci-app-shairplay/luasrc/controller/shairplay.lua [deleted file]
applications/luci-app-shairplay/root/usr/share/luci/menu.d/luci-app-shairplay.json [new file with mode: 0644]
applications/luci-app-siitwizard/luasrc/controller/siitwizard.lua [deleted file]
applications/luci-app-siitwizard/root/usr/share/luci/menu.d/luci-app-siitwizard.json [new file with mode: 0644]
applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua [deleted file]
applications/luci-app-simple-adblock/root/usr/share/luci/menu.d/luci-app-simple-adblock.json [new file with mode: 0644]
applications/luci-app-snmpd/luasrc/controller/snmpd.lua [deleted file]
applications/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json [new file with mode: 0644]
applications/luci-app-squid/luasrc/controller/squid.lua [deleted file]
applications/luci-app-squid/root/usr/share/luci/menu.d/luci-app-squid.json [new file with mode: 0644]
applications/luci-app-tinyproxy/luasrc/controller/tinyproxy.lua [deleted file]
applications/luci-app-tinyproxy/root/usr/share/luci/menu.d/luci-app-tinyproxy.json [new file with mode: 0644]
applications/luci-app-transmission/root/usr/share/luci/menu.d/luci-app-transmission.json
applications/luci-app-ttyd/luasrc/controller/ttyd.lua [deleted file]
applications/luci-app-ttyd/root/usr/share/luci/menu.d/luci-app-ttyd.json [new file with mode: 0644]
applications/luci-app-udpxy/luasrc/controller/udpxy.lua [deleted file]
applications/luci-app-udpxy/root/usr/share/luci/menu.d/luci-app-udpxy.json [new file with mode: 0644]
applications/luci-app-uhttpd/luasrc/controller/uhttpd/uhttpd.lua [deleted file]
applications/luci-app-uhttpd/root/usr/share/luci/menu.d/luci-app-uhttpd.json [new file with mode: 0644]
applications/luci-app-upnp/luasrc/controller/upnp.lua [deleted file]
applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json [new file with mode: 0644]
applications/luci-app-vnstat/luasrc/controller/vnstat.lua [deleted file]
applications/luci-app-vnstat/root/usr/share/luci/menu.d/luci-app-vnstat.json [new file with mode: 0644]
applications/luci-app-watchcat/luasrc/controller/watchcat.lua [deleted file]
applications/luci-app-watchcat/root/usr/share/luci/menu.d/luci-app-watchcat.json [new file with mode: 0644]
applications/luci-app-wireguard/luasrc/controller/wireguard.lua [deleted file]
applications/luci-app-wireguard/root/usr/share/luci/menu.d/luci-app-wireguard.json [new file with mode: 0644]
applications/luci-app-yggdrasil/luasrc/controller/yggdrasil.lua [deleted file]
applications/luci-app-yggdrasil/root/usr/share/luci/menu.d/luci-app-yggdrasil.json [new file with mode: 0644]

diff --git a/applications/luci-app-attendedsysupgrade/luasrc/controller/attendedsysupgrade.lua b/applications/luci-app-attendedsysupgrade/luasrc/controller/attendedsysupgrade.lua
deleted file mode 100644 (file)
index 1bd050a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-module("luci.controller.attendedsysupgrade", package.seeall)
-
-function index()
-        entry({"admin", "system", "attended_sysupgrade"}, template("attendedsysupgrade"), _("Attended Sysupgrade"), 1)
-end
diff --git a/applications/luci-app-attendedsysupgrade/root/usr/share/luci/menu.d/luci-app-attendedsysupgrade.json b/applications/luci-app-attendedsysupgrade/root/usr/share/luci/menu.d/luci-app-attendedsysupgrade.json
new file mode 100644 (file)
index 0000000..2cb7cb9
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/system/attended_sysupgrade": {
+               "title": "Attended Sysupgrade",
+               "order": 1,
+               "action": {
+                       "type": "template",
+                       "path": "attendedsysupgrade"
+               }
+       }
+}
diff --git a/applications/luci-app-bcp38/luasrc/controller/bcp38.lua b/applications/luci-app-bcp38/luasrc/controller/bcp38.lua
deleted file mode 100644 (file)
index 7ea2283..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-module("luci.controller.bcp38", package.seeall)
-
-function index()
-       entry({"admin", "network", "firewall", "bcp38"},
-               cbi("bcp38"),
-               _("BCP38"), 50).dependent = false
-end
diff --git a/applications/luci-app-bcp38/root/usr/share/luci/menu.d/luci-app-bcp38.json b/applications/luci-app-bcp38/root/usr/share/luci/menu.d/luci-app-bcp38.json
new file mode 100644 (file)
index 0000000..f85d69d
--- /dev/null
@@ -0,0 +1,11 @@
+{
+       "admin/network/firewall/bcp38": {
+               "title": "BCP38",
+               "order": 50,
+               "action": {
+                       "type": "cbi",
+                       "path": "bcp38",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-clamav/luasrc/controller/clamav.lua b/applications/luci-app-clamav/luasrc/controller/clamav.lua
deleted file mode 100644 (file)
index 02f3bfc..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---[[
-
-LuCI ClamAV module
-
-Copyright (C) 2015, Itus Networks, Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Marko Ratkaj <marko.ratkaj@sartura.hr>
-       Luka Perkov <luka.perkov@sartura.hr>
-
-]]--
-
-module("luci.controller.clamav", package.seeall)
-
-function index()
-       entry({"admin", "services", "clamav"}, cbi("clamav"), _("ClamAV"))
-end
diff --git a/applications/luci-app-clamav/root/usr/share/luci/menu.d/luci-app-clamav.json b/applications/luci-app-clamav/root/usr/share/luci/menu.d/luci-app-clamav.json
new file mode 100644 (file)
index 0000000..351701a
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/services/clamav": {
+               "title": "ClamAV",
+               "action": {
+                       "type": "cbi",
+                       "path": "clamav",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-coovachilli/luasrc/controller/coovachilli.lua b/applications/luci-app-coovachilli/luasrc/controller/coovachilli.lua
deleted file mode 100644 (file)
index f962b9b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.coovachilli", package.seeall)
-
-function index()
-       local cc
-
-       cc = entry( { "admin", "services", "coovachilli" },       cbi("coovachilli"),         _("CoovaChilli"),                90)
-       cc.subindex = true
-
-       entry( { "admin", "services", "coovachilli", "network" }, cbi("coovachilli_network"), _("Network Configuration"),      10)
-       entry( { "admin", "services", "coovachilli", "radius"  }, cbi("coovachilli_radius"),  _("RADIUS configuration"),       20)
-       entry( { "admin", "services", "coovachilli", "auth"    }, cbi("coovachilli_auth"),    _("UAM and MAC Authentication"), 30)
-end
diff --git a/applications/luci-app-coovachilli/root/usr/share/luci/menu.d/luci-app-coovachilli.json b/applications/luci-app-coovachilli/root/usr/share/luci/menu.d/luci-app-coovachilli.json
new file mode 100644 (file)
index 0000000..d7da7ca
--- /dev/null
@@ -0,0 +1,41 @@
+{
+       "admin/services/coovachilli": {
+               "title": "CoovaChilli",
+               "order": 90,
+               "action": {
+                       "type": "cbi",
+                       "path": "coovachilli",
+                       "post": { "cbi.submit": true }
+               }
+       },
+
+       "admin/services/coovachilli/network": {
+               "title": "Network Configuration",
+               "order": 1,
+               "action": {
+                       "type": "cbi",
+                       "path": "coovachilli_network",
+                       "post": { "cbi.submit": true }
+               }
+       },
+
+       "admin/services/coovachilli/radius": {
+               "title": "RADIUS configuration",
+               "order": 2,
+               "action": {
+                       "type": "cbi",
+                       "path": "coovachilli_radius",
+                       "post": { "cbi.submit": true }
+               }
+       },
+
+       "admin/services/coovachilli/auth": {
+               "title": "UAM and MAC Authentication",
+               "order": 3,
+               "action": {
+                       "type": "cbi",
+                       "path": "coovachilli_auth",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-dcwapd/luasrc/controller/dcwapd.lua b/applications/luci-app-dcwapd/luasrc/controller/dcwapd.lua
deleted file mode 100644 (file)
index f13c422..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
--- Copyright 2019 EWSI
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.dcwapd", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/dcwapd") then
-               return
-       end
-       local page
-       page = entry({"admin", "network", "dcwapd"}, cbi("dcwapd/dcwapd"), _("Dual Channel WiFi"))
-       page.dependent = true
-end
diff --git a/applications/luci-app-dcwapd/root/usr/share/luci/menu.d/luci-app-dcwapd.json b/applications/luci-app-dcwapd/root/usr/share/luci/menu.d/luci-app-dcwapd.json
new file mode 100644 (file)
index 0000000..30ed4c5
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/network/dcwapd": {
+               "title": "Dual Channel WiFi",
+               "action": {
+                       "type": "cbi",
+                       "path": "dcwapd/dcwapd",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "dcwapd": true }
+               }
+       }
+}
diff --git a/applications/luci-app-ddns/luasrc/controller/ddns.lua b/applications/luci-app-ddns/luasrc/controller/ddns.lua
deleted file mode 100755 (executable)
index 247edef..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
--- Copyright 2013 Manuel Munz <freifunk at somakoma dot de>
--- Copyright 2014-2018 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.ddns", package.seeall)
-
-function index()
-       entry( {"admin", "services", "ddns"}, view("ddns/overview"), _("Dynamic DNS"), 59)
-end
diff --git a/applications/luci-app-ddns/root/usr/share/luci/menu.d/luci-app-ddns.json b/applications/luci-app-ddns/root/usr/share/luci/menu.d/luci-app-ddns.json
new file mode 100644 (file)
index 0000000..ec6d46f
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/services/ddns": {
+               "title": "Dynamic DNS",
+               "order": 59,
+               "action": {
+                       "type": "view",
+                       "path": "ddns/overview"
+               }
+       }
+}
diff --git a/applications/luci-app-diag-core/luasrc/controller/luci_diag.lua b/applications/luci-app-diag-core/luasrc/controller/luci_diag.lua
deleted file mode 100644 (file)
index b662d7f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
--- Copyright 2009 Daniel Dickinson
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.luci_diag", package.seeall)
-
-function index()
-       local e
-
-       e = entry({"admin", "network", "diag_config"}, template("diag/network_config_index") , _("Configure Diagnostics"), 120)
-       e.index = true
-       e.dependent = true
-
-       e = entry({"mini", "diag"}, template("diag/index"), _("Diagnostics"), 120)
-       e.index = true
-       e.dependent = true
-end
diff --git a/applications/luci-app-diag-core/root/usr/share/luci/menu.d/luci-app-diag-core.json b/applications/luci-app-diag-core/root/usr/share/luci/menu.d/luci-app-diag-core.json
new file mode 100644 (file)
index 0000000..2fe2a26
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/network/diag_config": {
+               "title": "Configure Diagnostics",
+               "order": 120,
+               "action": {
+                       "type": "template",
+                       "path": "diag/network_config_index"
+               }
+       }
+}
diff --git a/applications/luci-app-dump1090/luasrc/controller/dump1090.lua b/applications/luci-app-dump1090/luasrc/controller/dump1090.lua
deleted file mode 100644 (file)
index bc2b36d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
--- Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.dump1090", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/dump1090") then
-               return
-       end
-
-       local page = entry({"admin", "services", "dump1090"}, cbi("dump1090"), _("dump1090"))
-       page.dependent = true
-
-end
diff --git a/applications/luci-app-dump1090/root/usr/share/luci/menu.d/luci-app-dump1090.json b/applications/luci-app-dump1090/root/usr/share/luci/menu.d/luci-app-dump1090.json
new file mode 100644 (file)
index 0000000..4e68dde
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/dump1090": {
+               "title": "dump1090",
+               "action": {
+                       "type": "cbi",
+                       "path": "dump1090",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "dump1090": true }
+               }
+       }
+}
diff --git a/applications/luci-app-dynapoint/luasrc/controller/dynapoint.lua b/applications/luci-app-dynapoint/luasrc/controller/dynapoint.lua
deleted file mode 100644 (file)
index 6534863..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-module("luci.controller.dynapoint", package.seeall)
-
-function index()
-   if not nixio.fs.access("/etc/config/dynapoint") then
-      return
-   end
-   entry({"admin", "services", "dynapoint"}, cbi("dynapoint"), _("DynaPoint"))
-end
-
diff --git a/applications/luci-app-dynapoint/root/usr/share/luci/menu.d/luci-app-dynapoint.json b/applications/luci-app-dynapoint/root/usr/share/luci/menu.d/luci-app-dynapoint.json
new file mode 100644 (file)
index 0000000..ed19ba6
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/dynapoint": {
+               "title": "DynaPoint",
+               "action": {
+                       "type": "cbi",
+                       "path": "dynapoint",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "dynapoint": true }
+               }
+       }
+}
diff --git a/applications/luci-app-fwknopd/luasrc/controller/fwknopd.lua b/applications/luci-app-fwknopd/luasrc/controller/fwknopd.lua
deleted file mode 100644 (file)
index 069a77e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
--- Copyright 2015 Jonathan Bennett <jbennett@incomsystems.biz>
--- Licensed to the public under the GNU General Public License v2.
-
-module("luci.controller.fwknopd", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/fwknopd") then
-               return
-       end
-
-       local page
-
-       page = entry({"admin", "services", "fwknopd"}, cbi("fwknopd"), _("Firewall Knock Daemon"))
-       page.dependent = true
-end
diff --git a/applications/luci-app-fwknopd/root/usr/share/luci/menu.d/luci-app-fwknopd.json b/applications/luci-app-fwknopd/root/usr/share/luci/menu.d/luci-app-fwknopd.json
new file mode 100644 (file)
index 0000000..6dd26b9
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/fwknopd": {
+               "title": "Firewall Knock Daemon",
+               "action": {
+                       "type": "cbi",
+                       "path": "fwknopd",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "fwknopd": true }
+               }
+       }
+}
diff --git a/applications/luci-app-hd-idle/luasrc/controller/hd_idle.lua b/applications/luci-app-hd-idle/luasrc/controller/hd_idle.lua
deleted file mode 100644 (file)
index 9a981ac..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
--- Copyright 2008 Yanira <forum-2008@email.de>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.hd_idle", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/hd-idle") then
-               return
-       end
-
-       local page
-
-       page = entry({"admin", "services", "hd_idle"}, cbi("hd_idle"), _("HDD Idle"), 60)
-       page.dependent = true
-end
diff --git a/applications/luci-app-hd-idle/root/usr/share/luci/menu.d/luci-app-hd-idle.json b/applications/luci-app-hd-idle/root/usr/share/luci/menu.d/luci-app-hd-idle.json
new file mode 100644 (file)
index 0000000..5e6961f
--- /dev/null
@@ -0,0 +1,14 @@
+{
+       "admin/services/hd_idle": {
+               "title": "HDD Idle",
+               "order": 60,
+               "action": {
+                       "type": "cbi",
+                       "path": "hd_idle",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "hd_idle": true }
+               }
+       }
+}
diff --git a/applications/luci-app-ksmbd/luasrc/controller/ksmbd.lua b/applications/luci-app-ksmbd/luasrc/controller/ksmbd.lua
deleted file mode 100644 (file)
index a3301d4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.ksmbd", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/ksmbd") then
-               return
-       end
-
-       entry({"admin", "services", "ksmbd"}, view("ksmbd"), _("Network Shares")).dependent = true
-end
diff --git a/applications/luci-app-ksmbd/root/usr/share/luci/menu.d/luci-app-ksmbd.json b/applications/luci-app-ksmbd/root/usr/share/luci/menu.d/luci-app-ksmbd.json
new file mode 100644 (file)
index 0000000..46202c2
--- /dev/null
@@ -0,0 +1,12 @@
+{
+       "admin/services/ksmbd": {
+               "title": "Network Shares",
+               "action": {
+                       "type": "view",
+                       "path": "ksmbd"
+               },
+               "depends": {
+                       "uci": { "ksmbd": true }
+               }
+       }
+}
diff --git a/applications/luci-app-mjpg-streamer/luasrc/controller/mjpg-streamer.lua b/applications/luci-app-mjpg-streamer/luasrc/controller/mjpg-streamer.lua
deleted file mode 100644 (file)
index c5cf6ec..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
--- Copyright 2014 Roger D <rogerdammit@gmail.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.mjpg-streamer", package.seeall)
-
-function index()
-       require("luci.i18n")
-       if not nixio.fs.access("/etc/config/mjpg-streamer") then
-               return
-       end
-
-       local page = entry({"admin", "services", "mjpg-streamer"}, cbi("mjpg-streamer"), _("MJPG-streamer"))
-       page.i18n = "mjpg-streamer"
-       page.dependent = true
-
-end
diff --git a/applications/luci-app-mjpg-streamer/root/usr/share/luci/menu.d/luci-app-mjpg-streamer.json b/applications/luci-app-mjpg-streamer/root/usr/share/luci/menu.d/luci-app-mjpg-streamer.json
new file mode 100644 (file)
index 0000000..1e7c5e8
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/mjpg-streamer": {
+               "title": "MJPG-streamer",
+               "action": {
+                       "type": "cbi",
+                       "path": "mjpg-streamer",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "mjpg-streamer": true }
+               }
+       }
+}
diff --git a/applications/luci-app-mosquitto/luasrc/controller/mosquitto.lua b/applications/luci-app-mosquitto/luasrc/controller/mosquitto.lua
deleted file mode 100644 (file)
index 587054e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
---[[
-LuCI - Lua Configuration Interface for mosquitto
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-]]--
-
-module("luci.controller.mosquitto", package.seeall)
-
-function index()
-    entry({"admin", "services", "mosquitto"}, cbi("mosquitto"), _("Mosquitto"))
-end
diff --git a/applications/luci-app-mosquitto/root/usr/share/luci/menu.d/luci-app-mosquitto.json b/applications/luci-app-mosquitto/root/usr/share/luci/menu.d/luci-app-mosquitto.json
new file mode 100644 (file)
index 0000000..37870b3
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/services/mosquitto": {
+               "title": "Mosquitto",
+               "action": {
+                       "type": "cbi",
+                       "path": "mosquitto",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-nextdns/luasrc/controller/nextdns.lua b/applications/luci-app-nextdns/luasrc/controller/nextdns.lua
deleted file mode 100644 (file)
index bfa4887..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
--- Copyright 2019 Olivier Poitrey (rs@nextdns.io)
--- This is free software, licensed under the Apache License, Version 2.0
-
-module("luci.controller.nextdns", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/nextdns") then
-               return
-       end
-
-       entry({"admin", "services", "nextdns"}, firstchild(), _("NextDNS"), 60).dependent = false
-       entry({"admin", "services", "nextdns", "overview"}, view("nextdns/overview"), _("Overview"), 10).leaf = true
-       entry({"admin", "services", "nextdns", "log"}, view("nextdns/logread"), _("Logs"), 30).leaf = true
-end
diff --git a/applications/luci-app-nextdns/root/usr/share/luci/menu.d/luci-app-nextdns.json b/applications/luci-app-nextdns/root/usr/share/luci/menu.d/luci-app-nextdns.json
new file mode 100644 (file)
index 0000000..18255ce
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "admin/services/nextdns": {
+               "title": "NextDNS",
+               "order": 60,
+               "action": {
+                       "type": "firstchild"
+               },
+               "depends": {
+                       "uci": { "nextdns": true }
+               }
+       },
+
+       "admin/services/nextdns/overview": {
+               "title": "Overview",
+               "order": 1,
+               "action": {
+                       "type": "view",
+                       "path": "nextdns/overview"
+               }
+       },
+
+       "admin/services/nextdns/log": {
+               "title": "Configuration",
+               "order": 2,
+               "action": {
+                       "type": "view",
+                       "path": "nextdns/logread"
+               }
+       }
+}
diff --git a/applications/luci-app-noddos/luasrc/controller/noddos.lua b/applications/luci-app-noddos/luasrc/controller/noddos.lua
deleted file mode 100644 (file)
index c45e24b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
--- Copyright 2017 Steven Hessing (steven.hessing@gmail.com)
--- This is free software, licensed under the GNU General Public License v3.
--- /usr/lib/lua/luci/controller/noddos.lua
-
-module("luci.controller.noddos", package.seeall)
-function index()
-    entry({"admin", "status", "noddos"}, template("noddos/clients"), _("Noddos Clients"), 3)
-    entry({"admin", "network", "noddos"}, cbi("noddos"), _("Noddos Client Tracking"), 55)
-end
-
diff --git a/applications/luci-app-noddos/root/usr/share/luci/menu.d/luci-app-noddos.json b/applications/luci-app-noddos/root/usr/share/luci/menu.d/luci-app-noddos.json
new file mode 100644 (file)
index 0000000..05052f5
--- /dev/null
@@ -0,0 +1,20 @@
+{
+       "admin/status/noddos": {
+               "title": "Noddos Clients",
+               "order": 3,
+               "action": {
+                       "type": "template",
+                       "path": "noddos/clients"
+               }
+       },
+
+       "admin/network/noddos": {
+               "title": "Noddos Client Tracking",
+               "order": 55,
+               "action": {
+                       "type": "cbi",
+                       "path": "noddos",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-ntpc/luasrc/controller/ntpc.lua b/applications/luci-app-ntpc/luasrc/controller/ntpc.lua
deleted file mode 100644 (file)
index c21d4ea..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.ntpc", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/ntpclient") then
-               return
-       end
-       
-       local page
-
-       page = entry({"admin", "system", "ntpc"}, cbi("ntpc/ntpc"), _("Time Synchronisation"), 50)
-       page.dependent = true
-
-       page = entry({"mini", "system", "ntpc"}, cbi("ntpc/ntpcmini", {autoapply=true}), _("Time Synchronisation"), 50)
-       page.dependent = true
-end
diff --git a/applications/luci-app-ntpc/root/usr/share/luci/menu.d/luci-app-ntpc.json b/applications/luci-app-ntpc/root/usr/share/luci/menu.d/luci-app-ntpc.json
new file mode 100644 (file)
index 0000000..360d721
--- /dev/null
@@ -0,0 +1,14 @@
+{
+       "admin/system/ntpc": {
+               "title": "Time Synchronisation",
+               "order": 50,
+               "action": {
+                       "type": "cbi",
+                       "path": "ntpc/ntpc",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "ntpclient": true }
+               }
+       }
+}
diff --git a/applications/luci-app-nut/luasrc/controller/nut.lua b/applications/luci-app-nut/luasrc/controller/nut.lua
deleted file mode 100644 (file)
index 5598451..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
--- Copyright 2015 Daniel Dickinson <openwrt@daniel.thecshore.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.nut", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/nut_server") and not nixio.fs.access("/etc/config/nut_monitor") and not nixio.fs.access("/etc/config/nut_cgi") then
-               return
-       end
-
-       entry({"admin", "services", "nut"}, firstchild(), _("Network UPS Tools"))
-
-       if nixio.fs.access("/etc/config/nut_server") then
-               entry({"admin", "services", "nut", "server"}, cbi("nut_server"), _("Network UPS Tools (Server)"), 20)
-       end
-
-       if nixio.fs.access("/etc/config/nut_monitor") then
-               entry({"admin", "services", "nut", "monitor"}, cbi("nut_monitor"), _("Network UPS Tools (Monitor)"), 30)
-       end
-
-       if nixio.fs.access("/etc/config/nut_cgi") then
-               entry({"admin", "services", "nut", "cgi"}, cbi("nut_cgi"), _("Network UPS Tools (CGI)"), 40)
-       end
-end
-
diff --git a/applications/luci-app-nut/root/usr/share/luci/menu.d/luci-app-nut.json b/applications/luci-app-nut/root/usr/share/luci/menu.d/luci-app-nut.json
new file mode 100644 (file)
index 0000000..f2cd6e7
--- /dev/null
@@ -0,0 +1,54 @@
+{
+       "admin/services/nut": {
+               "title": "Network UPS Tools",
+               "action": {
+                       "type": "firstchild"
+               },
+               "depends": {
+                       "uci": [
+                               { "nut_server": true },
+                               { "nut_monitor": true },
+                               { "nut_cgi": true }
+                       ]
+               }
+       },
+
+       "admin/services/nut/server": {
+               "title": "Network UPS Tools (Server)",
+               "order": 1,
+               "action": {
+                       "type": "cbi",
+                       "path": "nut_server",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "nut_server": true }
+               }
+       },
+
+       "admin/services/nut/monitor": {
+               "title": "Network UPS Tools (Monitor)",
+               "order": 2,
+               "action": {
+                       "type": "cbi",
+                       "path": "nut_monitor",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "nut_monitor": true }
+               }
+       },
+
+       "admin/services/nut/cgi": {
+               "title": "Network UPS Tools (CGI)",
+               "order": 3,
+               "action": {
+                       "type": "cbi",
+                       "path": "nut_cgi",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "nut_cgi": true }
+               }
+       }
+}
diff --git a/applications/luci-app-olsr-viz/luasrc/controller/olsr-viz.lua b/applications/luci-app-olsr-viz/luasrc/controller/olsr-viz.lua
deleted file mode 100644 (file)
index 672486c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-module "luci.controller.olsr-viz"
-
-function index()
-       entry({"admin", "status", "olsr", "olsr-viz"}, template("olsr-viz/olsr-viz"), _("OLSR-Viz"), 90)
-end
diff --git a/applications/luci-app-olsr-viz/root/usr/share/luci/menu.d/luci-app-olsr-viz.json b/applications/luci-app-olsr-viz/root/usr/share/luci/menu.d/luci-app-olsr-viz.json
new file mode 100644 (file)
index 0000000..02cfd6b
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/status/olsr/olsr-viz": {
+               "title": "OLSR-Viz",
+               "order": 90,
+               "action": {
+                       "type": "template",
+                       "path": "olsr-viz/olsr-viz"
+               }
+       }
+}
diff --git a/applications/luci-app-omcproxy/luasrc/controller/omcproxy.lua b/applications/luci-app-omcproxy/luasrc/controller/omcproxy.lua
deleted file mode 100644 (file)
index 6842a20..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
--- Copyright 2019 Shun Li <riverscn@gmail.com>
--- This is free software, licensed under the Apache License, Version 2.0
-
-module("luci.controller.omcproxy", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/omcproxy") then
-               return
-       end
-
-       entry({"admin", "services", "omcproxy"}, view("omcproxy"), _("omcproxy")).dependent = true
-
-end
\ No newline at end of file
diff --git a/applications/luci-app-omcproxy/root/usr/share/luci/menu.d/luci-app-omcproxy.json b/applications/luci-app-omcproxy/root/usr/share/luci/menu.d/luci-app-omcproxy.json
new file mode 100644 (file)
index 0000000..1eb7aaa
--- /dev/null
@@ -0,0 +1,12 @@
+{
+       "admin/services/omcproxy": {
+               "title": "omcproxy",
+               "action": {
+                       "type": "view",
+                       "path": "omcproxy"
+               },
+               "depends": {
+                       "uci": { "omcproxy": true }
+               }
+       }
+}
diff --git a/applications/luci-app-p910nd/luasrc/controller/p910nd.lua b/applications/luci-app-p910nd/luasrc/controller/p910nd.lua
deleted file mode 100644 (file)
index df47e9f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
--- Copyright 2008 Yanira <forum-2008@email.de>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.p910nd", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/p910nd") then
-               return
-       end
-
-       local page
-
-       page = entry({"admin", "services", "p910nd"}, cbi("p910nd"), _("p910nd - Printer server"), 60)
-       page.dependent = true
-end
diff --git a/applications/luci-app-p910nd/root/usr/share/luci/menu.d/luci-app-p910nd.json b/applications/luci-app-p910nd/root/usr/share/luci/menu.d/luci-app-p910nd.json
new file mode 100644 (file)
index 0000000..33fcda6
--- /dev/null
@@ -0,0 +1,14 @@
+{
+       "admin/services/p910nd": {
+               "title": "p910nd - Printer server",
+               "order": 60,
+               "action": {
+                       "type": "cbi",
+                       "path": "p910nd",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "p910nd": true }
+               }
+       }
+}
diff --git a/applications/luci-app-pagekitec/luasrc/controller/pagekitec.lua b/applications/luci-app-pagekitec/luasrc/controller/pagekitec.lua
deleted file mode 100644 (file)
index 938356b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
--- Copyright 2018 Karl Palsson <karlp@tweak.net.au>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.pagekitec", package.seeall)
-
-function index()
-    entry({"admin", "services", "pagekitec"}, cbi("pagekitec"), _("PageKite"))
-end
diff --git a/applications/luci-app-pagekitec/root/usr/share/luci/menu.d/luci-app-pagekitec.json b/applications/luci-app-pagekitec/root/usr/share/luci/menu.d/luci-app-pagekitec.json
new file mode 100644 (file)
index 0000000..54af904
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/services/pagekitec": {
+               "title": "PageKite",
+               "action": {
+                       "type": "cbi",
+                       "path": "pagekitec",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-polipo/luasrc/controller/polipo.lua b/applications/luci-app-polipo/luasrc/controller/polipo.lua
deleted file mode 100644 (file)
index b3ae389..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
--- Copyright 2008 Aleksandar Krsteski <alekrsteski@gmail.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.polipo", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/polipo") then
-               return
-       end
-
-       entry({"admin", "services", "polipo"}, alias("admin", "services", "polipo", "config"), _("Polipo"))
-       entry({"admin", "services", "polipo", "status"}, template("polipo_status"), _("Status"))
-       entry({"admin", "services", "polipo", "config"}, cbi("polipo"), _("Configuration"))
-end
-
diff --git a/applications/luci-app-polipo/root/usr/share/luci/menu.d/luci-app-polipo.json b/applications/luci-app-polipo/root/usr/share/luci/menu.d/luci-app-polipo.json
new file mode 100644 (file)
index 0000000..6fea92d
--- /dev/null
@@ -0,0 +1,31 @@
+{
+       "admin/services/polipo": {
+               "title": "Polipo",
+               "action": {
+                       "type": "alias",
+                       "path": "admin/services/polipo/config"
+               },
+               "depends": {
+                       "uci": { "polipo": true }
+               }
+       },
+
+       "admin/services/polipo/status": {
+               "title": "Status",
+               "order": 1,
+               "action": {
+                       "type": "template",
+                       "path": "polipo_status"
+               }
+       },
+
+       "admin/services/polipo/config": {
+               "title": "Configuration",
+               "order": 2,
+               "action": {
+                       "type": "cbi",
+                       "path": "polipo",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-qos/luasrc/controller/qos.lua b/applications/luci-app-qos/luasrc/controller/qos.lua
deleted file mode 100644 (file)
index 250a039..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.qos", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/qos") then
-               return
-       end
-       
-       local page
-
-       page = entry({"admin", "network", "qos"}, cbi("qos/qos"), _("QoS"))
-       page.dependent = true
-end
diff --git a/applications/luci-app-qos/root/usr/share/luci/menu.d/luci-app-qos.json b/applications/luci-app-qos/root/usr/share/luci/menu.d/luci-app-qos.json
new file mode 100644 (file)
index 0000000..90ce20d
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/network/qos": {
+               "title": "QoS",
+               "action": {
+                       "type": "cbi",
+                       "path": "qos/qos",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "qos": true }
+               }
+       }
+}
diff --git a/applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua b/applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua
deleted file mode 100644 (file)
index dd5598a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
--- Copyright 2018 Rosy Song <rosysong@rosinson.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.rosy-file-server.rosy-file-server", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/rosyfs") then
-               return
-       end
-
-       local root = node()
-       if not root.target then
-               root.target = alias("httpfs")
-               root.index = true
-       end
-
-       page          = node()
-       page.lock     = true
-       page.target   = alias("httpfs")
-       page.subindex = true
-       page.index    = false
-
-       page          = node("httpfs")
-       page.title    = _("Rosy File Server")
-       page.target   = alias("httpfs", "rosy-file-server")
-       page.order    = 5
-       page.setuser  = "root"
-       page.setgroup = "root"
-       page.index    = true
-
-       entry({"httpfs", "rosy-file-server"},
-               form("rosy-file-server/rosy-file-server"), _("Rosy File Server"), 10)
-
-       entry({"admin", "services", "rosyfs"},
-               cbi("rosy-file-server/rosyfs"), _("Rosy File Server"), 61)
-end
-
diff --git a/applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json b/applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json
new file mode 100644 (file)
index 0000000..03e7fd0
--- /dev/null
@@ -0,0 +1,34 @@
+{
+       "httpfs": {
+               "title": "Rosy File Server",
+               "order": 5,
+               "setuser": "root",
+               "setgroup": "root",
+               "action": {
+                       "type": "firstchild"
+               },
+               "depends": {
+                       "uci": { "rosyfs": true }
+               }
+       },
+
+       "httpfs/rosy-file-server": {
+               "title": "Rosy File Server",
+               "order": 1,
+               "action": {
+                       "type": "form",
+                       "path": "rosy-file-server/rosy-file-server",
+                       "post": { "cbi.submit": true }
+               }
+       },
+
+       "admin/services/rosyfs": {
+               "title": "Rosy File Server",
+               "order": 61,
+               "action": {
+                       "type": "cbi",
+                       "path": "rosy-file-server/rosyfs",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-rp-pppoe-server/luasrc/controller/rp-pppoe-server.lua b/applications/luci-app-rp-pppoe-server/luasrc/controller/rp-pppoe-server.lua
deleted file mode 100644 (file)
index 105a80e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
--- Copyright 2015 Daniel Dickinson <openwrt@daniel.thecshore.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.rp-pppoe-server", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/pppoe") then
-               return
-       end
-
-       entry({"admin", "services", "rp-pppoe-server"}, cbi("rp-pppoe-server"), _("RP PPPoE Server"))
-end
-
diff --git a/applications/luci-app-rp-pppoe-server/root/usr/share/luci/menu.d/luci-app-rp-pppoe-server.json b/applications/luci-app-rp-pppoe-server/root/usr/share/luci/menu.d/luci-app-rp-pppoe-server.json
new file mode 100644 (file)
index 0000000..2d96428
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/rp-pppoe-server": {
+               "title": "RP PPPoE Server",
+               "action": {
+                       "type": "cbi",
+                       "path": "rp-pppoe-server",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "pppoe": true }
+               }
+       }
+}
diff --git a/applications/luci-app-samba/luasrc/controller/samba.lua b/applications/luci-app-samba/luasrc/controller/samba.lua
deleted file mode 100644 (file)
index 397af6a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.samba", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/samba") then
-               return
-       end
-
-       local page
-
-       page = entry({"admin", "services", "samba"}, cbi("samba"), _("Network Shares"))
-       page.dependent = true
-end
diff --git a/applications/luci-app-samba/root/usr/share/luci/menu.d/luci-app-samba.json b/applications/luci-app-samba/root/usr/share/luci/menu.d/luci-app-samba.json
new file mode 100644 (file)
index 0000000..27affd4
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/samba": {
+               "title": "Network Shares",
+               "action": {
+                       "type": "cbi",
+                       "path": "samba",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "samba": true }
+               }
+       }
+}
diff --git a/applications/luci-app-samba4/luasrc/controller/samba4.lua b/applications/luci-app-samba4/luasrc/controller/samba4.lua
deleted file mode 100644 (file)
index 03c5355..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.samba4", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/samba4") then
-               return
-       end
-
-       entry({"admin", "services", "samba4"}, view("samba4"), _("Network Shares")).dependent = true
-end
diff --git a/applications/luci-app-samba4/root/usr/share/luci/menu.d/luci-app-samba4.json b/applications/luci-app-samba4/root/usr/share/luci/menu.d/luci-app-samba4.json
new file mode 100644 (file)
index 0000000..74be4ed
--- /dev/null
@@ -0,0 +1,12 @@
+{
+       "admin/services/samba4": {
+               "title": "Network Shares",
+               "action": {
+                       "type": "view",
+                       "path": "samba4"
+               },
+               "depends": {
+                       "uci": { "samba4": true }
+               }
+       }
+}
diff --git a/applications/luci-app-ser2net/luasrc/controller/ser2net.lua b/applications/luci-app-ser2net/luasrc/controller/ser2net.lua
deleted file mode 100644 (file)
index e29478a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-module("luci.controller.ser2net", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/ser2net") then
-               return
-       end
-
-       entry({"admin", "services", "ser2net"}, firstchild(), "ser2net").dependent = true
-       entry({"admin", "services", "ser2net", "settings"}, view("ser2net/settings"), _("Settings"), 1).leaf = false
-       entry({"admin", "services", "ser2net", "proxies"}, view("ser2net/proxies"), _("Proxies"), 2).leaf = false
-       entry({"admin", "services", "ser2net", "leds"}, view("ser2net/leds"), _("LEDs"), 3).leaf = false
-end
diff --git a/applications/luci-app-ser2net/root/usr/share/luci/menu.d/luci-app-ser2net.json b/applications/luci-app-ser2net/root/usr/share/luci/menu.d/luci-app-ser2net.json
new file mode 100644 (file)
index 0000000..e05a30b
--- /dev/null
@@ -0,0 +1,38 @@
+{
+       "admin/services/ser2net": {
+               "title": "ser2net",
+               "action": {
+                       "type": "firstchild"
+               },
+               "depends": {
+                       "uci": { "ser2net": true }
+               }
+       },
+
+       "admin/services/ser2net/settings": {
+               "title": "Settings",
+               "order": 1,
+               "action": {
+                       "type": "view",
+                       "path": "ser2net/settings"
+               }
+       },
+
+       "admin/services/ser2net/proxies": {
+               "title": "Proxies",
+               "order": 2,
+               "action": {
+                       "type": "view",
+                       "path": "ser2net/proxies"
+               }
+       },
+
+       "admin/services/ser2net/leds": {
+               "title": "LEDs",
+               "order": 3,
+               "action": {
+                       "type": "view",
+                       "path": "ser2net/leds"
+               }
+       }
+}
diff --git a/applications/luci-app-shadowsocks-libev/luasrc/controller/shadowsocks-libev.lua b/applications/luci-app-shadowsocks-libev/luasrc/controller/shadowsocks-libev.lua
deleted file mode 100644 (file)
index c8a9d66..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
--- Copyright 2017 Yousong Zhou <yszhou4tech@gmail.com>
--- Licensed to the public under the Apache License 2.0.
---
-module("luci.controller.shadowsocks-libev", package.seeall)
-
-function index()
-       entry({"admin", "services", "shadowsocks-libev"},
-               alias("admin", "services", "shadowsocks-libev", "instances"),
-               _("Shadowsocks-libev"), 59)
-
-       entry({"admin", "services", "shadowsocks-libev", "instances"},
-               view("shadowsocks-libev/instances"),
-               _("Local Instances"), 10).leaf = true
-
-       entry({"admin", "services", "shadowsocks-libev", "servers"},
-               view("shadowsocks-libev/servers"),
-               _("Remote Servers"), 20).leaf = true
-
-       entry({"admin", "services", "shadowsocks-libev", "rules"},
-               view("shadowsocks-libev/rules"),
-               _("Redir Rules"), 30).leaf = true
-end
diff --git a/applications/luci-app-shadowsocks-libev/root/usr/share/luci/menu.d/luci-app-shadowsocks-libev.json b/applications/luci-app-shadowsocks-libev/root/usr/share/luci/menu.d/luci-app-shadowsocks-libev.json
new file mode 100644 (file)
index 0000000..afa8f44
--- /dev/null
@@ -0,0 +1,36 @@
+{
+       "admin/services/shadowsocks-libev": {
+               "title": "Shadowsocks-libev",
+               "order": 59,
+               "action": {
+                       "type": "firstchild"
+               }
+       },
+
+       "admin/services/shadowsocks-libev/instances": {
+               "title": "Local Instances",
+               "order": 10,
+               "action": {
+                       "type": "view",
+                       "path": "shadowsocks-libev/instances"
+               }
+       },
+
+       "admin/services/shadowsocks-libev/servers": {
+               "title": "Remote Servers",
+               "order": 20,
+               "action": {
+                       "type": "view",
+                       "path": "shadowsocks-libev/servers"
+               }
+       },
+
+       "admin/services/shadowsocks-libev/rules": {
+               "title": "Redir Rules",
+               "order": 30,
+               "action": {
+                       "type": "view",
+                       "path": "shadowsocks-libev/rules"
+               }
+       }
+}
diff --git a/applications/luci-app-shairplay/luasrc/controller/shairplay.lua b/applications/luci-app-shairplay/luasrc/controller/shairplay.lua
deleted file mode 100644 (file)
index d322301..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
--- Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.shairplay", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/shairplay") then
-               return
-       end
-
-       local page = entry({"admin", "services", "shairplay"}, cbi("shairplay"), _("Shairplay"))
-       page.dependent = true
-
-end
diff --git a/applications/luci-app-shairplay/root/usr/share/luci/menu.d/luci-app-shairplay.json b/applications/luci-app-shairplay/root/usr/share/luci/menu.d/luci-app-shairplay.json
new file mode 100644 (file)
index 0000000..fae7319
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/shairplay": {
+               "title": "Shairplay",
+               "action": {
+                       "type": "cbi",
+                       "path": "shairplay",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "shairplay": true }
+               }
+       }
+}
diff --git a/applications/luci-app-siitwizard/luasrc/controller/siitwizard.lua b/applications/luci-app-siitwizard/luasrc/controller/siitwizard.lua
deleted file mode 100644 (file)
index 0bbedaa..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-module "luci.controller.siitwizard"
-
-function index()
-       entry({"admin", "network", "siitwizard"}, form("siitwizard"), "SIIT 4over6 assistant", 99)
-end
diff --git a/applications/luci-app-siitwizard/root/usr/share/luci/menu.d/luci-app-siitwizard.json b/applications/luci-app-siitwizard/root/usr/share/luci/menu.d/luci-app-siitwizard.json
new file mode 100644 (file)
index 0000000..3f64bea
--- /dev/null
@@ -0,0 +1,11 @@
+{
+       "admin/network/siitwizard": {
+               "title": "SIIT 4over6 assistant",
+               "order": 99,
+               "action": {
+                       "type": "form",
+                       "path": "clamav",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua b/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua
deleted file mode 100644 (file)
index acfea5b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-module("luci.controller.simple-adblock", package.seeall)
-function index()
-       if nixio.fs.access("/etc/config/simple-adblock") then
-               entry({"admin", "services", "simple-adblock"}, cbi("simple-adblock"), _("Simple AdBlock"))
-       end
-end
diff --git a/applications/luci-app-simple-adblock/root/usr/share/luci/menu.d/luci-app-simple-adblock.json b/applications/luci-app-simple-adblock/root/usr/share/luci/menu.d/luci-app-simple-adblock.json
new file mode 100644 (file)
index 0000000..09f4a3c
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/simple-adblock": {
+               "title": "Simple AdBlock",
+               "action": {
+                       "type": "cbi",
+                       "path": "simple-adblock",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "simple-adblock": true }
+               }
+       }
+}
diff --git a/applications/luci-app-snmpd/luasrc/controller/snmpd.lua b/applications/luci-app-snmpd/luasrc/controller/snmpd.lua
deleted file mode 100644 (file)
index 7102074..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-module("luci.controller.snmpd", package.seeall)
-
-function index()
-    entry({"admin", "services", "snmpd"}, cbi("snmpd"), "SNMPD")
-end
diff --git a/applications/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json b/applications/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json
new file mode 100644 (file)
index 0000000..22d29c9
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/services/snmpd": {
+               "title": "SNMPD",
+               "action": {
+                       "type": "cbi",
+                       "path": "snmpd",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-squid/luasrc/controller/squid.lua b/applications/luci-app-squid/luasrc/controller/squid.lua
deleted file mode 100644 (file)
index 09946a1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
---[[
-
-LuCI Squid module
-
-Copyright (C) 2015, OpenWrt.org
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Marko Ratkaj <marko.ratkaj@sartura.hr>
-
-]]--
-
-module("luci.controller.squid", package.seeall)
-
-function index()
-       entry({"admin", "services", "squid"}, cbi("squid"), _("Squid"))
-end
diff --git a/applications/luci-app-squid/root/usr/share/luci/menu.d/luci-app-squid.json b/applications/luci-app-squid/root/usr/share/luci/menu.d/luci-app-squid.json
new file mode 100644 (file)
index 0000000..b71648b
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/services/squid": {
+               "title": "Squid",
+               "action": {
+                       "type": "cbi",
+                       "path": "squid",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-tinyproxy/luasrc/controller/tinyproxy.lua b/applications/luci-app-tinyproxy/luasrc/controller/tinyproxy.lua
deleted file mode 100644 (file)
index cf7e974..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.tinyproxy", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/tinyproxy") then
-               return
-       end
-
-       entry({"admin", "services", "tinyproxy"}, alias("admin", "services", "tinyproxy", "config"), _("Tinyproxy"))
-       entry({"admin", "services", "tinyproxy", "status"}, template("tinyproxy_status"), _("Status"))
-       entry({"admin", "services", "tinyproxy", "config"}, cbi("tinyproxy"), _("Configuration"))
-end
diff --git a/applications/luci-app-tinyproxy/root/usr/share/luci/menu.d/luci-app-tinyproxy.json b/applications/luci-app-tinyproxy/root/usr/share/luci/menu.d/luci-app-tinyproxy.json
new file mode 100644 (file)
index 0000000..e89c140
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "admin/services/tinyproxy": {
+               "title": "Tinyproxy",
+               "action": {
+                       "type": "firstchild"
+               },
+               "depends": {
+                       "uci": { "tinyproxy": true }
+               }
+       },
+
+       "admin/services/tinyproxy/status": {
+               "title": "Status",
+               "order": 1,
+               "action": {
+                       "type": "template",
+                       "path": "tinyproxy_status"
+               }
+       },
+
+       "admin/services/tinyproxy/config": {
+               "title": "Configuration",
+               "order": 2,
+               "action": {
+                       "type": "cbi",
+                       "path": "tinyproxy",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
index 0eff2ad33e2c085e098fb129d57e8b4049b7b5cf..71a17e2b905cf6ea5b3a6356e00e92dde890877c 100644 (file)
@@ -4,6 +4,9 @@
                "action": {
                        "type": "view",
                        "path": "transmission"
+               },
+               "depends": {
+                       "uci": { "transmission": true }
                }
        }
 }
diff --git a/applications/luci-app-ttyd/luasrc/controller/ttyd.lua b/applications/luci-app-ttyd/luasrc/controller/ttyd.lua
deleted file mode 100644 (file)
index 5a7344d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.ttyd", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/ttyd") then
-               return
-       end
-
-       entry({"admin", "services", "ttyd"}, firstchild(), _("ttyd"))
-       entry({"admin", "services", "ttyd", "ttyd"}, view("ttyd/term"), _("Terminal"), 1)
-       entry({"admin", "services", "ttyd", "config"}, view("ttyd/config"), _("Config"), 2)
-end
diff --git a/applications/luci-app-ttyd/root/usr/share/luci/menu.d/luci-app-ttyd.json b/applications/luci-app-ttyd/root/usr/share/luci/menu.d/luci-app-ttyd.json
new file mode 100644 (file)
index 0000000..cc8b3f1
--- /dev/null
@@ -0,0 +1,29 @@
+{
+       "admin/services/ttyd": {
+               "title": "ttyd",
+               "action": {
+                       "type": "firstchild"
+               },
+               "depends": {
+                       "uci": { "ttyd": true }
+               }
+       },
+
+       "admin/services/ttyd/ttyd": {
+               "title": "Terminal",
+               "order": 1,
+               "action": {
+                       "type": "view",
+                       "path": "ttyd/term"
+               }
+       },
+
+       "admin/services/ttyd/config": {
+               "title": "Config",
+               "order": 2,
+               "action": {
+                       "type": "view",
+                       "path": "ttyd/config"
+               }
+       }
+}
diff --git a/applications/luci-app-udpxy/luasrc/controller/udpxy.lua b/applications/luci-app-udpxy/luasrc/controller/udpxy.lua
deleted file mode 100644 (file)
index 36a40dd..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
--- Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.udpxy", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/udpxy") then
-               return
-       end
-
-       local page = entry({"admin", "services", "udpxy"}, cbi("udpxy"), _("udpxy"))
-       page.dependent = true
-
-end
diff --git a/applications/luci-app-udpxy/root/usr/share/luci/menu.d/luci-app-udpxy.json b/applications/luci-app-udpxy/root/usr/share/luci/menu.d/luci-app-udpxy.json
new file mode 100644 (file)
index 0000000..5f6a558
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/udpxy": {
+               "title": "udpxy",
+               "action": {
+                       "type": "cbi",
+                       "path": "udpxy",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "udpxy": true }
+               }
+       }
+}
diff --git a/applications/luci-app-uhttpd/luasrc/controller/uhttpd/uhttpd.lua b/applications/luci-app-uhttpd/luasrc/controller/uhttpd/uhttpd.lua
deleted file mode 100644 (file)
index 2e80dd6..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
--- Copyright 2015 Daniel Dickinson <openwrt@daniel.thecshore.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.uhttpd.uhttpd", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/uhttpd") then
-               return
-       end
-
-       local page
-
-       page = entry({"admin", "services", "uhttpd"}, cbi("uhttpd/uhttpd"), _("uHTTPd"))
-       page.leaf = true
-
-end
-
diff --git a/applications/luci-app-uhttpd/root/usr/share/luci/menu.d/luci-app-uhttpd.json b/applications/luci-app-uhttpd/root/usr/share/luci/menu.d/luci-app-uhttpd.json
new file mode 100644 (file)
index 0000000..44619ad
--- /dev/null
@@ -0,0 +1,13 @@
+{
+       "admin/services/uhttpd/*": {
+               "title": "uHTTPd",
+               "action": {
+                       "type": "cbi",
+                       "path": "uhttpd/uhttpd",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "uhttpd": true }
+               }
+       }
+}
diff --git a/applications/luci-app-upnp/luasrc/controller/upnp.lua b/applications/luci-app-upnp/luasrc/controller/upnp.lua
deleted file mode 100644 (file)
index 4b610f2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.upnp", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/upnpd") then
-               return
-       end
-
-       entry({"admin", "services", "upnp"}, view("upnp/upnp"), _("UPnP"))
-end
diff --git a/applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json b/applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json
new file mode 100644 (file)
index 0000000..7fdf67d
--- /dev/null
@@ -0,0 +1,12 @@
+{
+       "admin/services/upnp": {
+               "title": "UPnP",
+               "action": {
+                       "type": "view",
+                       "path": "upnp/upnp"
+               },
+               "depends": {
+                       "uci": { "upnpd": true }
+               }
+       }
+}
diff --git a/applications/luci-app-vnstat/luasrc/controller/vnstat.lua b/applications/luci-app-vnstat/luasrc/controller/vnstat.lua
deleted file mode 100644 (file)
index 3871fa2..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-module("luci.controller.vnstat", package.seeall)
-
-function index()
-       entry({"admin", "status", "vnstat"}, alias("admin", "status", "vnstat", "graphs"), _("VnStat Traffic Monitor"), 90)
-       entry({"admin", "status", "vnstat", "graphs"}, template("vnstat"), _("Graphs"), 1)
-       entry({"admin", "status", "vnstat", "config"}, cbi("vnstat"), _("Configuration"), 2)
-
-       entry({"mini", "network", "vnstat"}, alias("mini", "network", "vnstat", "graphs"), _("VnStat Traffic Monitor"), 90)
-       entry({"mini", "network", "vnstat", "graphs"}, template("vnstat"), _("Graphs"), 1)
-       entry({"mini", "network", "vnstat", "config"}, cbi("vnstat"), _("Configuration"), 2)
-end
diff --git a/applications/luci-app-vnstat/root/usr/share/luci/menu.d/luci-app-vnstat.json b/applications/luci-app-vnstat/root/usr/share/luci/menu.d/luci-app-vnstat.json
new file mode 100644 (file)
index 0000000..5b92e23
--- /dev/null
@@ -0,0 +1,28 @@
+{
+       "admin/status/vnstat": {
+               "title": "VnStat Traffic Monitor",
+               "order": 90,
+               "action": {
+                       "type": "firstchild"
+               }
+       },
+
+       "admin/status/vnstat/graphs": {
+               "title": "Graphs",
+               "order": 1,
+               "action": {
+                       "type": "template",
+                       "path": "vnstat"
+               }
+       },
+
+       "admin/status/vnstat/config": {
+               "title": "Configuration",
+               "order": 2,
+               "action": {
+                       "type": "cbi",
+                       "path": "vnstat",
+                       "post": { "cbi.submit": true }
+               }
+       }
+}
diff --git a/applications/luci-app-watchcat/luasrc/controller/watchcat.lua b/applications/luci-app-watchcat/luasrc/controller/watchcat.lua
deleted file mode 100644 (file)
index 27d5b74..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
--- Copyright 2012 Christian Gagneraud <chris@techworks.ie>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.watchcat", package.seeall)
-
-function index()
-   if not nixio.fs.access("/etc/config/system") then
-      return
-   end
-   entry({"admin", "services", "watchcat"}, cbi("watchcat/watchcat"), _("Watchcat"), 90)
-end
diff --git a/applications/luci-app-watchcat/root/usr/share/luci/menu.d/luci-app-watchcat.json b/applications/luci-app-watchcat/root/usr/share/luci/menu.d/luci-app-watchcat.json
new file mode 100644 (file)
index 0000000..d1eba7b
--- /dev/null
@@ -0,0 +1,14 @@
+{
+       "admin/services/watchcat": {
+               "title": "Watchcat",
+               "order": 90,
+               "action": {
+                       "type": "cbi",
+                       "path": "watchcat/watchcat",
+                       "post": { "cbi.submit": true }
+               },
+               "depends": {
+                       "uci": { "system": true }
+               }
+       }
+}
diff --git a/applications/luci-app-wireguard/luasrc/controller/wireguard.lua b/applications/luci-app-wireguard/luasrc/controller/wireguard.lua
deleted file mode 100644 (file)
index 5a91960..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
--- Copyright 2016-2017 Dan Luedtke <mail@danrl.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.wireguard", package.seeall)
-
-function index()
-       entry({"admin", "status", "wireguard"}, template("wireguard"), _("WireGuard Status"), 92)
-end
diff --git a/applications/luci-app-wireguard/root/usr/share/luci/menu.d/luci-app-wireguard.json b/applications/luci-app-wireguard/root/usr/share/luci/menu.d/luci-app-wireguard.json
new file mode 100644 (file)
index 0000000..0cb87f3
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "admin/status/wireguard": {
+               "title": "WireGuard Status",
+               "order": 92,
+               "action": {
+                       "type": "template",
+                       "path": "wireguard"
+               }
+       }
+}
diff --git a/applications/luci-app-yggdrasil/luasrc/controller/yggdrasil.lua b/applications/luci-app-yggdrasil/luasrc/controller/yggdrasil.lua
deleted file mode 100644 (file)
index 8a95552..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-module("luci.controller.yggdrasil", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/yggdrasil") then
-               return
-       end
-
-       entry({"admin", "network", "yggdrasil"}, firstchild(), "Yggdrasil").dependent = true
-       entry({"admin", "network", "yggdrasil", "status"}, view("yggdrasil/status"), _("Status"), 1).leaf = false
-
-       entry({"admin", "network", "yggdrasil", "peers"}, view("yggdrasil/peers"), _("Peers"), 2).leaf = false
-       entry({"admin", "network", "yggdrasil", "settings"}, view("yggdrasil/settings"), _("Settings"), 3).leaf = false
-       entry({"admin", "network", "yggdrasil", "keys"}, view("yggdrasil/keys"), _("Encryption keys"), 4).leaf = false
-       entry({"admin", "network", "yggdrasil", "session_firewall"}, view("yggdrasil/session_firewall"), _("Session firewall"), 5).leaf = false
-       entry({"admin", "network", "yggdrasil", "tunnel_routing"}, view("yggdrasil/tunnel_routing"), _("Tunnel routing"), 6).leaf = false
-end
diff --git a/applications/luci-app-yggdrasil/root/usr/share/luci/menu.d/luci-app-yggdrasil.json b/applications/luci-app-yggdrasil/root/usr/share/luci/menu.d/luci-app-yggdrasil.json
new file mode 100644 (file)
index 0000000..dbe9331
--- /dev/null
@@ -0,0 +1,65 @@
+{
+       "admin/network/yggdrasil": {
+               "title": "Yggdrasil",
+               "action": {
+                       "type": "firstchild"
+               },
+               "depends": {
+                       "uci": { "yggdrasil": true }
+               }
+       },
+
+       "admin/network/yggdrasil/status": {
+               "title": "Status",
+               "order": 1,
+               "action": {
+                       "type": "view",
+                       "path": "yggdrasil/status"
+               }
+       },
+
+       "admin/network/yggdrasil/peers": {
+               "title": "Peers",
+               "order": 2,
+               "action": {
+                       "type": "view",
+                       "path": "yggdrasil/peers"
+               }
+       },
+
+       "admin/network/yggdrasil/settings": {
+               "title": "Settings",
+               "order": 3,
+               "action": {
+                       "type": "view",
+                       "path": "yggdrasil/settings"
+               }
+       },
+
+       "admin/network/yggdrasil/keys": {
+               "title": "Encryption keys",
+               "order": 4,
+               "action": {
+                       "type": "view",
+                       "path": "yggdrasil/keys"
+               }
+       },
+
+       "admin/network/yggdrasil/session_firewall": {
+               "title": "Session firewall",
+               "order": 5,
+               "action": {
+                       "type": "view",
+                       "path": "yggdrasil/session_firewall"
+               }
+       },
+
+       "admin/network/yggdrasil/tunnel_routing": {
+               "title": "Tunnel routing",
+               "order": 6,
+               "action": {
+                       "type": "view",
+                       "path": "yggdrasil/tunnel_routing"
+               }
+       }
+}