luci-base: network.js: recognize uci declared network devices

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-07-27 15:44:03 +02:00
parent b8d381b677
commit 354ca57ec8

View file

@ -1224,6 +1224,22 @@ Network = baseclass.extend(/** @lends LuCI.network.prototype */ {
devices[netid] = this.instantiateDevice(netid);
}
/* find uci declared devices */
var uciDevices = uci.sections('network', 'device');
for (var i = 0; i < uciDevices.length; i++) {
var type = uciDevices[i].type,
name = uciDevices[i].name;
if (!type || !name || devices.hasOwnProperty(name))
continue;
if (type == 'bridge')
_state.isBridge[name] = true;
devices[name] = this.instantiateDevice(name);
}
var rv = [];
for (var netdev in devices)