];
}
+function generateDnsmasqInstanceEntry(data) {
+ const nameValueMap = new Map(Object.entries(data));
+ let formatString = nameValueMap.get('.index') + ' (' + _('Name') + (nameValueMap.get('.anonymous') ? ': dnsmasq[' + nameValueMap.get('.index') + ']': ': ' + nameValueMap.get('.name'));
+
+ if (data.domain) {
+ formatString += ', ' + _('Domain') + ': ' + data.domain;
+ }
+ if (data.local) {
+ formatString += ', ' + _('Local') + ': ' + data.local;
+ }
+ formatString += ')';
+
+ return nameValueMap.get('.name'), formatString;
+}
+
function getDHCPPools() {
return uci.load('dhcp').then(function() {
let sections = uci.sections('dhcp', 'dhcp'),
o = s.taboption('general', form.Flag, 'rebind_protection',
_('Rebind protection'),
- _('Discard upstream responses containing <a href="%s">RFC1918</a> addresses.').format('https://datatracker.ietf.org/doc/html/rfc1918'));
+ _('Discard upstream responses containing <a href="%s">RFC1918</a> addresses.').format('https://www.rfc-editor.org/rfc/rfc1918') + '<br />' +
+ _('Discard also upstream responses containing <a href="%s">RFC4193</a>, Link-Local and private IPv4-Mapped <a href="%s">RFC4291</a> IPv6 Addresses.').format('https://www.rfc-editor.org/rfc/rfc4193', 'https://www.rfc-editor.org/rfc/rfc4291'));
o.rmempty = false;
o = s.taboption('general', form.Flag, 'rebind_localhost',
so.optional = true;
Object.values(L.uci.sections('dhcp', 'dnsmasq')).forEach(function(val, index) {
- so.value(index, '%s (Domain: %s, Local: %s)'.format(index, val.domain || '?', val.local || '?'));
+ so.value(generateDnsmasqInstanceEntry(val));
});
o = s.taboption('srvhosts', form.SectionValue, '__srvhosts__', form.TableSection, 'srvhost', null,
so = ss.option(form.Value, 'hostid',
_('IPv6-Suffix (hex)'),
- _('The IPv6 interface identifier (address suffix) as hexadecimal number (max. 8 chars).'));
- so.datatype = 'and(rangelength(0,8),hexstring)';
+ _('The IPv6 interface identifier (address suffix) as hexadecimal number (max. 16 chars).'));
+ so.datatype = 'and(rangelength(0,16),hexstring)';
so = ss.option(form.DynamicList, 'tag',
_('Tag'),
so.optional = true;
Object.values(L.uci.sections('dhcp', 'dnsmasq')).forEach(function(val, index) {
- so.value(index, '%s (Domain: %s, Local: %s)'.format(index, val.domain || '?', val.local || '?'));
+ so.value(generateDnsmasqInstanceEntry(val));
});