Filter offline clients
This commit is contained in:
parent
21be34ee3a
commit
8368d3fede
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user