From: Yousong Zhou Date: Tue, 22 Aug 2017 01:50:10 +0000 (+0800) Subject: luci-app-shadowsocks-libev: tweak list of redir instances X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fd085d991097bef73221ada9b8fec09d4da8b55f;p=oweals%2Fluci.git luci-app-shadowsocks-libev: tweak list of redir instances - Skip disabled ones - Allow empty value Signed-off-by: Yousong Zhou --- diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua index 650ff6356..e2a07adae 100644 --- a/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua +++ b/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua @@ -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("", "") + o.default = "" end function values_serverlist(o)