luci-mod-network: Fix 'instances' fields for dnsmasq dhcp config entries 6579/head
authorPaul Donald <newtwen@gmail.com>
Sat, 18 Nov 2023 14:30:19 +0000 (15:30 +0100)
committerPaul Donald <newtwen@gmail.com>
Wed, 22 Nov 2023 18:39:55 +0000 (19:39 +0100)
commit0fb8b1f9ad6875a325fa99557a7ea21de04b8710
tree2effa6a9935dc868b4d6a08f6558f2a6bef2ae57
parent8a01448bde39ab343778f00fd71d1716e181fc12
luci-mod-network: Fix 'instances' fields for dnsmasq dhcp config entries

Fixed error wherein luci erroneously saved the iterator integer of the
current dnsmasq config object to a host (and boot/PXE) config entry
'instance' field, instead of correctly referring to its name.

Now we use the correct ".name" field of the dnsmasq config entry.
Anonymous entries have e.g. "cfg01411c". The ".name" field corresponds
to 'myName' in /etc/config/dhcp entries of:

config dnsmasq 'myName'
  ...

In this way, host and other entry types are bound correctly to specific
dnsmasq instances. For anonymous entries, display "dnsmasq[x]" as name.

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