projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4146934
)
luci-0.10: merge r8096, r8097 and r8098
author
Jo-Philipp Wich
<jow@openwrt.org>
Fri, 16 Dec 2011 01:43:17 +0000
(
01:43
+0000)
committer
Jo-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
patch
|
blob
|
history
libs/web/htdocs/luci-static/resources/cbi.js
patch
|
blob
|
history
libs/web/luasrc/cbi/datatypes.lua
patch
|
blob
|
history
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 2bcb9a9802e70823af036c96fbba9ba78d9a11e1..8c9c09102fda90aa23d8460a88364fa884e7b1b2 100644
(file)
--- 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
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")
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
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")
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 123e8e1aba77f293107aff30acb2688c5759d929..d1e34d1786035b24489d96a0c3f12e1408bc923b 100644
(file)
--- 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;
},
return false;
},
+ 'network': function(v)
+ {
+ return cbi_validators.uciname(v) || cbi_validators.host(v);
+ },
+
'wpakey': function(v)
{
if( v.length == 64 )
'wpakey': function(v)
{
if( v.length == 64 )
diff --git
a/libs/web/luasrc/cbi/datatypes.lua
b/libs/web/luasrc/cbi/datatypes.lua
index 3c768ab7623e03885eb8a3b735541d7b1a0d2e5e..93b29cba81d2c54afaae2479417f74551a2a8704 100644
(file)
--- 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
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)
function wpakey(val)
if #val == 64 then
return (val:match("^[a-fA-F0-9]+$") ~= nil)