luci-mod-status: Set status page "Set Static" for MAC to list type
authorPaul Donald <[email protected]>
Fri, 5 Jul 2024 23:45:54 +0000 (01:45 +0200)
committerPaul Donald <[email protected]>
Fri, 5 Jul 2024 23:48:31 +0000 (01:48 +0200)
MACs are list type in DHCP; 1 IP can have multiple MACs

See https://github.com/openwrt/luci/issues/4582#issuecomment-2209390439

Closes #4582

Signed-off-by: Paul Donald <[email protected]>
modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js

index 0894d3d4d174f508953adb494541e41b102c2719..19edbd37562241864616231869d0b511da2f5f8b 100644 (file)
@@ -33,7 +33,7 @@ return baseclass.extend({
                var cfg = uci.add('dhcp', 'host');
                uci.set('dhcp', cfg, 'name', lease.hostname);
                uci.set('dhcp', cfg, 'ip', lease.ipaddr);
-               uci.set('dhcp', cfg, 'mac', lease.macaddr.toUpperCase());
+               uci.set('dhcp', cfg, 'mac', [lease.macaddr.toUpperCase()]);
 
                return uci.save()
                        .then(L.bind(L.ui.changes.init, L.ui.changes))