luci-mod-network: dhcp.js: group DNS record related options in one tab

In order to unclutter the default dnmasq configuration view, move the
Hostnames (A+PTR), SRV, MX and CNAME sections into a new dedicated
"DNS Records" tab.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich
2024-04-08 15:16:12 +02:00
parent 9fc659ad43
commit cdfbf784a8
@@ -287,7 +287,7 @@ return view.extend({
duids = hosts_duids_pools[1],
pools = hosts_duids_pools[2],
networks = hosts_duids_pools[3],
m, s, o, ss, so;
m, s, o, ss, so, dnss;
let noi18nstrings = {
etc_hosts: '<code>/etc/hosts</code>',
@@ -355,6 +355,7 @@ return view.extend({
s.tab('general', _('General'));
s.tab('devices', _('Devices &amp; Ports'));
s.tab('dnsrecords', _('DNS Records'));
s.tab('dnssecopt', _('DNSSEC'));
s.tab('filteropts', _('Filter'));
s.tab('forward', _('Forwards'));
@@ -362,12 +363,8 @@ return view.extend({
s.tab('logging', _('Log'));
s.tab('files', _('Resolv &amp; Hosts Files'));
s.tab('leases', _('Static Leases'));
s.tab('hosts', _('Hostnames'));
s.tab('ipsets', _('IP Sets'));
s.tab('relay', _('Relay'));
s.tab('srvhosts', _('SRV'));
s.tab('mxhosts', _('MX'));
s.tab('cnamehosts', _('CNAME'));
s.tab('pxe_tftp', _('PXE/TFTP'));
s.taboption('filteropts', form.Flag, 'domainneeded',
@@ -836,7 +833,19 @@ return view.extend({
so.value(index, display_str);
});
o = s.taboption('srvhosts', form.SectionValue, '__srvhosts__', form.TableSection, 'srvhost', null,
o = s.taboption('dnsrecords', form.SectionValue, '__dnsrecords__', form.TypedSection, '__dnsrecords__');
dnss = o.subsection;
dnss.anonymous = true;
dnss.cfgsections = function() { return [ '__dnsrecords__' ] };
dnss.tab('hosts', _('Hostnames'));
dnss.tab('srvhosts', _('SRV'));
dnss.tab('mxhosts', _('MX'));
dnss.tab('cnamehosts', _('CNAME'));
o = dnss.taboption('srvhosts', form.SectionValue, '__srvhosts__', form.TableSection, 'srvhost', null,
_('Bind service records to a domain name: specify the location of services. See <a href="%s">RFC2782</a>.').format('https://datatracker.ietf.org/doc/html/rfc2782')
+ '<br />' + _('_service: _sip, _ldap, _imap, _stun, _xmpp-client, … . (Note: while _http is possible, no browsers support SRV records.)')
+ '<br />' + _('_proto: _tcp, _udp, _sctp, _quic, … .')
@@ -875,7 +884,7 @@ return view.extend({
so.datatype = 'range(0,65535)';
so.placeholder = '50';
o = s.taboption('mxhosts', form.SectionValue, '__mxhosts__', form.TableSection, 'mxhost', null,
o = dnss.taboption('mxhosts', form.SectionValue, '__mxhosts__', form.TableSection, 'mxhost', null,
_('Bind service records to a domain name: specify the location of services.')
+ '<br />' + _('You may add multiple records for the same domain.'));
@@ -902,7 +911,7 @@ return view.extend({
so.datatype = 'range(0,65535)';
so.placeholder = '0';
o = s.taboption('cnamehosts', form.SectionValue, '__cname__', form.TableSection, 'cname', null,
o = dnss.taboption('cnamehosts', form.SectionValue, '__cname__', form.TableSection, 'cname', null,
_('Set an alias for a hostname.'));
ss = o.subsection;
@@ -923,7 +932,7 @@ return view.extend({
so.datatype = 'hostname';
so.placeholder = 'example.com.';
o = s.taboption('hosts', form.SectionValue, '__hosts__', form.GridSection, 'domain', null,
o = dnss.taboption('hosts', form.SectionValue, '__hosts__', form.GridSection, 'domain', null,
_('Hostnames are used to bind a domain name to an IP address. This setting is redundant for hostnames already configured with static leases, but it can be useful to rebind an FQDN.'));
ss = o.subsection;