⛅ Sync 2026-08-15 00:37:20

This commit is contained in:
github-actions[bot] committed 2026-08-15 00:37:20 +08:00
1 parent fefba0b996
commit 619b38b2b7
74 files changed
+807 -850

No files matched your search

@@ -1,6 +1,6 @@
local api = require "luci.passwall.api"
local uci = api.uci
local appname = "passwall"
api.set_default_cbi()
local has_ss_rust = api.is_finded("sslocal")
local has_singbox = api.finded_com("sing-box")
local has_xray = api.finded_com("xray")
@@ -38,23 +38,16 @@ if has_hysteria2 then
table.insert(hysteria2_type, s)
end
api.set_default_cbi()
m = Map(appname)
api.set_apply_on_parse(m)
m = Map()
function m.on_before_save(self)
if self.no_commit then
return
end
self.uci:foreach(appname, "subscribe_list", function(e)
self:foreach("subscribe_list", function(e)
self:del(e[".name"], "md5")
end)
end
-- [[ Subscribe Settings ]]--
s = m:section(TypedSection, "global_subscribe", "")
s.anonymous = true
s = m:section(NamedSection, "@global_subscribe[0]", "global_subscribe")
o = s:option(ListValue, "filter_keyword_mode", translate("Filter keyword Mode"))
o:value("0", translate("Close"))
@@ -129,15 +122,13 @@ o.cfgvalue = function(self, section)
translate("Manual subscription All"))
end
local cfgname = "subscribe_list"
s = m:section(TypedSection, cfgname, "", "<font color='red'>" .. translate("When adding a new subscription, please save and apply before manually subscribing. If you only change the subscription URL, you can subscribe manually, and the system will save it automatically.") .. "</font>")
s = m:section(TypedSection, "subscribe_list", "", "<font color='red'>" .. translate("When adding a new subscription, please save and apply before manually subscribing. If you only change the subscription URL, you can subscribe manually, and the system will save it automatically.") .. "</font>")
s.addremove = true
s.anonymous = true
s.sortable = true
s.template = "cbi/tblsection"
s.extedit = api.url("node_subscribe_config", "%s")
function s.create(e, t)
m.no_commit = true
local uid = "sub_" .. api.gen_random_char(5)
TypedSection.create(e, uid)
m:set(uid, "hysteria_up_mbps", "100")
@@ -154,7 +145,7 @@ o.validate = function(self, value, section)
return nil, translate("Remark cannot be empty.")
end
local duplicate = false
m.uci:foreach(appname, cfgname, function(e)
m:foreach(s.sectiontype, function(e)
if e[".name"] ~= section and e["remark"] and e["remark"]:lower() == value:lower() then
duplicate = true
return false
@@ -168,9 +159,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)
m:set(e[".name"], "group", value)
end
if e["protocol"] and (e["protocol"] == "_balancing" or e["protocol"] == "_urltest") and e["node_group"] then
local gs = ""
@@ -182,7 +173,7 @@ o.write = function(self, section, value)
end
end
gs = api.trim(gs)
m.uci:set(appname, e[".name"], "node_group", gs)
m:set(e[".name"], "node_group", gs)
end
end)
end
@@ -200,7 +191,7 @@ o.cfgvalue = function(t, n)
end
str = str ~= "" and "<br>" .. str or ""
local num = 0
m.uci:foreach(appname, "nodes", function(s)
m:foreach("nodes", function(s)
if s["group"] and s["group"]:lower() == remark:lower() then
num = num + 1
end
@@ -229,11 +220,8 @@ o.cfgvalue = function(self, section)
section, translate("Manual subscription"))
end
local sortable = Template(appname .. "/cbi/sortable")
sortable.api = api
sortable.target_cfgname = cfgname
m:append(sortable)
m:appendTemplate("/cbi/sortable", {sectiontype = s.sectiontype})
m:append(Template(appname .. "/node_subscribe/js"))
m:appendTemplate("/node_subscribe/js")
return api.return_map(m)