diff options
Diffstat (limited to 'applications/luci-app-firewall/luasrc')
3 files changed, 33 insertions, 2 deletions
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua index 39895c6f0d..d51f8fb79b 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua @@ -89,6 +89,10 @@ o.rmempty = true o.datatype = "neg(portrange)" o.placeholder = translate("any") +o:depends("proto", "tcp") +o:depends("proto", "udp") +o:depends("proto", "tcp udp") +o:depends("proto", "tcpudp") o = s:option(Value, "src_dip", translate("External IP address"), @@ -109,7 +113,10 @@ o = s:option(Value, "src_dport", translate("External port"), "destination port or port range on this host")) o.datatype = "neg(portrange)" - +o:depends("proto", "tcp") +o:depends("proto", "udp") +o:depends("proto", "tcp udp") +o:depends("proto", "tcpudp") o = s:option(Value, "dest", translate("Internal zone")) o.nocreate = true @@ -134,6 +141,10 @@ o = s:option(Value, "dest_port", o.placeholder = translate("any") o.datatype = "portrange" +o:depends("proto", "tcp") +o:depends("proto", "udp") +o:depends("proto", "tcp udp") +o:depends("proto", "tcpudp") o = s:option(Flag, "reflection", translate("Enable NAT Loopback")) o.rmempty = true diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua index e61ce73cdd..5485ebf096 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/forwards.lua @@ -54,7 +54,7 @@ function s.parse(self, ...) if created then m.uci:save("firewall") luci.http.redirect(ds.build_url( - "admin/network/firewall/redirect", created + "admin/network/firewall/forwards", created )) end end diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua index fffa64dad7..b57201041d 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua @@ -115,6 +115,10 @@ elseif rule_type == "redirect" then o.datatype = "neg(portrange)" o.placeholder = translate("any") + o:depends("proto", "tcp") + o:depends("proto", "udp") + o:depends("proto", "tcp udp") + o:depends("proto", "tcpudp") o = s:option(Value, "dest", translate("Destination zone")) o.nocreate = true @@ -139,6 +143,10 @@ elseif rule_type == "redirect" then o.placeholder = translate("any") o.datatype = "neg(portrange)" + o:depends("proto", "tcp") + o:depends("proto", "udp") + o:depends("proto", "tcp udp") + o:depends("proto", "tcpudp") o = s:option(Value, "src_dip", translate("SNAT IP address"), @@ -163,6 +171,10 @@ elseif rule_type == "redirect" then o.rmempty = true o.placeholder = translate('Do not rewrite') + o:depends("proto", "tcp") + o:depends("proto", "udp") + o:depends("proto", "tcp udp") + o:depends("proto", "tcpudp") s:option(Value, "extra", translate("Extra arguments"), @@ -281,6 +293,10 @@ else o.datatype = "list(neg(portrange))" o.placeholder = translate("any") + o:depends("proto", "tcp") + o:depends("proto", "udp") + o:depends("proto", "tcp udp") + o:depends("proto", "tcpudp") o = s:option(Value, "dest_local", translate("Output zone")) o.nocreate = true @@ -312,6 +328,10 @@ else o.datatype = "list(neg(portrange))" o.placeholder = translate("any") + o:depends("proto", "tcp") + o:depends("proto", "udp") + o:depends("proto", "tcp udp") + o:depends("proto", "tcpudp") o = s:option(ListValue, "target", translate("Action")) o.default = "ACCEPT" |