From: David Härdeman Date: Wed, 15 Oct 2025 16:56:51 +0000 (+0200) Subject: luci-mod-network: organize "files" tab in dhcp/dns views X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=c901bbcdd06ae66a0159b52c7a01eaa346e71d09;p=project%2Fluci.git luci-mod-network: organize "files" tab in dhcp/dns views 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 --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index d07bc8c102..ff5b1609c3 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -392,7 +392,7 @@ return view.extend({ s.tab('general', _('General')); s.tab('devices', _('Devices & Ports')); s.tab('logging', _('Log')); - s.tab('files', _('Resolv & 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.') + '
' + _('Note: you may also need a DHCP Proxy (currently unavailable) when specifying a non-standard Relay To port(addr#port).') @@ -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') + '
' + - _('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.')); diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js index 97523262fd..626874df52 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js @@ -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') + '
' + + _('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.') + '
' + _('Note: you may also need a DHCP Proxy (currently unavailable) when specifying a non-standard Relay To port(addr#port).') @@ -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') + '
' + - _('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.'));