diff options
author | Paul Dee <itsascambutmailmeanyway@gmail.com> | 2023-02-17 12:50:00 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2023-03-29 15:33:37 +0200 |
commit | 48086e1c7b3e7094b6fbe61335209189b1006bfb (patch) | |
tree | 3fa0f81e8bf758648a3b3a092ee0542bdba337c8 /applications/luci-app-firewall | |
parent | d0d891c23eb65da42ae6c1b8f0156e971abea5b3 (diff) |
luci-app-firewall: Add ipset field to snats
Signed-off-by: Paul Dee <itsascambutmailmeanyway@gmail.com>
Diffstat (limited to 'applications/luci-app-firewall')
-rw-r--r-- | applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js index a36dfee6bb..6ccb075569 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js @@ -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; |