diff --git a/server/prisma/migrations/20220603124600_wifi_stats/migration.sql b/server/prisma/migrations/20220608181835_wifi_stats/migration.sql similarity index 79% rename from server/prisma/migrations/20220603124600_wifi_stats/migration.sql rename to server/prisma/migrations/20220608181835_wifi_stats/migration.sql index 4de67ce..c04679e 100644 --- a/server/prisma/migrations/20220603124600_wifi_stats/migration.sql +++ b/server/prisma/migrations/20220608181835_wifi_stats/migration.sql @@ -5,9 +5,9 @@ */ -- AlterTable -ALTER TABLE "AccessPoint" ADD COLUMN "inventoryTag" TEXT, -ADD COLUMN "sshPassword" TEXT, -ADD COLUMN "sshUser" TEXT; +ALTER TABLE "AccessPoint" ADD COLUMN "encryptedSshPassword" TEXT, +ADD COLUMN "encryptedSshUser" TEXT, +ADD COLUMN "inventoryTag" TEXT; -- AlterTable ALTER TABLE "WifiDevice" ADD COLUMN "frequency" TEXT, @@ -27,7 +27,17 @@ DROP TABLE "Statistic"; CREATE TABLE "WifiStats" ( "id" SERIAL NOT NULL, "timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "clients" INTEGER NOT NULL, + "clients" INTEGER, + "avgSignal" INTEGER, + "minSignal" INTEGER, + "maxSignal" INTEGER, + "avgSpeed" INTEGER, + "minSpeed" INTEGER, + "maxSpeed" INTEGER, + "avgClientUptime" INTEGER, + "maxClientUptime" INTEGER, + "avgUsage" INTEGER, + "sumUsage" INTEGER, "accessPointId" INTEGER NOT NULL, CONSTRAINT "WifiStats_pkey" PRIMARY KEY ("id") diff --git a/server/prisma/schema.prisma b/server/prisma/schema.prisma index 9eb2948..8da4283 100644 --- a/server/prisma/schema.prisma +++ b/server/prisma/schema.prisma @@ -166,8 +166,8 @@ model AccessPoint { ip String? clients Int? - sshUser String? - sshPassword String? + encryptedSshUser String? + encryptedSshPassword String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@ -177,11 +177,27 @@ model AccessPoint { } model WifiStats { - id Int @id @default(autoincrement()) - timestamp DateTime @default(now()) - clients Int + id Int @id @default(autoincrement()) + timestamp DateTime @default(now()) + + clients Int? + + avgSignal Int? + minSignal Int? + maxSignal Int? + + avgSpeed Int? + minSpeed Int? + maxSpeed Int? + + avgClientUptime Int? + maxClientUptime Int? + + avgUsage Int? + sumUsage Int? + accessPointId Int - accessPoint AccessPoint? @relation("wifistats_to_ap", fields: [accessPointId], references: [id]) + accessPoint AccessPoint @relation("wifistats_to_ap", fields: [accessPointId], references: [id]) } model Network { diff --git a/web/src/components/DataTables/WifiDevicesDataTable.vue b/web/src/components/DataTables/WifiDevicesDataTable.vue index 5de5b38..1106fb1 100644 --- a/web/src/components/DataTables/WifiDevicesDataTable.vue +++ b/web/src/components/DataTables/WifiDevicesDataTable.vue @@ -65,9 +65,6 @@ {{ item.accessPoint.name || item.accessPoint.hostname }} - - ({{ item.accessPoint.local }}) - diff --git a/web/src/components/DataTables/WifiUsersDataTable.vue b/web/src/components/DataTables/WifiUsersDataTable.vue index 0807674..a78d795 100644 --- a/web/src/components/DataTables/WifiUsersDataTable.vue +++ b/web/src/components/DataTables/WifiUsersDataTable.vue @@ -3,6 +3,7 @@ :items="items" :headers="headers" v-bind="$attrs" + calculate-widths @click:row=" e => $router.push({