Merge pull request #4495 from oldium/network-wifi-vlans
luci-base: network.js: Show clients also from wifi VLANs.
This commit is contained in:
commit
6483e80267
1 changed files with 27 additions and 1 deletions
|
@ -3570,6 +3570,24 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */
|
|||
return ifname;
|
||||
},
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
@ -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);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue