diff options
author | Jo-Philipp Wich <jo@mein.io> | 2024-02-21 14:45:34 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2024-02-21 15:33:08 +0100 |
commit | 42bd2af3fe2b3902cf0b48469e155c324ef5322d (patch) | |
tree | 2aa0ebee722f21882c2a08a5c14ba45e5ca9a99a /applications/luci-app-firewall | |
parent | cf09f89df307f2e9d2b5dda152c571b3d0d1550d (diff) |
luci-app-firewall: add address range inputs for traffic rules
Ref: https://forum.openwrt.org/t/question-about-firewall-rules/188656
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-firewall')
-rw-r--r-- | applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js index ec0ee369ea..f9d7dc611c 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js @@ -6,6 +6,7 @@ 'require form'; 'require network'; 'require firewall'; +'require validation'; 'require tools.prng as random'; var protocols = [ @@ -455,9 +456,10 @@ return baseclass.extend({ addIPOption: function(s, tab, name, label, description, family, hosts, multiple) { var o = s.taboption(tab, multiple ? this.CBIDynamicMultiValueList : form.Value, name, label, description); + var fw4 = L.hasSystemFeature('firewall4'); o.modalonly = true; - o.datatype = 'list(neg(ipmask("true")))'; + o.datatype = (fw4 && validation.types.iprange) ? 'list(neg(or(ipmask("true"),iprange)))' : 'list(neg(ipmask("true")))'; o.placeholder = multiple ? _('-- add IP --') : _('any'); if (family != null) { |