luci-mod-network: Correctly assign dnsmasq instance: name not number
authorPaul Donald <redacted>
Tue, 23 Jul 2024 13:18:07 +0000 (15:18 +0200)
committerPaul Donald <redacted>
Tue, 23 Jul 2024 13:18:07 +0000 (15:18 +0200)
Closes #7199

Signed-off-by: Paul Donald <redacted>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js

index 051e8d529ce4b7ec1e3f544232ff1c92679944dd..4f6fe79385c51b989e64cb46daf163423724131e 100644 (file)
@@ -101,7 +101,7 @@ function generateDnsmasqInstanceEntry(data) {
        }
        formatString += ')';
 
-       return nameValueMap.get('.name'), formatString;
+       return [nameValueMap.get('.name'), formatString];
 }
 
 function getDHCPPools() {
@@ -830,8 +830,8 @@ return view.extend({
                so.optional = true;
 
                Object.values(L.uci.sections('dhcp', 'dnsmasq')).forEach(function(val, index) {
-                       var name, display_str = generateDnsmasqInstanceEntry(val);
-                       so.value(index, display_str);
+                       var [name, display_str] = generateDnsmasqInstanceEntry(val);
+                       so.value(name, display_str);
                });
 
                o = s.taboption('dnsrecords', form.SectionValue, '__dnsrecords__', form.TypedSection, '__dnsrecords__');
@@ -1125,8 +1125,8 @@ return view.extend({
                so.optional = true;
 
                Object.values(L.uci.sections('dhcp', 'dnsmasq')).forEach(function(val, index) {
-                       var name, display_str = generateDnsmasqInstanceEntry(val);
-                       so.value(index, display_str);
+                       var [name, display_str] = generateDnsmasqInstanceEntry(val);
+                       so.value(name, display_str);
                });
 
 
git clone https://git.99rst.org/PROJECT