luci-app-shadowsocks-libev: tweak list of redir instances
- Skip disabled ones - Allow empty value Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
parent
56e9ac6642
commit
fd085d9910
1 changed files with 4 additions and 1 deletions
|
@ -23,13 +23,16 @@ end
|
|||
|
||||
function values_redir(o, xmode)
|
||||
o.map.uci.foreach("shadowsocks-libev", "ss_redir", function(sdata)
|
||||
local disabled = ucival_to_bool(sdata["disabled"])
|
||||
local sname = sdata[".name"]
|
||||
local mode = sdata["mode"] or "tcp_only"
|
||||
if mode and mode:find(xmode) then
|
||||
if not disabled and mode:find(xmode) then
|
||||
local desc = "%s - %s" % {sname, mode}
|
||||
o:value(sname, desc)
|
||||
end
|
||||
end)
|
||||
o:value("", "<unset>")
|
||||
o.default = ""
|
||||
end
|
||||
|
||||
function values_serverlist(o)
|
||||
|
|
Loading…
Reference in a new issue