Filter offline clients

This commit is contained in:
Douglas Barone 2022-12-13 08:04:27 -04:00
parent 21be34ee3a
commit 8368d3fede

View File

@ -75,6 +75,8 @@ function getDevices() {
(devices = devices.concat(pageDevices)) (devices = devices.concat(pageDevices))
) )
devices = devices.filter(device => device.ST == 'Online')
resolve(devices) resolve(devices)
} catch (e) { } catch (e) {
logError({ logError({
@ -92,7 +94,8 @@ export async function getOnlineWifiDevices() {
const now = new Date() const now = new Date()
const restructuredOnlineDevices = onlineDevices.map(client => ({ const restructuredOnlineDevices = onlineDevices.map(client => {
return {
user: client.Name == 'unknown' ? null : client.Name, user: client.Name == 'unknown' ? null : client.Name,
identity: client.Name == 'unknown' ? null : client.Name, identity: client.Name == 'unknown' ? null : client.Name,
oui: ouiFinder(client.macaddr), oui: ouiFinder(client.macaddr),
@ -111,7 +114,8 @@ export async function getOnlineWifiDevices() {
protocol: client.PT, protocol: client.PT,
speed: client.SD, speed: client.SD,
usage: client.bytes_total || 0 usage: client.bytes_total || 0
})) }
})
return restructuredOnlineDevices return restructuredOnlineDevices
} }