mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-07-06 08:17:06 +08:00

* v2ray-core:Add v2ray-core self compilation Network ---> Project V ---> <*> v2ray-core You can custom the features in "V2Ray Configuration" option. * luci-app-ssr-plus 0.Add v2ray-core 1.Makefile Standard install 2.Fix vmess v2ray 3.Optimize update scripts 4.Add ad filter (not enabled) 5.Code formatting 6.Clear basic data * luci-app-ssr-plus:Add ad filter settings UI * luci-app-ssr-plus:Fix Filter invalid nodes * luci-app-ssr-plus:update china_ssr.txt * luci-app-ssr-plus:Fix
70 lines
1.9 KiB
Lua
70 lines
1.9 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]:%s" %{string.upper(s.type), s.alias}
|
|
elseif s.server and s.server_port then
|
|
server_table[s[".name"]] = "[%s]:%s:%s" %{string.upper(s.type), s.server, s.server_port}
|
|
end
|
|
end)
|
|
|
|
local key_table = {}
|
|
for key,_ in pairs(server_table) do
|
|
table.insert(key_table,key)
|
|
end
|
|
|
|
table.sort(key_table)
|
|
m = Map(shadowsocksr)
|
|
-- [[ global ]]--
|
|
s = m:section(TypedSection, "global", translate("Server failsafe auto swith settings"))
|
|
s.anonymous = true
|
|
|
|
o = s:option(Flag, "monitor_enable", translate("Enable Process Deamon"))
|
|
o.rmempty = false
|
|
|
|
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(Value, "switch_try_count", translate("Check Try Count"))
|
|
o.datatype = "uinteger"
|
|
o:depends("enable_switch", "1")
|
|
o.default = 3
|
|
|
|
-- [[ adblock ]]--
|
|
s = m:section(TypedSection, "global", translate("adblock settings"))
|
|
s.anonymous = true
|
|
|
|
o = s:option(Flag, "adblock", translate("Enable adblock"))
|
|
o.rmempty = false
|
|
|
|
-- [[ SOCKS5 Proxy ]]--
|
|
if nixio.fs.access("/usr/bin/ssr-local") then
|
|
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 _,key in pairs(key_table) do o:value(key,server_table[key]) 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
|
|
|
|
end
|
|
return m
|