|
@@ -1,5 +1,6 @@
|
|
|
|
+require "luci.ip"
|
|
|
|
+require "nixio.fs"
|
|
local m, s, o
|
|
local m, s, o
|
|
-local NXFS = require "nixio.fs"
|
|
|
|
|
|
|
|
m = Map("shadowsocksr", translate("IP black-and-white list"))
|
|
m = Map("shadowsocksr", translate("IP black-and-white list"))
|
|
|
|
|
|
@@ -27,9 +28,9 @@ o.rmempty = false
|
|
o = s:taboption("lan_ac", DynamicList, "lan_ac_ips", translate("LAN Host List"))
|
|
o = s:taboption("lan_ac", DynamicList, "lan_ac_ips", translate("LAN Host List"))
|
|
o.datatype = "ipaddr"
|
|
o.datatype = "ipaddr"
|
|
luci.ip.neighbors({ family = 4 }, function(entry)
|
|
luci.ip.neighbors({ family = 4 }, function(entry)
|
|
- if entry.reachable then
|
|
|
|
- o:value(entry.dest:string())
|
|
|
|
- end
|
|
|
|
|
|
+ if entry.reachable then
|
|
|
|
+ o:value(entry.dest:string())
|
|
|
|
+ end
|
|
end)
|
|
end)
|
|
o:depends("lan_ac_mode", "w")
|
|
o:depends("lan_ac_mode", "w")
|
|
o:depends("lan_ac_mode", "b")
|
|
o:depends("lan_ac_mode", "b")
|
|
@@ -37,25 +38,25 @@ o:depends("lan_ac_mode", "b")
|
|
o = s:taboption("lan_ac", DynamicList, "lan_bp_ips", translate("LAN Bypassed Host List"))
|
|
o = s:taboption("lan_ac", DynamicList, "lan_bp_ips", translate("LAN Bypassed Host List"))
|
|
o.datatype = "ipaddr"
|
|
o.datatype = "ipaddr"
|
|
luci.ip.neighbors({ family = 4 }, function(entry)
|
|
luci.ip.neighbors({ family = 4 }, function(entry)
|
|
- if entry.reachable then
|
|
|
|
- o:value(entry.dest:string())
|
|
|
|
- end
|
|
|
|
|
|
+ if entry.reachable then
|
|
|
|
+ o:value(entry.dest:string())
|
|
|
|
+ end
|
|
end)
|
|
end)
|
|
|
|
|
|
o = s:taboption("lan_ac", DynamicList, "lan_fp_ips", translate("LAN Force Proxy Host List"))
|
|
o = s:taboption("lan_ac", DynamicList, "lan_fp_ips", translate("LAN Force Proxy Host List"))
|
|
o.datatype = "ipaddr"
|
|
o.datatype = "ipaddr"
|
|
luci.ip.neighbors({ family = 4 }, function(entry)
|
|
luci.ip.neighbors({ family = 4 }, function(entry)
|
|
- if entry.reachable then
|
|
|
|
- o:value(entry.dest:string())
|
|
|
|
- end
|
|
|
|
|
|
+ if entry.reachable then
|
|
|
|
+ o:value(entry.dest:string())
|
|
|
|
+ end
|
|
end)
|
|
end)
|
|
|
|
|
|
o = s:taboption("lan_ac", DynamicList, "lan_gm_ips", translate("Game Mode Host List"))
|
|
o = s:taboption("lan_ac", DynamicList, "lan_gm_ips", translate("Game Mode Host List"))
|
|
o.datatype = "ipaddr"
|
|
o.datatype = "ipaddr"
|
|
luci.ip.neighbors({ family = 4 }, function(entry)
|
|
luci.ip.neighbors({ family = 4 }, function(entry)
|
|
- if entry.reachable then
|
|
|
|
- o:value(entry.dest:string())
|
|
|
|
- end
|
|
|
|
|
|
+ if entry.reachable then
|
|
|
|
+ o:value(entry.dest:string())
|
|
|
|
+ end
|
|
end)
|
|
end)
|
|
|
|
|
|
-- Part of Self
|
|
-- Part of Self
|
|
@@ -66,73 +67,67 @@ end)
|
|
-- o:value("2", translatef("Forwarded Proxy"))
|
|
-- o:value("2", translatef("Forwarded Proxy"))
|
|
-- o.rmempty = false
|
|
-- o.rmempty = false
|
|
|
|
|
|
-s:tab("esc", translate("Bypass Domain List"))
|
|
|
|
-
|
|
|
|
-local escconf = "/etc/config/white.list"
|
|
|
|
|
|
+s:tab("esc", translate("Bypass Domain List"))
|
|
|
|
+local escconf = "/etc/ssr/white.list"
|
|
o = s:taboption("esc", TextValue, "escconf")
|
|
o = s:taboption("esc", TextValue, "escconf")
|
|
o.rows = 13
|
|
o.rows = 13
|
|
o.wrap = "off"
|
|
o.wrap = "off"
|
|
o.rmempty = true
|
|
o.rmempty = true
|
|
o.cfgvalue = function(self, section)
|
|
o.cfgvalue = function(self, section)
|
|
- return NXFS.readfile(escconf) or ""
|
|
|
|
|
|
+ return nixio.fs.readfile(escconf) or ""
|
|
end
|
|
end
|
|
o.write = function(self, section, value)
|
|
o.write = function(self, section, value)
|
|
- NXFS.writefile(escconf, value:gsub("\r\n", "\n"))
|
|
|
|
|
|
+ nixio.fs.writefile(escconf, value:gsub("\r\n", "\n"))
|
|
end
|
|
end
|
|
o.remove = function(self, section, value)
|
|
o.remove = function(self, section, value)
|
|
- NXFS.writefile(escconf, "")
|
|
|
|
|
|
+ nixio.fs.writefile(escconf, "")
|
|
end
|
|
end
|
|
|
|
|
|
-
|
|
|
|
-s:tab("block", translate("Black Domain List"))
|
|
|
|
-
|
|
|
|
-local blockconf = "/etc/config/black.list"
|
|
|
|
|
|
+s:tab("block", translate("Black Domain List"))
|
|
|
|
+local blockconf = "/etc/ssr/black.list"
|
|
o = s:taboption("block", TextValue, "blockconf")
|
|
o = s:taboption("block", TextValue, "blockconf")
|
|
o.rows = 13
|
|
o.rows = 13
|
|
o.wrap = "off"
|
|
o.wrap = "off"
|
|
o.rmempty = true
|
|
o.rmempty = true
|
|
o.cfgvalue = function(self, section)
|
|
o.cfgvalue = function(self, section)
|
|
- return NXFS.readfile(blockconf) or " "
|
|
|
|
|
|
+ return nixio.fs.readfile(blockconf) or " "
|
|
end
|
|
end
|
|
o.write = function(self, section, value)
|
|
o.write = function(self, section, value)
|
|
- NXFS.writefile(blockconf, value:gsub("\r\n", "\n"))
|
|
|
|
|
|
+ nixio.fs.writefile(blockconf, value:gsub("\r\n", "\n"))
|
|
end
|
|
end
|
|
o.remove = function(self, section, value)
|
|
o.remove = function(self, section, value)
|
|
- NXFS.writefile(blockconf, "")
|
|
|
|
|
|
+ nixio.fs.writefile(blockconf, "")
|
|
end
|
|
end
|
|
-
|
|
|
|
-s:tab("netflix", translate("Netflix Domain List"))
|
|
|
|
-
|
|
|
|
-local netflixconf = "/etc/config/netflix.list"
|
|
|
|
|
|
+s:tab("netflix", translate("Netflix Domain List"))
|
|
|
|
+local netflixconf = "/etc/ssr/netflix.list"
|
|
o = s:taboption("netflix", TextValue, "netflixconf")
|
|
o = s:taboption("netflix", TextValue, "netflixconf")
|
|
o.rows = 13
|
|
o.rows = 13
|
|
o.wrap = "off"
|
|
o.wrap = "off"
|
|
o.rmempty = true
|
|
o.rmempty = true
|
|
o.cfgvalue = function(self, section)
|
|
o.cfgvalue = function(self, section)
|
|
- return NXFS.readfile(netflixconf) or " "
|
|
|
|
|
|
+ return nixio.fs.readfile(netflixconf) or " "
|
|
end
|
|
end
|
|
o.write = function(self, section, value)
|
|
o.write = function(self, section, value)
|
|
- NXFS.writefile(netflixconf, value:gsub("\r\n", "\n"))
|
|
|
|
|
|
+ nixio.fs.writefile(netflixconf, value:gsub("\r\n", "\n"))
|
|
end
|
|
end
|
|
o.remove = function(self, section, value)
|
|
o.remove = function(self, section, value)
|
|
- NXFS.writefile(netflixconf, "")
|
|
|
|
|
|
+ nixio.fs.writefile(netflixconf, "")
|
|
end
|
|
end
|
|
|
|
|
|
-s:tab("netflixip", translate("Netflix IP List"))
|
|
|
|
-
|
|
|
|
-local netflixipconf = "/etc/config/netflixip.list"
|
|
|
|
|
|
+s:tab("netflixip", translate("Netflix IP List"))
|
|
|
|
+local netflixipconf = "/etc/ssr/netflixip.list"
|
|
o = s:taboption("netflixip", TextValue, "netflixipconf")
|
|
o = s:taboption("netflixip", TextValue, "netflixipconf")
|
|
o.rows = 13
|
|
o.rows = 13
|
|
o.wrap = "off"
|
|
o.wrap = "off"
|
|
o.rmempty = true
|
|
o.rmempty = true
|
|
o.cfgvalue = function(self, section)
|
|
o.cfgvalue = function(self, section)
|
|
- return NXFS.readfile(netflixipconf) or " "
|
|
|
|
|
|
+ return nixio.fs.readfile(netflixipconf) or " "
|
|
end
|
|
end
|
|
o.write = function(self, section, value)
|
|
o.write = function(self, section, value)
|
|
- NXFS.writefile(netflixipconf, value:gsub("\r\n", "\n"))
|
|
|
|
|
|
+ nixio.fs.writefile(netflixipconf, value:gsub("\r\n", "\n"))
|
|
end
|
|
end
|
|
o.remove = function(self, section, value)
|
|
o.remove = function(self, section, value)
|
|
- NXFS.writefile(netflixipconf, "")
|
|
|
|
|
|
+ nixio.fs.writefile(netflixipconf, "")
|
|
end
|
|
end
|
|
|
|
|
|
return m
|
|
return m
|