mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-09-10 18:34:18 +08:00
✨ Sync 2026-08-25 19:47:18
This commit is contained in:
@@ -1268,11 +1268,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",
|
||||
@@ -1280,7 +1287,6 @@ function gen_config(var)
|
||||
port = section.port,
|
||||
uot = "1"
|
||||
}
|
||||
return result
|
||||
end
|
||||
if section[".type"] == "nodes" then
|
||||
return section
|
||||
@@ -1447,12 +1453,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