Skip to content

Commit

Permalink
add running status for ss
Browse files Browse the repository at this point in the history
  • Loading branch information
aa65535 committed Dec 31, 2015
1 parent 656829f commit 9dd138b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
Binary file modified files/luci/i18n/shadowsocks.zh-cn.lmo
Binary file not shown.
27 changes: 18 additions & 9 deletions files/luci/i18n/shadowsocks.zh-cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,29 @@ msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgid "ShadowSocks"
msgstr "ShadowSocks"

msgid "A lightweight secured SOCKS5 proxy"
msgstr "一个轻量级安全SOCKS5代理"

msgid "Enable"
msgstr "启用"

msgid "Disable"
msgstr "停用"

msgid "ShadowSocks is running"
msgstr "ShadowSocks 运行中"
msgid "Running Status"
msgstr "运行状态"

msgid "Transparent Proxy"
msgstr "透明代理"

msgid "UDP Forward"
msgstr "UDP转发"

msgid "ShadowSocks is not running"
msgstr "ShadowSocks 未运行"
msgid "RUNNING"
msgstr "运行中"

msgid "NOT RUNNING"
msgstr "未运行"

msgid "Global Setting"
msgstr "全局设置"
Expand All @@ -25,8 +37,8 @@ msgstr "全局服务器"
msgid "Disable ShadowSocks"
msgstr "停用ShadowSocks"

msgid "UDP Relay Server"
msgstr "UDP中继服务器"
msgid "UDP-Relay Server"
msgstr "UDP服务器"

msgid "Same as Global Server"
msgstr "与全局服务器相同"
Expand Down Expand Up @@ -58,9 +70,6 @@ msgstr "密码"
msgid "Encrypt Method"
msgstr "加密方式"

msgid "UDP Forward"
msgstr "UDP转发"

msgid "UDP Local Port"
msgstr "UDP本地端口"

Expand Down
28 changes: 21 additions & 7 deletions files/luci/model/cbi/shadowsocks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ local shadowsocks = "shadowsocks"
local uci = luci.model.uci.cursor()
local ipkg = require("luci.model.ipkg")

if luci.sys.call("pidof ss-redir >/dev/null") == 0 then
m = Map(shadowsocks, translate("ShadowSocks"), translate("ShadowSocks is running"))
else
m = Map(shadowsocks, translate("ShadowSocks"), translate("ShadowSocks is not running"))
end

local chnroute = uci:get_first("chinadns", "chinadns", "chnroute")
local server_table = {}
local arp_table = luci.sys.net.arptable() or {}
Expand Down Expand Up @@ -49,6 +43,26 @@ uci:foreach(shadowsocks, "servers", function(s)
end
end)

m = Map(shadowsocks, translate("ShadowSocks"), translate("A lightweight secured SOCKS5 proxy"))

-- [[ Running Status ]]--
s = m:section(TypedSection, "global", translate("Running Status"))
s.anonymous = true

o = s:option(DummyValue, "_status", translate("Transparent Proxy"))
if luci.sys.call("pidof ss-redir >/dev/null") == 0 then
o.value = translate("RUNNING")
else
o.value = translate("NOT RUNNING")
end

o = s:option(DummyValue, "_status", translate("UDP Forward"))
if luci.sys.call("pidof ss-tunnel >/dev/null") == 0 then
o.value = translate("RUNNING")
else
o.value = translate("NOT RUNNING")
end

-- [[ Global Setting ]]--
s = m:section(TypedSection, "global", translate("Global Setting"))
s.anonymous = true
Expand All @@ -59,7 +73,7 @@ for k, v in pairs(server_table) do o:value(k, v) end
o.default = "nil"
o.rmempty = false

o = s:option(ListValue, "udp_relay_server", translate("UDP Relay Server"))
o = s:option(ListValue, "udp_relay_server", translate("UDP-Relay Server"))
o:value("", translate("Disable"))
o:value("same", translate("Same as Global Server"))
for k, v in pairs(server_table) do o:value(k, v) end
Expand Down

0 comments on commit 9dd138b

Please sign in to comment.