small-package/luci-app-godproxy/luasrc/model/cbi/koolproxy/control.lua

44 lines
1.3 KiB
Lua
Raw Normal View History

2021-11-10 09:01:15 +08:00
o = Map("koolproxy")
2021-11-30 20:26:09 +08:00
t = o:section(TypedSection, "acl_rule", translate("iKoolProxy 访问控制"))
2021-11-10 09:01:15 +08:00
t.anonymous = true
t.description = translate("访问控制列表是用于指定特殊IP过滤模式的工具如为已安装证书的客户端开启https广告过滤等MAC或者IP必须填写其中一项。")
t.template = "cbi/tblsection"
t.sortable = true
t.addremove = true
e = t:option(Value, "remarks", translate("客户端备注"))
e.rmempty = true
e.width = "30%"
2021-11-13 08:59:03 +08:00
e = t:option(Value, "ipaddr", translate("内部 IP 地址"))
2021-11-10 09:01:15 +08:00
e.width = "20%"
e.datatype = "ip4addr"
luci.ip.neighbors({family = 4}, function(neighbor)
if neighbor.reachable then
e:value(neighbor.dest:string(), "%s (%s)" %{neighbor.dest:string(), neighbor.mac})
end
end)
2021-11-13 08:59:03 +08:00
e = t:option(Value,"mac",translate("MAC 地址"))
e.width = "20%"
e.rmempty = true
e.datatype = "macaddr"
luci.ip.neighbors({family = 4}, function(neighbor)
if neighbor.reachable then
e:value(neighbor.mac, "%s (%s)" %{neighbor.mac, neighbor.dest:string()})
end
end)
2021-11-10 09:01:15 +08:00
e = t:option(ListValue, "proxy_mode", translate("访问控制"))
e.rmempty = false
e.width = "20%"
e:value(0,translate("不过滤"))
2021-11-15 09:01:09 +08:00
e:value(1,translate("过滤HTTP协议"))
e:value(2,translate("过滤HTTP(S)协议"))
2021-11-10 09:01:15 +08:00
e:value(3,translate("过滤全端口"))
e.default = 1
return o