luci-0.10: merge r8096, r8097 and r8098
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 16 Dec 2011 01:43:17 +0000 (01:43 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 16 Dec 2011 01:43:17 +0000 (01:43 +0000)
applications/luci-firewall/luasrc/model/cbi/luci_fw/zone.lua
libs/web/htdocs/luci-static/resources/cbi.js
libs/web/luasrc/cbi/datatypes.lua

index 2bcb9a9..8c9c091 100644 (file)
@@ -129,7 +129,7 @@ msrc = s:taboption("advanced", DynamicList, "masq_src",
        translate("Restrict Masquerading to given source subnets"))
 
 msrc.optional = true
-msrc.datatype = "neg_network_ip4addr"
+msrc.datatype = "neg(network)"
 msrc.placeholder = "0.0.0.0/0"
 msrc:depends("family", "")
 msrc:depends("family", "ipv4")
@@ -138,7 +138,7 @@ mdest = s:taboption("advanced", DynamicList, "masq_dest",
        translate("Restrict Masquerading to given destination subnets"))
 
 mdest.optional = true
-mdest.datatype = "neg_network_ip4addr"
+mdest.datatype = "neg(network)"
 mdest.placeholder = "0.0.0.0/0"
 mdest:depends("family", "")
 mdest:depends("family", "ipv4")
index 123e8e1..d1e34d1 100644 (file)
@@ -159,6 +159,11 @@ var cbi_validators = {
                return false;
        },
 
+       'network': function(v)
+       {
+               return cbi_validators.uciname(v) || cbi_validators.host(v);
+       },
+
        'wpakey': function(v)
        {
                if( v.length == 64 )
index 3c768ab..93b29cb 100644 (file)
@@ -154,6 +154,10 @@ function host(val)
        return hostname(val) or ipaddr(val)
 end
 
+function network(val)
+       return uciname(val) or host(val)
+end
+
 function wpakey(val)
        if #val == 64 then
                return (val:match("^[a-fA-F0-9]+$") ~= nil)