mirror of
https://github.com/bolucat/Archive.git
synced 2026-04-23 00:17:16 +08:00
Update On Thu Dec 19 19:34:34 CET 2024
This commit is contained in:
@@ -166,11 +166,11 @@ end
|
||||
function get_now_use_node()
|
||||
local path = "/tmp/etc/passwall/acl/default"
|
||||
local e = {}
|
||||
local tcp_node = api.get_cache_var("GLOBAL_TCP_node")
|
||||
local tcp_node = api.get_cache_var("ACL_GLOBAL_TCP_node")
|
||||
if tcp_node then
|
||||
e["TCP"] = tcp_node
|
||||
end
|
||||
local udp_node = api.get_cache_var("GLOBAL_UDP_node")
|
||||
local udp_node = api.get_cache_var("ACL_GLOBAL_UDP_node")
|
||||
if udp_node then
|
||||
e["UDP"] = udp_node
|
||||
end
|
||||
@@ -364,8 +364,8 @@ end
|
||||
|
||||
function clear_all_nodes()
|
||||
uci:set(appname, '@global[0]', "enabled", "0")
|
||||
uci:set(appname, '@global[0]', "tcp_node", "nil")
|
||||
uci:set(appname, '@global[0]', "udp_node", "nil")
|
||||
uci:delete(appname, '@global[0]', "tcp_node")
|
||||
uci:delete(appname, '@global[0]', "udp_node")
|
||||
uci:foreach(appname, "socks", function(t)
|
||||
uci:delete(appname, t[".name"])
|
||||
uci:set_list(appname, t[".name"], "autoswitch_backup_node", {})
|
||||
@@ -374,8 +374,8 @@ function clear_all_nodes()
|
||||
uci:delete(appname, t[".name"])
|
||||
end)
|
||||
uci:foreach(appname, "acl_rule", function(t)
|
||||
uci:set(appname, t[".name"], "tcp_node", "nil")
|
||||
uci:set(appname, t[".name"], "udp_node", "nil")
|
||||
uci:delete(appname, t[".name"], "tcp_node")
|
||||
uci:delete(appname, t[".name"], "udp_node")
|
||||
end)
|
||||
uci:foreach(appname, "nodes", function(node)
|
||||
uci:delete(appname, node['.name'])
|
||||
@@ -388,11 +388,11 @@ end
|
||||
function delete_select_nodes()
|
||||
local ids = luci.http.formvalue("ids")
|
||||
string.gsub(ids, '[^' .. "," .. ']+', function(w)
|
||||
if (uci:get(appname, "@global[0]", "tcp_node") or "nil") == w then
|
||||
uci:set(appname, '@global[0]', "tcp_node", "nil")
|
||||
if (uci:get(appname, "@global[0]", "tcp_node") or "") == w then
|
||||
uci:delete(appname, '@global[0]', "tcp_node")
|
||||
end
|
||||
if (uci:get(appname, "@global[0]", "udp_node") or "nil") == w then
|
||||
uci:set(appname, '@global[0]', "udp_node", "nil")
|
||||
if (uci:get(appname, "@global[0]", "udp_node") or "") == w then
|
||||
uci:delete(appname, '@global[0]', "udp_node")
|
||||
end
|
||||
uci:foreach(appname, "socks", function(t)
|
||||
if t["node"] == w then
|
||||
@@ -413,10 +413,10 @@ function delete_select_nodes()
|
||||
end)
|
||||
uci:foreach(appname, "acl_rule", function(t)
|
||||
if t["tcp_node"] == w then
|
||||
uci:set(appname, t[".name"], "tcp_node", "nil")
|
||||
uci:delete(appname, t[".name"], "tcp_node")
|
||||
end
|
||||
if t["udp_node"] == w then
|
||||
uci:set(appname, t[".name"], "udp_node", "nil")
|
||||
uci:delete(appname, t[".name"], "udp_node")
|
||||
end
|
||||
end)
|
||||
uci:foreach(appname, "nodes", function(t)
|
||||
|
||||
Reference in New Issue
Block a user