diff --git a/server/src/resolvers/Query/wifiDevices.js b/server/src/resolvers/Query/wifiDevices.js index e6b2afe..02975fe 100644 --- a/server/src/resolvers/Query/wifiDevices.js +++ b/server/src/resolvers/Query/wifiDevices.js @@ -21,7 +21,7 @@ export async function wifiDevices(parent, { take = 100, skip = 0, search }) { ] }, orderBy: [{ lastSeen: 'desc' }, { hostname: 'asc' }], - include: { user: true }, + include: { user: true, accessPoint: true }, take, skip }) diff --git a/server/src/resolvers/WifiDevice.js b/server/src/resolvers/WifiDevice.js index 488a28a..240771c 100644 --- a/server/src/resolvers/WifiDevice.js +++ b/server/src/resolvers/WifiDevice.js @@ -11,7 +11,9 @@ const WifiDevice = { where: { id: parent.id }, include: { user: true } }) - ).user + ).user, + + accessPoint: async parent => prisma.accessPoint.findUnique({ where: { id: parent.accessPointId } }) } export { WifiDevice } diff --git a/server/src/typeDefs.js b/server/src/typeDefs.js index 81b99a5..e34c6f9 100644 --- a/server/src/typeDefs.js +++ b/server/src/typeDefs.js @@ -234,6 +234,7 @@ const typeDefs = gql` uptime: String apName: String status: Status + accessPoint: AccessPoint! } "A user that is on the Wi-Fi network reach" diff --git a/web/src/components/WifiDevice.vue b/web/src/components/WifiDevice.vue index cc62278..6a96a84 100644 --- a/web/src/components/WifiDevice.vue +++ b/web/src/components/WifiDevice.vue @@ -21,9 +21,14 @@ - {{ wifiDevice.essid }} (próximo ao AP {{ wifiDevice.apName }}) + {{ wifiDevice.essid }} - SSID + + SSID (conectado pelo AP + {{ + wifiDevice.accessPoint.name || wifiDevice.accessPoint.hostname + }}) @@ -33,9 +38,14 @@ - {{ wifiDevice.essid }} (próximo ao AP {{ wifiDevice.apName }}) + {{ wifiDevice.essid }} - Dispositivo off-line + + Dispositivo off-line (visto próximo ao AP + {{ + wifiDevice.accessPoint.name || wifiDevice.accessPoint.hostname + }}) @@ -63,6 +73,21 @@ {{ wifiDevice.oui }} + + + + mdi-map-marker-radius + + + + {{ wifiDevice.accessPoint.local }} + + + Localização aproximada + + + + mdi-eye diff --git a/web/src/components/widgets/DevicesWidget.vue b/web/src/components/widgets/DevicesWidget.vue index e88466f..4834db3 100755 --- a/web/src/components/widgets/DevicesWidget.vue +++ b/web/src/components/widgets/DevicesWidget.vue @@ -49,6 +49,11 @@ export default { oui uptime status + accessPoint { + name + hostname + local + } } } } diff --git a/web/src/views/WifiDevices.vue b/web/src/views/WifiDevices.vue index e85c5db..d50e07b 100644 --- a/web/src/views/WifiDevices.vue +++ b/web/src/views/WifiDevices.vue @@ -108,13 +108,28 @@ - {{ device.apName }} + {{ + device.accessPoint.name || device.accessPoint.hostname + }} Access Point ({{ device.controller }}) + + + mdi-map-marker-radius + + + + {{ device.accessPoint.local }} + + + Localização do AP + + + @@ -242,6 +257,11 @@ export default { sAMAccountName thumbnailPhoto } + accessPoint { + name + hostname + local + } oui mac controller