summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-09-14 13:29:19 +0200
committerJo-Philipp Wich <jo@mein.io>2022-10-25 01:03:37 +0200
commitc7b300e6143ab9916730108fff0a5d25a3d5ac53 (patch)
treec54f923692ba06c1334849354f3551184ece63a3 /modules
parentdaf7ceebba81ae86248e625791f7ea4df6eb1eab (diff)
luci-lua-runtime: add compatibility template for legacy Lua status includes
Add a compatibility template containing legacy Lua logic extracted from the luci-mod-status main status page in order to free the status module from any explicit or implicit Lua dependencies. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-lua-runtime/luasrc/view/admin_status/luaindex.htm18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/luci-lua-runtime/luasrc/view/admin_status/luaindex.htm b/modules/luci-lua-runtime/luasrc/view/admin_status/luaindex.htm
new file mode 100644
index 0000000000..ef664edcb2
--- /dev/null
+++ b/modules/luci-lua-runtime/luasrc/view/admin_status/luaindex.htm
@@ -0,0 +1,18 @@
+<%-
+ local util = require "luci.util"
+ local fs = require "nixio.fs"
+
+ local incdir = util.libpath() .. "/view/admin_status/index/"
+ if fs.access(incdir) then
+ local _, inc
+ local includes = {}
+ for inc in fs.dir(incdir) do
+ if inc:match("%.htm$") then
+ includes[#includes + 1] = inc:gsub("%.htm$", "")
+ end
+ end
+ for _, inc in luci.util.vspairs(includes) do
+ include("admin_status/index/" .. inc)
+ end
+ end
+-%>