mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-31 05:35:13 +08:00
update 2026-08-17 08:56:27
This commit is contained in:
1 parent
a410b26046
commit
e12e831d01
8 files changed
+48
-105
No files matched your search
@@ -584,11 +584,16 @@ 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]", "tcp_node") or "") == w then
|
||||
uci_del('@global[0]', "tcp_node")
|
||||
end
|
||||
if (uci_get("@global[0]", "udp_node") or "") == w then
|
||||
uci_del('@global[0]', "udp_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
|
||||
@@ -600,13 +605,15 @@ 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)
|
||||
if (uci_get("@global[0]", "tcp_node") or "") == w then
|
||||
uci_del('@global[0]', "tcp_node")
|
||||
end
|
||||
if (uci_get("@global[0]", "udp_node") or "") == w then
|
||||
uci_del('@global[0]', "udp_node")
|
||||
end
|
||||
uci_foreach("haproxy_config", function(t)
|
||||
if t["lbss"] == w then
|
||||
uci_del(t[".name"])
|
||||
|
||||
Reference in new issue
Block a user