update 2024-12-27 14:16:18

This commit is contained in:
kenzok8 2024-12-27 14:16:18 +08:00
parent 362e630b27
commit bd5027eb1d

View File

@ -1,16 +1,13 @@
local api = require "luci.passwall.api"
local appname = "passwall"
local uci = api.libuci
local fs = api.fs
local types_dir = "/usr/lib/lua/luci/model/cbi/passwall/client/type/"
if not arg[1] or not uci:get(appname, arg[1]) then
luci.http.redirect(api.url("node_list"))
end
m = Map(appname, translate("Node Config"))
m.redirect = api.url()
if not arg[1] or not m.uci:get(appname, arg[1]) then
luci.http.redirect(api.url("node_list"))
end
s = m:section(NamedSection, arg[1], "nodes", "")
s.addremove = false
s.dynamic = false
@ -68,6 +65,9 @@ if api.is_finded("ipt2socks") then
end
end
local fs = api.fs
local types_dir = "/usr/lib/lua/luci/model/cbi/passwall/client/type/"
local type_table = {}
for filename in fs.dir(types_dir) do
table.insert(type_table, filename)