diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2017-08-22 09:50:10 +0800 |
---|---|---|
committer | Yousong Zhou <yszhou4tech@gmail.com> | 2017-08-22 20:19:49 +0800 |
commit | fd085d991097bef73221ada9b8fec09d4da8b55f (patch) | |
tree | 6f75da3237562abf9adfc494043b56e6c0ba28a5 | |
parent | 56e9ac6642c580cdd121e1bcd0f3bbd924c44dd0 (diff) |
luci-app-shadowsocks-libev: tweak list of redir instances
- Skip disabled ones
- Allow empty value
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
-rw-r--r-- | applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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("", "<unset>") + o.default = "" end function values_serverlist(o) |