summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-network')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js23
1 files changed, 19 insertions, 4 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 fc96576f2d..ade401adc5 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
@@ -89,6 +89,21 @@ function calculateNetwork(addr, mask) {
];
}
+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'),
@@ -631,7 +646,7 @@ return view.extend({
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,
@@ -910,8 +925,8 @@ return view.extend({
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'),
@@ -933,7 +948,7 @@ return view.extend({
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));
});