luci-app-firewall: Add ipset field to snats

Signed-off-by: Paul Dee <itsascambutmailmeanyway@gmail.com>
This commit is contained in:
Paul Dee 2023-02-17 12:50:00 +01:00 committed by Jo-Philipp Wich
parent d0d891c23e
commit 48086e1c7b

View file

@ -313,6 +313,17 @@ return view.extend({
o.depends({ proto: 'tcp', '!contains': true });
o.depends({ proto: 'udp', '!contains': true });
var have_fw4 = L.hasSystemFeature('firewall4')
if (!have_fw4) {
o = s.taboption('advanced', form.Value, 'ipset', _('Use ipset'));
uci.sections('firewall', 'ipset', function(s) {
if (typeof(s.name) == 'string')
this.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
});
o.modalonly = true;
o.rmempty = true;
}
o = s.taboption('advanced', widgets.DeviceSelect, 'device', _('Outbound device'),
_('Matches forwarded traffic using the specified outbound network device.'));
o.noaliases = true;
@ -323,7 +334,7 @@ return view.extend({
fwtool.addLimitOption(s);
fwtool.addLimitBurstOption(s);
if (!L.hasSystemFeature('firewall4')) {
if (!have_fw4) {
o = s.taboption('advanced', form.Value, 'extra', _('Extra arguments'),
_('Passes additional arguments to iptables. Use with care!'));
o.modalonly = true;