luci-base: CBIDeviceSelect includes each device IP when includeips=true

For use when daemons whose interface config paradigm accept IP also.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
Paul Donald
2025-04-07 20:15:28 +02:00
parent 27ebe8b662
commit 5be4cd129c
@@ -551,6 +551,20 @@ var CBIDeviceSelect = form.ListValue.extend({
}
}
if (this.includeips) {
this.devices.forEach(net_dev => {
['getIPAddrs', 'getIP6Addrs'].forEach(fn => {
net_dev[fn]().forEach(addr => {
const name = addr.split('/')[0];
if (checked[name]) values.push(name);
choices[name] = E([], [name, ' (', E('strong', net_dev.getName()), ')']);
order.push(name);
});
});
});
}
if (!this.nocreate) {
var keys = Object.keys(checked).sort(L.naturalCompare);