applications/luci-firewall: some fixes on redirection page
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 20 Nov 2010 17:23:44 +0000 (17:23 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 20 Nov 2010 17:23:44 +0000 (17:23 +0000)
applications/luci-firewall/luasrc/model/cbi/luci_fw/rrule.lua

index 5769c1da0c153ce58be8ad2299bc8a9273a41e5c..65e3e5816dc0a897937073ac88e350eef6d9381b 100644 (file)
@@ -66,7 +66,7 @@ src.nocreate = true
 src.default = "wan"
 src.template = "cbi/firewall_zonelist"
 
-proto = s:taboption("general", ListValue, "proto", translate("Protocol"))
+proto = s:taboption("general", Value, "proto", translate("Protocol"))
 proto.optional = true
 proto:value("tcpudp", "TCP+UDP")
 proto:value("tcp", "TCP")
@@ -93,6 +93,10 @@ toport = s:taboption("general", Value, "dest_port", translate("Internal port (op
                "the internal host"))
 toport.optional = true
 toport.placeholder = "0-65535"
+toport.datatype = "portrange"
+toport:depends("proto", "tcp")
+toport:depends("proto", "udp")
+toport:depends("proto", "tcpudp")
 
 target = s:taboption("advanced", ListValue, "target", translate("Redirection type"))
 target:value("DNAT")