mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-15 04:53:00 +08:00
🎈 Sync 2026-10-28 12:40:08
This commit is contained in:
1 parent
d42296f292
commit
cfb89528fa
20 files changed
+1459
-766
No files matched your search
@@ -248,12 +248,12 @@ function socks_autoswitch_add_node()
|
||||
uci_set(id, "enable_autoswitch", "1")
|
||||
local new_list = uci_get(id, "autoswitch_backup_node") or {}
|
||||
for i = #new_list, 1, -1 do
|
||||
if (uci_get(new_list[i], "remarks") or ""):find(key) then
|
||||
if (uci_get(new_list[i], "remarks") or ""):find(key, 1, true) then
|
||||
table.remove(new_list, i)
|
||||
end
|
||||
end
|
||||
for k, e in ipairs(api.get_valid_nodes()) do
|
||||
if e.node_type == "normal" and e["remark"]:find(key) then
|
||||
if e.node_type == "normal" and e["remark"]:find(key, 1, true) then
|
||||
table.insert(new_list, e.id)
|
||||
end
|
||||
end
|
||||
@@ -270,7 +270,7 @@ function socks_autoswitch_remove_node()
|
||||
uci_set(id, "enable_autoswitch", "1")
|
||||
local new_list = uci_get(id, "autoswitch_backup_node") or {}
|
||||
for i = #new_list, 1, -1 do
|
||||
if (uci_get(new_list[i], "remarks") or ""):find(key) then
|
||||
if (uci_get(new_list[i], "remarks") or ""):find(key, 1, true) then
|
||||
table.remove(new_list, i)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user