Added initial support to wifi devices listing
This commit is contained in:
parent
2abc723d00
commit
4e0d244477
|
@ -1,6 +1,6 @@
|
|||
const WifiDevice = {
|
||||
lastSeen: _ => _.lastSeen.toISOString(),
|
||||
firstSeen: _ => _.firstSeen.toISOString()
|
||||
lastSeen: _ => _.lastSeen?.toISOString(),
|
||||
firstSeen: _ => _.firstSeen?.toISOString()
|
||||
}
|
||||
|
||||
export { WifiDevice }
|
||||
|
|
|
@ -40,6 +40,12 @@ export default {
|
|||
route: { name: 'user-presence' },
|
||||
role: 'watcher'
|
||||
},
|
||||
{
|
||||
title: 'Dispositivos WiFi',
|
||||
icon: 'mdi-cellphone-wireless',
|
||||
route: { name: 'wifi-devices' },
|
||||
role: 'superAdmin'
|
||||
},
|
||||
{
|
||||
title: 'Criar token',
|
||||
icon: 'mdi-qrcode',
|
||||
|
|
|
@ -154,6 +154,18 @@ const routes = [
|
|||
/* webpackChunkName: "user-presence" */ '../views/UserPresence.vue'
|
||||
)
|
||||
},
|
||||
|
||||
{
|
||||
path: '/wifi-devices',
|
||||
name: 'wifi-devices',
|
||||
meta: {
|
||||
title: 'Dispositivos WiFi',
|
||||
watcher: true
|
||||
},
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "wifi-devices" */ '../views/WifiDevices.vue')
|
||||
},
|
||||
|
||||
{
|
||||
path: '/system-administration',
|
||||
name: 'system-administration',
|
||||
|
|
60
web/src/views/WifiDevices.vue
Normal file
60
web/src/views/WifiDevices.vue
Normal file
|
@ -0,0 +1,60 @@
|
|||
<template>
|
||||
<v-container fluid>
|
||||
<v-data-table :headers="headers" :items="items"> </v-data-table>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export default {
|
||||
name: 'WifiDevices',
|
||||
data: () => ({
|
||||
headers: [
|
||||
{ text: 'Hostname', value: 'hostname' },
|
||||
{ text: 'Usuário', value: 'user' },
|
||||
{ text: 'OUI', value: 'oui' },
|
||||
{ text: 'AP', value: 'apName' },
|
||||
{ text: 'Controladora', value: 'controller' },
|
||||
{ text: 'Endereço MAC', value: 'mac' }
|
||||
]
|
||||
}),
|
||||
apollo: {
|
||||
wifiDevices: {
|
||||
fetchPolicy: 'cache-and-network',
|
||||
query: gql`
|
||||
query {
|
||||
wifiDevices {
|
||||
user {
|
||||
displayName
|
||||
sAMAccountName
|
||||
}
|
||||
oui
|
||||
mac
|
||||
controller
|
||||
hostname
|
||||
firstSeen
|
||||
lastSeen
|
||||
essid
|
||||
ip
|
||||
uptime
|
||||
apName
|
||||
status
|
||||
}
|
||||
}
|
||||
`
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
items() {
|
||||
return this.wifiDevices?.map(device => ({
|
||||
...device,
|
||||
hostname: device.hostname || 'Desconhecido',
|
||||
user: device.user.displayName
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
Loading…
Reference in New Issue
Block a user