mirror of
https://github.com/openwrt/luci.git
synced 2026-05-31 10:31:55 +08:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user