luci-app-shadowsocks-libev: display disabled state of remote server
authorYousong Zhou <yszhou4tech@gmail.com>
Fri, 25 Aug 2017 07:40:49 +0000 (15:40 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Thu, 4 Jan 2018 06:40:09 +0000 (14:40 +0800)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua

index 7ba6b40..c0e9435 100644 (file)
@@ -42,7 +42,8 @@ function values_serverlist(o)
                local server = sdata["server"]
                local server_port = sdata["server_port"]
                if server and server_port then
-                       local desc = "%s - %s:%s" % {sname, sdata["server"], sdata["server_port"]}
+                       local disabled = ucival_to_bool(sdata[".disabled"]) and " - disabled" or ""
+                       local desc = "%s - %s:%s%s" % {sname, server, server_port, disabled}
                        o:value(sname, desc)
                end
        end)