luci-app-firewall: Add ipset field to rules
authorPaul Dee <itsascambutmailmeanyway@gmail.com>
Fri, 17 Feb 2023 13:07:44 +0000 (14:07 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 3 Apr 2023 11:51:44 +0000 (13:51 +0200)
Signed-off-by: Paul Dee <itsascambutmailmeanyway@gmail.com>
(cherry picked from commit f407a013ba1e889ba4cd09eaf456724cb41e1537)

applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js

index 6aa0173ce579d5ecc8f645b77d1104afbf7be387..5dda8075a2e92c307925f98ce43b73e766f49478 100644 (file)
@@ -371,6 +371,14 @@ return view.extend({
                o.allowany = true;
                o.allowlocal = 'src';
 
+               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;
+
                fwtool.addMACOption(s, 'advanced', 'src_mac', _('Source MAC address'), null, hosts);
                fwtool.addIPOption(s, 'general', 'src_ip', _('Source address'), null, '', hosts, true);