From 5be4cd129ca1da95118cf5069b6d7a83f26fc28e Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Mon, 7 Apr 2025 20:15:28 +0200 Subject: [PATCH] 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 --- .../htdocs/luci-static/resources/tools/widgets.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js b/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js index 171cd4bf9f..0d8dba323a 100644 --- a/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js +++ b/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js @@ -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); -- 2.30.2