update 2026-08-27 00:43:46

This commit is contained in:
action committed 2026-08-27 00:43:46 +08:00
1 parent 1bfa02b7c5
commit f5a34d6fcf
1988 files changed
+833 -1523314

No files matched your search

@@ -36,7 +36,7 @@ function index()
entry({"admin", "services", appname, "settings"}, cbi(appname .. "/client/global"), _("Basic Settings"), 1).dependent = true
entry({"admin", "services", appname, "node_list"}, cbi(appname .. "/client/node_list"), _("Node List"), 2).dependent = true
entry({"admin", "services", appname, "node_subscribe"}, cbi(appname .. "/client/node_subscribe"), _("Node Subscribe"), 3).dependent = true
entry({"admin", "services", appname, "other"}, cbi(appname .. "/client/other", {autoapply = true}), _("Other Settings"), 92).leaf = true
entry({"admin", "services", appname, "other"}, cbi(appname .. "/client/other"), _("Other Settings"), 92).leaf = true
if nixio.fs.access("/usr/sbin/haproxy") then
entry({"admin", "services", appname, "haproxy"}, cbi(appname .. "/client/haproxy"), _("Load Balancing"), 93).leaf = true
end
@@ -1,6 +1,5 @@
local api = require "luci.passwall2.api"
local fs = api.fs
local uci = api.uci
local geo_dir = (api.uci_get_c("@global_rules[0]", "v2ray_location_asset") or "/usr/share/v2ray/"):match("^(.*)/")
local geosite_path = geo_dir .. "/geosite.dat"
@@ -460,6 +460,7 @@ o.default = "0"
o:depends({ custom = false })
o = s:option(Value, "firewall_allow_src", translate("Source zone"))
o.rmempty = false
o.nocreate = true
o.allowany = true
o.default = "wan"
@@ -478,6 +478,7 @@ o.default = "0"
o:depends({ custom = false })
o = s:option(Value, "firewall_allow_src", translate("Source zone"))
o.rmempty = false
o.nocreate = true
o.allowany = true
o.default = "wan"
@@ -77,6 +77,7 @@ o.default = "0"
o:depends({ custom = false })
o = s:option(Value, "firewall_allow_src", translate("Source zone"))
o.rmempty = false
o.nocreate = true
o.allowany = true
o.default = "wan"
@@ -108,6 +108,7 @@ o.default = "0"
o:depends({ custom = false })
o = s:option(Value, "firewall_allow_src", translate("Source zone"))
o.rmempty = false
o.nocreate = true
o.allowany = true
o.default = "wan"
+3 -39
View File
@@ -1449,17 +1449,9 @@ function set_default_cbi()
if not config then config = c_config end
default_init(self, config, ...)
self.api = require "luci.passwall2.api"
end
if is_js_luci() == true then
local default_parse = Map.parse
function Map.parse(self, ...)
apply_redirect(self)
local old = self.on_after_save
self.on_after_save = function(self)
if old then old(self) end
self:set("@global[0]", "timestamp", os.time())
end
return default_parse(self, ...)
if is_js_luci() == true then
self.apply_on_parse = false
self.is_js_luci = true
end
end
function Map.foreach(self, stype, func)
@@ -1702,34 +1694,6 @@ function format_go_time(input, default)
return result
end
function apply_redirect(m)
local tmp_uci_file = "/etc/config/" .. c_config .. "_redirect"
if m.redirect and m.redirect ~= "" then
if fs.access(tmp_uci_file) then
local redirect
for line in io.lines(tmp_uci_file) do
redirect = line:match("option%s+url%s+['\"]([^'\"]+)['\"]")
if redirect and redirect ~= "" then break end
end
if redirect and redirect ~= "" then
sys.call("/bin/rm -f " .. tmp_uci_file)
luci.http.redirect(redirect)
end
else
fs.writefile(tmp_uci_file, "config redirect\n")
end
m.on_after_save = function(self)
local redirect = self.redirect
if redirect and redirect ~= "" then
uci:set(c_config .. "_redirect", "@redirect[0]", "url", redirect)
end
end
else
uci:revert(c_config .. "_redirect")
sys.call("/bin/rm -f " .. tmp_uci_file)
end
end
function match_node_rule(name, rule)
if not name then return false end
if not rule or rule == "" then return true end
@@ -18,4 +18,46 @@ local map = self.map
});
}
});
</script>
</script>
<% if luci.http.formvalue("cbi.apply") == "1" and map.is_js_luci then -%>
<script type="text/javascript">
document.addEventListener("luci-loaded", function() {
L.env.apply_display = 2; //Write whatever you want, it's all just a fake progress bar anyway.
L.env.apply_holdoff = 1;
let tt;
let flag = 2;
if (flag == 1) {
L.ui.changes.confirm(false, Date.now() + L.env.apply_rollback * 1000);
} else {
let ts = Date.now();
const deadline = Date.now() + L.env.apply_rollback * 1000;
const tick = () => {
const now = Date.now();
L.ui.changes.displayStatus('notice spinning',
E('p', _('Applying configuration changes… %ds')
.format(Math.max(Math.floor((deadline - Date.now()) / 1000), 0))));
if (now >= deadline)
return;
tt = window.setTimeout(tick, 1000 - (now - ts));
ts = now;
};
tick();
}
window.setTimeout(() => {
<% if not map.redirect then -%>
window.clearTimeout(tt);
L.ui.changes.displayStatus(false);
window.location = window.location.href.split('#')[0];
<%- else %>
window.location.href = "<%=map.redirect%>";
<%- end %>
}, (L.env.apply_display + L.env.apply_holdoff) * 1000);
});
</script>
<%- end %>