update 2026-08-14 04:36:07

This commit is contained in:
action committed 2026-08-14 04:36:07 +08:00
1 parent e716bb6996
commit 5ce413d3a3
74 files changed
+693 -819

No files matched your search

@@ -1,30 +1,22 @@
api = require "luci.passwall2.api"
appname = api.appname
api.set_default_cbi()
m = Map(appname, translate("Node Config"))
m = Map()
m.redirect = api.url()
api.set_apply_on_parse(m)
if not arg[1] or not m:get(arg[1]) then
luci.http.redirect(api.url("node_list"))
end
fs = require "nixio.fs"
formvalue_key = "cbid." .. appname .. "." .. arg[1] .. "."
formvalue_key = "cbid." .. m.config .. "." .. arg[1] .. "."
local header = Template(appname .. "/node_config/header")
header.api = api
header.config = m.config
header.section = arg[1]
m:append(header)
m:append(Template(appname .. "/cbi/nodes_multivalue_com"))
m:append(Template(appname .. "/cbi/nodes_listvalue_com"))
m:appendTemplate("/node_config/header", {section = arg[1]})
m:appendTemplate("/cbi/nodes_multivalue_com")
m:appendTemplate("/cbi/nodes_listvalue_com")
groups = {}
m.uci:foreach(appname, "nodes", function(s)
m:foreach("nodes", function(s)
if s[".name"] ~= arg[1] then
if s.group and s.group ~= "" then
groups[s.group] = true
@@ -32,13 +24,13 @@ m.uci:foreach(appname, "nodes", function(s)
end
end)
s = m:section(NamedSection, arg[1], "nodes", "")
s = m:section(NamedSection, arg[1], "nodes", translate("Node Config"))
s.addremove = false
s.dynamic = false
o = s:option(DummyValue, "passwall2", " ")
o.rawhtml = true
o.template = "passwall2/node_config/link_share_man"
o.template = m:template_path("/node_config/link_share_man")
o.value = arg[1]
o = s:option(Value, "remarks", translate("Node Remarks"))
@@ -67,10 +59,10 @@ o.write = function(self, section, value)
m:set(section, self.option, value)
end
local types_dir = "/usr/lib/lua/luci/model/cbi/passwall2/client/type/"
local types_dir = "/usr/lib/lua/luci/model/cbi/" .. api.appname .. "/client/type/"
s.val = {}
s.val["type"] = m.uci:get(appname, arg[1], "type")
s.val["protocol"] = m.uci:get(appname, arg[1], "protocol")
s.val["type"] = m:get(arg[1], "type")
s.val["protocol"] = m:get(arg[1], "protocol")
if luci.http.formvalue("cbi.submit") == "1" then
local formvalue_type = luci.http.formvalue(formvalue_key .. "type")
@@ -92,10 +84,6 @@ for index, value in ipairs(type_table) do
setfenv(p_func, getfenv(1))(m, s)
end
local footer = Template(appname .. "/node_config/footer")
footer.api = api
footer.config = m.config
footer.section = arg[1]
m:append(footer)
m:appendTemplate("/node_config/footer", {section = arg[1]})
return api.return_map(m)