mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 21:15:13 +08:00
🎄 Sync 2026-08-17 19:39:03
This commit is contained in:
1 parent
762c5f8cd4
commit
522b0fc0b6
58 files changed
+1243
-692
No files matched your search
@@ -661,11 +661,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
|
||||
@@ -677,13 +682,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