From: Jo-Philipp Wich Date: Fri, 16 Dec 2011 01:43:17 +0000 (+0000) Subject: luci-0.10: merge r8096, r8097 and r8098 X-Git-Tag: 0.10.0~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9847037963b0508d5da46afb763b7be4975cc094;p=oweals%2Fluci.git luci-0.10: merge r8096, r8097 and r8098 --- 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 2bcb9a980..8c9c09102 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 123e8e1ab..d1e34d178 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 3c768ab76..93b29cba8 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)