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 2bcb9a9802e70823af036c96fbba9ba78d9a11e1..8c9c09102fda90aa23d8460a88364fa884e7b1b2 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 123e8e1aba77f293107aff30acb2688c5759d929..d1e34d1786035b24489d96a0c3f12e1408bc923b 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 3c768ab7623e03885eb8a3b735541d7b1a0d2e5e..93b29cba81d2c54afaae2479417f74551a2a8704 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)