luci-mod-network: organize "files" tab in dhcp/dns views
authorDavid Härdeman <[email protected]>
Wed, 15 Oct 2025 16:56:51 +0000 (18:56 +0200)
committerPaul Donald <[email protected]>
Sat, 18 Oct 2025 21:51:38 +0000 (23:51 +0200)
Sort the options in the "files" tab so that they are all grouped together in
the order they appear in the UI and delete ones that are specific to DNS from
dhcp.js and vice versa.

Retitle the tab for the dhcp view from "Resolv & Hosts Files" to "Files".

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 d07bc8c102dc1db828d68cd3f12fc5c632bac79f..ff5b1609c354a539d9093d060ad95157acc8ef28 100644 (file)
@@ -392,7 +392,7 @@ return view.extend({
                s.tab('general', _('General'));
                s.tab('devices', _('Devices &amp; Ports'));
                s.tab('logging', _('Log'));
-               s.tab('files', _('Resolv &amp; Hosts Files'));
+               s.tab('files', _('Files'));
                s.tab('leases', _('Static Leases'));
                s.tab('ipsets', _('IP Sets'));
                s.tab('relay', _('Relay'));
@@ -478,6 +478,17 @@ return view.extend({
                o.depends('logdhcp', '0');
                // End logging
 
+               // Begin files
+               s.taboption('files', form.Flag, 'readethers',
+                       customi18n(_('Use {etc_ethers}') ),
+                       customi18n(_('Read {etc_ethers} to configure the DHCP server.') )
+                       );
+
+               s.taboption('files', form.Value, 'leasefile',
+                       _('Lease file'),
+                       _('File to store DHCP lease information.'));
+               // End files
+
                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>).')
@@ -546,48 +557,6 @@ return view.extend({
                so.rmempty = false;
                so.placeholder = 'lan';
 
-               s.taboption('files', form.Flag, 'readethers',
-                       customi18n(_('Use {etc_ethers}') ),
-                       customi18n(_('Read {etc_ethers} to configure the DHCP server.') )
-                       );
-
-               s.taboption('files', form.Value, 'leasefile',
-                       _('Lease file'),
-                       _('File to store DHCP lease information.'));
-
-               o = s.taboption('files', form.Flag, 'noresolv',
-                       _('Ignore resolv file'));
-               o.optional = true;
-
-               o = s.taboption('files', form.Value, 'resolvfile',
-                       _('Resolv file'),
-                       _('File with upstream resolvers.'));
-               o.depends('noresolv', '0');
-               o.placeholder = '/tmp/resolv.conf.d/resolv.conf.auto';
-               o.optional = true;
-
-               o = s.taboption('files', form.Flag, 'strictorder',
-                       _('Strict order'),
-                       _('Query upstream resolvers in the order they appear in the resolv file.'));
-               o.optional = true;
-
-               o = s.taboption('files', form.Flag, 'ignore_hosts_dir',
-                       _('Ignore hosts files directory'),
-                       _('On: use instance specific hosts file only') + '<br/>' +
-                       _('Off: use all files in the directory including the instance specific hosts file')
-               );
-               o.optional = true;
-
-               o = s.taboption('files', form.Flag, 'nohosts',
-                       customi18n(_('Ignore {etc_hosts} file') )
-               );
-               o.optional = true;
-
-               o = s.taboption('files', form.DynamicList, 'addnhosts',
-                       _('Additional hosts files'));
-               o.optional = true;
-               o.placeholder = '/etc/dnsmasq.hosts';
-
                o = s.taboption('pxe_tftp', form.Flag, 'enable_tftp',
                        _('Enable TFTP server'),
                        _('Enable the built-in single-instance TFTP server.'));
index 97523262fdc95f7c7a1587bdd382de02b0638250..626874df52975898baf902f105e3058af967b377 100644 (file)
@@ -984,6 +984,41 @@ return view.extend({
                o.value('-', _('stderr'));
                // End logging
 
+               // Begin files
+               o = s.taboption('files', form.Flag, 'noresolv',
+                       _('Ignore resolv file'));
+               o.optional = true;
+
+               o = s.taboption('files', form.Value, 'resolvfile',
+                       _('Resolv file'),
+                       _('File with upstream resolvers.'));
+               o.depends('noresolv', '0');
+               o.placeholder = '/tmp/resolv.conf.d/resolv.conf.auto';
+               o.optional = true;
+
+               o = s.taboption('files', form.Flag, 'strictorder',
+                       _('Strict order'),
+                       _('Query upstream resolvers in the order they appear in the resolv file.'));
+               o.optional = true;
+
+               o = s.taboption('files', form.Flag, 'ignore_hosts_dir',
+                       _('Ignore hosts files directory'),
+                       _('On: use instance specific hosts file only') + '<br/>' +
+                       _('Off: use all files in the directory including the instance specific hosts file')
+               );
+               o.optional = true;
+
+               o = s.taboption('files', form.Flag, 'nohosts',
+                       customi18n(_('Ignore {etc_hosts} file') )
+               );
+               o.optional = true;
+
+               o = s.taboption('files', form.DynamicList, 'addnhosts',
+                       _('Additional hosts files'));
+               o.optional = true;
+               o.placeholder = '/etc/dnsmasq.hosts';
+               // End files
+
                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>).')
@@ -1052,48 +1087,6 @@ return view.extend({
                so.rmempty = false;
                so.placeholder = 'lan';
 
-               s.taboption('files', form.Flag, 'readethers',
-                       customi18n(_('Use {etc_ethers}') ),
-                       customi18n(_('Read {etc_ethers} to configure the DHCP server.') )
-                       );
-
-               s.taboption('files', form.Value, 'leasefile',
-                       _('Lease file'),
-                       _('File to store DHCP lease information.'));
-
-               o = s.taboption('files', form.Flag, 'noresolv',
-                       _('Ignore resolv file'));
-               o.optional = true;
-
-               o = s.taboption('files', form.Value, 'resolvfile',
-                       _('Resolv file'),
-                       _('File with upstream resolvers.'));
-               o.depends('noresolv', '0');
-               o.placeholder = '/tmp/resolv.conf.d/resolv.conf.auto';
-               o.optional = true;
-
-               o = s.taboption('files', form.Flag, 'strictorder',
-                       _('Strict order'),
-                       _('Query upstream resolvers in the order they appear in the resolv file.'));
-               o.optional = true;
-
-               o = s.taboption('files', form.Flag, 'ignore_hosts_dir',
-                       _('Ignore hosts files directory'),
-                       _('On: use instance specific hosts file only') + '<br/>' +
-                       _('Off: use all files in the directory including the instance specific hosts file')
-               );
-               o.optional = true;
-
-               o = s.taboption('files', form.Flag, 'nohosts',
-                       customi18n(_('Ignore {etc_hosts} file') )
-               );
-               o.optional = true;
-
-               o = s.taboption('files', form.DynamicList, 'addnhosts',
-                       _('Additional hosts files'));
-               o.optional = true;
-               o.placeholder = '/etc/dnsmasq.hosts';
-
                o = s.taboption('pxe_tftp', form.Flag, 'enable_tftp',
                        _('Enable TFTP server'),
                        _('Enable the built-in single-instance TFTP server.'));