mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-29 08:45:13 +08:00
update 2026-08-16 16:21:47
This commit is contained in:
1 parent
d298a9b0c2
commit
9f4ff1bb27
21 files changed
+78
-115
No files matched your search
@@ -467,14 +467,13 @@ end
|
||||
function delete_select_nodes()
|
||||
local ids = http.formvalue("ids")
|
||||
local redirect = http.formvalue("redirect")
|
||||
local ids_t = {}
|
||||
string.gsub(ids, '[^' .. "," .. ']+', function(w)
|
||||
ids_t[#ids_t + 1] = w
|
||||
if (uci_get("@global[0]", "node") or "") == w then
|
||||
uci_del('@global[0]', "node")
|
||||
end
|
||||
uci_foreach("socks", function(t)
|
||||
if t["node"] == w then
|
||||
uci_del(t[".name"])
|
||||
end
|
||||
local changed = false
|
||||
local auto_switch_node_list = uci_get(t[".name"], "autoswitch_backup_node") or {}
|
||||
for i = #auto_switch_node_list, 1, -1 do
|
||||
@@ -486,6 +485,14 @@ function delete_select_nodes()
|
||||
if changed then
|
||||
uci_set(t[".name"], "autoswitch_backup_node", auto_switch_node_list)
|
||||
end
|
||||
if t["node"] == w then
|
||||
local new_node = api.get_random_normal_node(ids_t)
|
||||
if new_node then
|
||||
uci_set(t[".name"], "node", new_node[".name"])
|
||||
else
|
||||
uci_set(t[".name"], "enabled", "0")
|
||||
end
|
||||
end
|
||||
end)
|
||||
uci_foreach("haproxy_config", function(t)
|
||||
if t["lbss"] == w then
|
||||
|
||||
Reference in new issue
Block a user