mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-30 11:55:13 +08:00
update 2026-08-25 12:33:18
This commit is contained in:
1 parent
e11e6e5941
commit
a438ed414d
1961 files changed
+1523193
-45
No files matched your search
@@ -1311,11 +1311,18 @@ function gen_config(var)
|
||||
end
|
||||
|
||||
function get_node_by_id(node_id)
|
||||
if not node_id or node_id == "" or node_id == "nil" then return nil end
|
||||
local section = api.uci_get_c(node_id) or {}
|
||||
local section
|
||||
if type(node_id) == "table" then
|
||||
section = node_id
|
||||
elseif type(node_id) == "string" then
|
||||
if node_id == "" or node_id == "nil" then return nil end
|
||||
section = api.uci_get_c(node_id) or {}
|
||||
else
|
||||
return nil
|
||||
end
|
||||
if section[".type"] == "socks" then
|
||||
local result = {
|
||||
[".name"] = node_id,
|
||||
return {
|
||||
[".name"] = section[".name"],
|
||||
remarks = "socks[%s]" % section.port,
|
||||
type = "sing-box",
|
||||
protocol = "socks",
|
||||
@@ -1323,7 +1330,6 @@ function gen_config(var)
|
||||
port = section.port,
|
||||
uot = "1"
|
||||
}
|
||||
return result
|
||||
end
|
||||
if section[".type"] == "nodes" then
|
||||
return section
|
||||
@@ -1487,12 +1493,7 @@ function gen_config(var)
|
||||
|
||||
function gen_outbound_get_tag(flag, node_id, tag, proxy_table)
|
||||
if not node_id or node_id == "nil" then return nil end
|
||||
local node
|
||||
if type(node_id) == "string" then
|
||||
node = get_node_by_id(node_id)
|
||||
elseif type(node_id) == "table" then
|
||||
node = node_id
|
||||
end
|
||||
local node = get_node_by_id(node_id)
|
||||
if not tag then tag = node[".name"] end
|
||||
if node then
|
||||
if proxy_table.chain_proxy == "1" or proxy_table.chain_proxy == "2" then
|
||||
|
||||
Reference in new issue
Block a user