From: Jo-Philipp Wich Date: Mon, 27 Jul 2020 13:44:03 +0000 (+0200) Subject: luci-base: network.js: recognize uci declared network devices X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=354ca57ec86f1ee64a24d8d079dd8e6d9e36abf4;p=project%2Fluci.git luci-base: network.js: recognize uci declared network devices Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index 8d825d73a0..856421cd31 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -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)