diff options
author | Jo-Philipp Wich <jo@mein.io> | 2024-04-08 15:16:12 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2024-04-08 15:34:28 +0200 |
commit | cdfbf784a83fe4318d6e01892dbd88344fdfdaf2 (patch) | |
tree | bbb06c158cb2607dd872e0c5897b8cd93ae886f9 | |
parent | 9fc659ad437d37c2a800a9cb3e5f7bd4830aa4d0 (diff) |
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>
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js | 27 |
1 files changed, 18 insertions, 9 deletions
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 cb8f4af4ff..7be024f68a 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 @@ -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 & 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 & 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; |