diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-10-06 14:00:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 14:00:55 +0200 |
commit | 6483e802671e008a288fcf8f4b8951e92ec6d774 (patch) | |
tree | b819d432dc112fb2476fbc5c4f08302f19b8beef /modules/luci-base | |
parent | 61a4fca14756d40138e2ded2084155ed5f901d45 (diff) | |
parent | 12e50de9dbce577b634819f02776c44be3894cd7 (diff) |
Merge pull request #4495 from oldium/network-wifi-vlans
luci-base: network.js: Show clients also from wifi VLANs.
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/network.js | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index 856421cd3..1f749c593 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -3571,6 +3571,24 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */ }, /** + * Get the Linux VLAN network device names. + * + * @returns {string[]} + * Returns the current Linux VLAN network device name as resolved + * from `ubus` runtime information or empty array if this network + * has no associated VLAN network devices. + */ + getVlanIfnames: function() { + var vlans = L.toArray(this.ubus('net', 'vlans')), + ifnames = []; + + for (var i = 0; i < vlans.length; i++) + ifnames.push(vlans[i]['ifname']); + + return ifnames; + }, + + /** * Get the name of the corresponding wifi radio device. * * @returns {null|string} @@ -3880,7 +3898,15 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */ * with this network. */ getAssocList: function() { - return callIwinfoAssoclist(this.getIfname()); + var tasks = []; + var ifnames = [ this.getIfname() ].concat(this.getVlanIfnames()); + + for (var i = 0; i < ifnames.length; i++) + tasks.push(callIwinfoAssoclist(ifnames[i])); + + return Promise.all(tasks).then(function(values) { + return Array.prototype.concat.apply([], values); + }); }, /** |