coolsnowwolf e575061c57 Revert "move lean packages to my packages feed"
This reverts commit 510d2c3e466e953eba52c1a7c4e1d423ee10e21f.
2018-10-19 13:06:16 +08:00

50 lines
1.3 KiB
Lua

local shadowsocksr = "shadowsocksr"
local uci = luci.model.uci.cursor()
local server_table = {}
uci:foreach(shadowsocksr, "servers", function(s)
if s.alias then
server_table[s[".name"]] = s.alias
elseif s.server and s.server_port then
server_table[s[".name"]] = "%s:%s" %{s.server, s.server_port}
end
end)
m = Map(shadowsocksr)
s = m:section(TypedSection, "global", translate("Server failsafe auto swith settings"))
s.anonymous = true
o = s:option(Flag, "enable_switch", translate("Enable Auto Switch"))
o.rmempty = false
o = s:option(Value, "switch_time", translate("Switch check cycly(second)"))
o.datatype = "uinteger"
o:depends("enable_switch", "1")
o.default = 3600
o = s:option(Value, "switch_timeout", translate("Check timout(second)"))
o.datatype = "uinteger"
o:depends("enable_switch", "1")
o.default = 5
-- o = s:option(Flag, "monitor_enable", translate("Enable Process Deamon"))
-- o.rmempty = false
-- [[ SOCKS5 Proxy ]]--
s = m:section(TypedSection, "socks5_proxy", translate("SOCKS5 Proxy"))
s.anonymous = true
o = s:option(ListValue, "server", translate("Server"))
o:value("nil", translate("Disable"))
for k, v in pairs(server_table) do o:value(k, v) end
o.default = "nil"
o.rmempty = false
o = s:option(Value, "local_port", translate("Local Port"))
o.datatype = "port"
o.default = 1080
o.rmempty = false
return m