luci-mod-network: organize "ipsets" tab in dhcp/dns views
authorDavid Härdeman <[email protected]>
Wed, 15 Oct 2025 17:05:22 +0000 (19:05 +0200)
committerPaul Donald <[email protected]>
Sat, 18 Oct 2025 21:51:38 +0000 (23:51 +0200)
Delete the tab from dhcp.js, sort the options that belong to it in dns.js.

Signed-off-by: David Härdeman <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js

index 3d7bf024afa91738c1bfcb43bb9b6ca73d6f292a..4d436b7f4b35af60b9089947a101d861480a3712 100644 (file)
@@ -394,7 +394,6 @@ return view.extend({
                s.tab('logging', _('Log'));
                s.tab('files', _('Files'));
                s.tab('leases', _('Static Leases'));
-               s.tab('ipsets', _('IP Sets'));
                s.tab('relay', _('Relay'));
                s.tab('pxe_tftp', _('PXE/TFTP'));
 
@@ -871,45 +870,6 @@ return view.extend({
                so.value('39', _('40: LoongArch 64-bit UEFI boot from HTTP'));
                so.value('41', _('41: ARM rpiboot'));
 
-               o = s.taboption('ipsets', form.SectionValue, '__ipsets__', form.GridSection, 'ipset', null,
-                       _('List of IP sets to populate with the IPs of DNS lookup results of the FQDNs also specified here.') + '<br />' +
-                       _('The netfilter components below are only regarded when running fw4.'));
-
-               ss = o.subsection;
-
-               ss.addremove = true;
-               ss.anonymous = true;
-               ss.sortable  = true;
-               ss.rowcolors = true;
-               ss.nodescriptions = true;
-               ss.modaltitle = _('Edit IP set');
-
-               so = ss.option(form.DynamicList, 'name', _('Name of the set'));
-               uci.sections('firewall', 'ipset', function(s) {
-                       if (typeof(s.name) == 'string')
-                               so.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
-               });
-               so.rmempty = false;
-               so.editable = false;
-               so.datatype = 'string';
-
-               so = ss.option(form.DynamicList, 'domain', _('FQDN'));
-               so.rmempty = false;
-               so.editable = false;
-               so.datatype = 'hostname';
-
-               so = ss.option(form.Value, 'table', _('Netfilter table name'), _('Defaults to fw4.'));
-               so.editable = false;
-               so.placeholder = 'fw4';
-               so.rmempty = true;
-
-               so = ss.option(form.ListValue, 'table_family', _('Table IP family'), _('Defaults to IPv4+6.') + ' ' + _('Can be hinted by adding 4 or 6 to the name.') + '<br />' +
-                       _('Adding an IPv6 to an IPv4 set and vice-versa silently fails.'));
-               so.editable = false;
-               so.rmempty = true;
-               so.value('inet', _('IPv4+6'));
-               so.value('ip', _('IPv4'));
-               so.value('ip6', _('IPv6'));
 
                return m.render().then(function(mapEl) {
                        poll.add(function() {
index 42e60c3c931ea09516ebd6e6a5cc436cf79e905c..80255229dadfd5ffc4e0f4ba6ec3e2546933d08d 100644 (file)
@@ -1018,6 +1018,48 @@ return view.extend({
                o.placeholder = '/etc/dnsmasq.hosts';
                // End files
 
+               // Begin ipsets
+               o = s.taboption('ipsets', form.SectionValue, '__ipsets__', form.GridSection, 'ipset', null,
+                       _('List of IP sets to populate with the IPs of DNS lookup results of the FQDNs also specified here.') + '<br />' +
+                       _('The netfilter components below are only regarded when running fw4.'));
+
+               ss = o.subsection;
+
+               ss.addremove = true;
+               ss.anonymous = true;
+               ss.sortable  = true;
+               ss.rowcolors = true;
+               ss.nodescriptions = true;
+               ss.modaltitle = _('Edit IP set');
+
+               so = ss.option(form.DynamicList, 'name', _('Name of the set'));
+               uci.sections('firewall', 'ipset', function(s) {
+                       if (typeof(s.name) == 'string')
+                               so.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
+               });
+               so.rmempty = false;
+               so.editable = false;
+               so.datatype = 'string';
+
+               so = ss.option(form.DynamicList, 'domain', _('FQDN'));
+               so.rmempty = false;
+               so.editable = false;
+               so.datatype = 'hostname';
+
+               so = ss.option(form.Value, 'table', _('Netfilter table name'), _('Defaults to fw4.'));
+               so.editable = false;
+               so.placeholder = 'fw4';
+               so.rmempty = true;
+
+               so = ss.option(form.ListValue, 'table_family', _('Table IP family'), _('Defaults to IPv4+6.') + ' ' + _('Can be hinted by adding 4 or 6 to the name.') + '<br />' +
+                       _('Adding an IPv6 to an IPv4 set and vice-versa silently fails.'));
+               so.editable = false;
+               so.rmempty = true;
+               so.value('inet', _('IPv4+6'));
+               so.value('ip', _('IPv4'));
+               so.value('ip6', _('IPv6'));
+               // End ipsets
+
                o = s.taboption('relay', form.SectionValue, '__relays__', form.TableSection, 'relay', null,
                        _('Relay DHCP requests elsewhere. OK: v4↔v4, v6↔v6. Not OK: v4↔v6, v6↔v4.')
                        + '<br />' + _('Note: you may also need a DHCP Proxy (currently unavailable) when specifying a non-standard Relay To port(<code>addr#port</code>).')
@@ -1215,45 +1257,6 @@ return view.extend({
                so.value('39', _('40: LoongArch 64-bit UEFI boot from HTTP'));
                so.value('41', _('41: ARM rpiboot'));
 
-               o = s.taboption('ipsets', form.SectionValue, '__ipsets__', form.GridSection, 'ipset', null,
-                       _('List of IP sets to populate with the IPs of DNS lookup results of the FQDNs also specified here.') + '<br />' +
-                       _('The netfilter components below are only regarded when running fw4.'));
-
-               ss = o.subsection;
-
-               ss.addremove = true;
-               ss.anonymous = true;
-               ss.sortable  = true;
-               ss.rowcolors = true;
-               ss.nodescriptions = true;
-               ss.modaltitle = _('Edit IP set');
-
-               so = ss.option(form.DynamicList, 'name', _('Name of the set'));
-               uci.sections('firewall', 'ipset', function(s) {
-                       if (typeof(s.name) == 'string')
-                               so.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
-               });
-               so.rmempty = false;
-               so.editable = false;
-               so.datatype = 'string';
-
-               so = ss.option(form.DynamicList, 'domain', _('FQDN'));
-               so.rmempty = false;
-               so.editable = false;
-               so.datatype = 'hostname';
-
-               so = ss.option(form.Value, 'table', _('Netfilter table name'), _('Defaults to fw4.'));
-               so.editable = false;
-               so.placeholder = 'fw4';
-               so.rmempty = true;
-
-               so = ss.option(form.ListValue, 'table_family', _('Table IP family'), _('Defaults to IPv4+6.') + ' ' + _('Can be hinted by adding 4 or 6 to the name.') + '<br />' +
-                       _('Adding an IPv6 to an IPv4 set and vice-versa silently fails.'));
-               so.editable = false;
-               so.rmempty = true;
-               so.value('inet', _('IPv4+6'));
-               so.value('ip', _('IPv4'));
-               so.value('ip6', _('IPv6'));
 
                return m.render();
        }