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,11 +1,8 @@
local api = require "luci.passwall2.api"
local appname = api.appname
api.set_default_cbi()
m = Map(appname)
m = Map()
m.redirect = api.url("node_subscribe")
api.set_apply_on_parse(m)
if not arg[1] or not m:get(arg[1]) then
luci.http.redirect(m.redirect)
@@ -15,7 +12,7 @@ function m.on_before_save(self)
self:del(arg[1], "md5")
end
m:append(Template(appname .. "/cbi/nodes_listvalue_com"))
m:appendTemplate("/cbi/nodes_listvalue_com")
local has_ss_rust = api.is_finded("sslocal")
local has_singbox = api.finded_com("sing-box")
@@ -79,7 +76,7 @@ o.validate = function(self, value, section)
return nil, translate("Remark cannot be empty.")
end
local duplicate = false
m.uci:foreach(appname, "subscribe_list", function(e)
m:foreach("subscribe_list", function(e)
if e[".name"] ~= section and e["remark"] and e["remark"]:lower() == value:lower() then
duplicate = true
return false
@@ -93,9 +90,9 @@ end
o.write = function(self, section, value)
local old = m:get(section, self.option) or ""
if old ~= value then
m.uci:foreach(appname, "nodes", function(e)
m:foreach("nodes", function(e)
if e["group"] and e["group"]:lower() == old:lower() then
m.uci:set(appname, e[".name"], "group", value)
self:set(e[".name"], "group", value)
end
if e["protocol"] and (e["protocol"] == "_balancing" or e["protocol"] == "_urltest") and e["node_group"] then
local gs = ""
@@ -107,7 +104,7 @@ o.write = function(self, section, value)
end
end
gs = api.trim(gs)
m.uci:set(appname, e[".name"], "node_group", gs)
self:set(e[".name"], "node_group", gs)
end
end)
end
@@ -298,13 +295,13 @@ descrStr = translate(descrStr) .. "<br>" .. translate("Only support a layer of p
o1 = s:option(ListValue, "preproxy_node", translate("Preproxy Node"))
o1:depends({ ["chain_proxy"] = "1" })
o1.description = descrStr
o1.template = appname .. "/cbi/nodes_listvalue"
o1.template = m:template_path("/cbi/nodes_listvalue")
o1.group = {}
o2 = s:option(ListValue, "to_node", translate("Landing Node"))
o2:depends({ ["chain_proxy"] = "2" })
o2.description = descrStr
o2.template = appname .. "/cbi/nodes_listvalue"
o2.template = m:template_path("/cbi/nodes_listvalue")
o2.group = {}
o3 = s:option(Value, "outbound_iface", translate("Outbound Interface"))