applications/luci-firewall: support local destination in rules, add placeholders
This commit is contained in:
parent
d26ceda459
commit
447cc08a8a
2 changed files with 14 additions and 4 deletions
|
@ -92,8 +92,7 @@ toport = s:taboption("general", Value, "dest_port", translate("Internal port (op
|
|||
translate("Redirect matched incoming traffic to the given port on " ..
|
||||
"the internal host"))
|
||||
toport.optional = true
|
||||
toport.size = 5
|
||||
|
||||
toport.placeholder = "0-65535"
|
||||
|
||||
target = s:taboption("advanced", ListValue, "target", translate("Redirection type"))
|
||||
target:value("DNAT")
|
||||
|
@ -113,20 +112,24 @@ src_dip = s:taboption("advanced", Value, "src_dip",
|
|||
|
||||
src_dip.optional = true
|
||||
src_dip.datatype = "ip4addr"
|
||||
src_dip.placeholder = translate("any")
|
||||
|
||||
src_mac = s:taboption("advanced", Value, "src_mac", translate("Source MAC address"))
|
||||
src_mac.optional = true
|
||||
src_mac.datatype = "macaddr"
|
||||
src_mac.placeholder = translate("any")
|
||||
|
||||
src_ip = s:taboption("advanced", Value, "src_ip", translate("Source IP address"))
|
||||
src_ip.optional = true
|
||||
src_ip.datatype = "ip4addr"
|
||||
src_ip.placeholder = translate("any")
|
||||
|
||||
sport = s:taboption("advanced", Value, "src_port", translate("Source port"),
|
||||
translate("Match incoming traffic originating from the given " ..
|
||||
"source port or port range on the client host"))
|
||||
sport.optional = true
|
||||
sport.datatype = "portrange"
|
||||
sport.placeholder = "0-65536"
|
||||
sport:depends("proto", "tcp")
|
||||
sport:depends("proto", "udp")
|
||||
sport:depends("proto", "tcpudp")
|
||||
|
|
|
@ -53,7 +53,7 @@ src.template = "cbi/firewall_zonelist"
|
|||
|
||||
dest = s:taboption("advanced", Value, "dest", translate("Destination zone"))
|
||||
dest.nocreate = true
|
||||
dest.default = "lan"
|
||||
dest.allowlocal = true
|
||||
dest.template = "cbi/firewall_zonelist"
|
||||
|
||||
proto = s:taboption("general", Value, "proto", translate("Protocol"))
|
||||
|
@ -107,10 +107,12 @@ icmpt:value("address-mask-reply")
|
|||
src_ip = s:taboption("general", Value, "src_ip", translate("Source address"))
|
||||
src_ip.optional = true
|
||||
src_ip.datatype = has_v2 and "ipaddr" or "ip4addr"
|
||||
src_ip.placeholder = translate("any")
|
||||
|
||||
sport = s:taboption("general", Value, "src_port", translate("Source port"))
|
||||
sport.optional = true
|
||||
sport.datatype = "portrange"
|
||||
sport.placeholder = "0-65535"
|
||||
sport:depends("proto", "tcp")
|
||||
sport:depends("proto", "udp")
|
||||
sport:depends("proto", "tcpudp")
|
||||
|
@ -118,6 +120,7 @@ sport:depends("proto", "tcpudp")
|
|||
dest_ip = s:taboption("general", Value, "dest_ip", translate("Destination address"))
|
||||
dest_ip.optional = true
|
||||
dest_ip.datatype = has_v2 and "ipaddr" or "ip4addr"
|
||||
dest_ip.placeholder = translate("any")
|
||||
|
||||
dport = s:taboption("general", Value, "dest_port", translate("Destination port"))
|
||||
dport.optional = true
|
||||
|
@ -125,6 +128,7 @@ dport.datatype = "portrange"
|
|||
dport:depends("proto", "tcp")
|
||||
dport:depends("proto", "udp")
|
||||
dport:depends("proto", "tcpudp")
|
||||
dport.placeholder = "0-65535"
|
||||
|
||||
jump = s:taboption("general", ListValue, "target", translate("Action"))
|
||||
jump.rmempty = true
|
||||
|
@ -134,7 +138,10 @@ jump:value("ACCEPT", translate("accept"))
|
|||
jump:value("REJECT", translate("reject"))
|
||||
|
||||
|
||||
s:taboption("advanced", Value, "src_mac", translate("Source MAC-address")).optional = true
|
||||
smac = s:taboption("advanced", Value, "src_mac", translate("Source MAC address"))
|
||||
smac.optional = true
|
||||
smac.datatype = "macaddr"
|
||||
smac.placeholder = translate("any")
|
||||
|
||||
if has_v2 then
|
||||
family = s:taboption("advanced", ListValue, "family", translate("Restrict to address family"))
|
||||
|
|
Loading…
Reference in a new issue