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>
This commit is contained in:
parent
cf09f89df3
commit
42bd2af3fe
1 changed files with 3 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
||||||
'require form';
|
'require form';
|
||||||
'require network';
|
'require network';
|
||||||
'require firewall';
|
'require firewall';
|
||||||
|
'require validation';
|
||||||
'require tools.prng as random';
|
'require tools.prng as random';
|
||||||
|
|
||||||
var protocols = [
|
var protocols = [
|
||||||
|
@ -455,9 +456,10 @@ return baseclass.extend({
|
||||||
|
|
||||||
addIPOption: function(s, tab, name, label, description, family, hosts, multiple) {
|
addIPOption: function(s, tab, name, label, description, family, hosts, multiple) {
|
||||||
var o = s.taboption(tab, multiple ? this.CBIDynamicMultiValueList : form.Value, name, label, description);
|
var o = s.taboption(tab, multiple ? this.CBIDynamicMultiValueList : form.Value, name, label, description);
|
||||||
|
var fw4 = L.hasSystemFeature('firewall4');
|
||||||
|
|
||||||
o.modalonly = true;
|
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');
|
o.placeholder = multiple ? _('-- add IP --') : _('any');
|
||||||
|
|
||||||
if (family != null) {
|
if (family != null) {
|
||||||
|
|
Loading…
Reference in a new issue