summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-12-16 01:43:17 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-12-16 01:43:17 +0000
commit9847037963b0508d5da46afb763b7be4975cc094 (patch)
treed954f3c92d84f5ffbde47a470bcbfdac622479f8
parent41469346de810a222033ba2e0b0f691d9bb7967f (diff)
luci-0.10: merge r8096, r8097 and r8098
-rw-r--r--applications/luci-firewall/luasrc/model/cbi/luci_fw/zone.lua4
-rw-r--r--libs/web/htdocs/luci-static/resources/cbi.js5
-rw-r--r--libs/web/luasrc/cbi/datatypes.lua4
3 files changed, 11 insertions, 2 deletions
diff --git a/applications/luci-firewall/luasrc/model/cbi/luci_fw/zone.lua b/applications/luci-firewall/luasrc/model/cbi/luci_fw/zone.lua
index 2bcb9a9802..8c9c09102f 100644
--- a/applications/luci-firewall/luasrc/model/cbi/luci_fw/zone.lua
+++ b/applications/luci-firewall/luasrc/model/cbi/luci_fw/zone.lua
@@ -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")
diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js
index 123e8e1aba..d1e34d1786 100644
--- a/libs/web/htdocs/luci-static/resources/cbi.js
+++ b/libs/web/htdocs/luci-static/resources/cbi.js
@@ -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 )
diff --git a/libs/web/luasrc/cbi/datatypes.lua b/libs/web/luasrc/cbi/datatypes.lua
index 3c768ab762..93b29cba81 100644
--- a/libs/web/luasrc/cbi/datatypes.lua
+++ b/libs/web/luasrc/cbi/datatypes.lua
@@ -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)