mirror of
https://github.com/xiaorouji/openwrt-passwall2.git
synced 2025-05-02 04:22:02 +08:00
luci: add xray server fallback xver settings
This commit is contained in:
parent
a60c03122f
commit
83e2f6e3c0
@ -364,7 +364,7 @@ o.default = 0
|
|||||||
o:depends({ [_n("fallback")] = true })
|
o:depends({ [_n("fallback")] = true })
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
o = s:option(DynamicList, _n("fallback_list"), "Fallback", translate("dest,path"))
|
o = s:option(DynamicList, _n("fallback_list"), "Fallback", translate("format: dest,path,xver"))
|
||||||
o:depends({ [_n("fallback")] = true })
|
o:depends({ [_n("fallback")] = true })
|
||||||
|
|
||||||
o = s:option(Flag, _n("bind_local"), translate("Bind Local"), translate("When selected, it can only be accessed localhost."))
|
o = s:option(Flag, _n("bind_local"), translate("Bind Local"), translate("When selected, it can only be accessed localhost."))
|
||||||
|
@ -369,19 +369,19 @@ function gen_config_server(node)
|
|||||||
local fallbackStr = node.fallback_list[i]
|
local fallbackStr = node.fallback_list[i]
|
||||||
if fallbackStr then
|
if fallbackStr then
|
||||||
local tmp = {}
|
local tmp = {}
|
||||||
string.gsub(fallbackStr, '[^' .. "," .. ']+', function(w)
|
string.gsub(fallbackStr, '[^,]+', function(w)
|
||||||
table.insert(tmp, w)
|
table.insert(tmp, w)
|
||||||
end)
|
end)
|
||||||
local dest = tmp[1] or ""
|
local dest = tmp[1] or ""
|
||||||
local path = tmp[2]
|
local path = tmp[2]
|
||||||
if dest:find("%.") then
|
local xver = tonumber(tmp[3])
|
||||||
else
|
if not dest:find("%.") then
|
||||||
dest = tonumber(dest)
|
dest = tonumber(dest)
|
||||||
end
|
end
|
||||||
fallbacks[i] = {
|
fallbacks[i] = {
|
||||||
path = path,
|
path = path,
|
||||||
dest = dest,
|
dest = dest,
|
||||||
xver = 1
|
xver = xver
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user