| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- 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 and custom update settings"))
- s.anonymous = true
- -- o = s:option(Flag, "monitor_enable", translate("Enable Process Deamon"))
- -- o.rmempty = false
- -- o.default = "1"
- o = s:option(Flag, "enable_switch", translate("Enable Auto Switch"))
- o.rmempty = false
- o.default = "1"
- o = s:option(Value, "switch_time", translate("Switch check cycly(second)"))
- o.datatype = "uinteger"
- o:depends("enable_switch", "1")
- o.default = 667
- 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
- o = s:option(Flag, "adblock", translate("Enable adblock"))
- o.rmempty = false
- o = s:option(Value, "adblock_url", translate("adblock_url"))
- o:value("https://ghproxy.com/https://raw.githubusercontent.com/neodevpro/neodevhost/master/lite_host_dnsmasq.conf", translate("NEO DEV HOST Lite"))
- o:value("https://ghproxy.com/https://raw.githubusercontent.com/neodevpro/neodevhost/master/host_dnsmasq.conf", translate("NEO DEV HOST Full"))
- o:value("https://ghproxy.com/https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/adblock-for-dnsmasq.conf", translate("anti-AD"))
- o.default = "https://ghproxy.com/https://raw.githubusercontent.com/neodevpro/neodevhost/master/lite_host_dnsmasq.conf"
- o:depends("adblock", "1")
- o.description = translate("Support AdGuardHome and DNSMASQ format list")
- o = s:option(Value, "gfwlist_url", translate("gfwlist Update url"))
- o:value("https://ghproxy.com/https://raw.githubusercontent.com/YW5vbnltb3Vz/domain-list-community/release/gfwlist.txt", translate("v2fly/domain-list-community"))
- o:value("https://ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/gfw.txt", translate("Loyalsoldier/v2ray-rules-dat"))
- o:value("https://ghproxy.com/https://raw.githubusercontent.com/Loukky/gfwlist-by-loukky/master/gfwlist.txt", translate("Loukky/gfwlist-by-loukky"))
- o:value("https://ghproxy.com/https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt", translate("gfwlist/gfwlist"))
- o.default = "https://ghproxy.com/https://raw.githubusercontent.com/YW5vbnltb3Vz/domain-list-community/release/gfwlist.txt"
- o = s:option(Value, "chnroute_url", translate("Chnroute Update url"))
- o:value("https://ispip.clang.cn/all_cn.txt", translate("Clang.CN"))
- o:value("https://ispip.clang.cn/all_cn_cidr.txt", translate("Clang.CN.CIDR"))
- o.default = "https://ispip.clang.cn/all_cn.txt"
- o = s:option(Value, "nfip_url", translate("nfip_url"))
- o:value("https://ghproxy.com/https://raw.githubusercontent.com/QiuSimons/Netflix_IP/master/NF_only.txt", translate("Netflix IP Only"))
- o:value("https://ghproxy.com/https://raw.githubusercontent.com/QiuSimons/Netflix_IP/master/getflix.txt", translate("Netflix and AWS"))
- o.default = "https://ghproxy.com/https://raw.githubusercontent.com/QiuSimons/Netflix_IP/master/NF_only.txt"
- o.description = translate("Customize Netflix IP Url")
- o = s:option(Button, "reset", translate("Reset to defaults"))
- o.rawhtml = true
- o.template = "shadowsocksr/reset"
- -- [[ SOCKS5 Proxy ]]--
- s = m:section(TypedSection, "socks5_proxy", translate("Global SOCKS5 Proxy Server"))
- s.anonymous = true
- o = s:option(ListValue, "server", translate("Server"))
- o:value("nil", translate("Disable"))
- o:value("same", translate("Same as Global Server"))
- 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
- return m
|