Add more stats field

This commit is contained in:
Douglas Barone 2022-06-08 18:32:56 +00:00
parent 10455cfde6
commit b4ac5c520d
4 changed files with 37 additions and 13 deletions

View File

@ -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")

View File

@ -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
@ -179,9 +179,25 @@ model AccessPoint {
model WifiStats {
id Int @id @default(autoincrement())
timestamp DateTime @default(now())
clients Int
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 {

View File

@ -65,9 +65,6 @@
{{ item.accessPoint.name || item.accessPoint.hostname }}
</small>
</router-link>
<span v-if="item.accessPoint.local">
({{ item.accessPoint.local }})
</span>
</template>
</v-data-table>
</div>

View File

@ -3,6 +3,7 @@
:items="items"
:headers="headers"
v-bind="$attrs"
calculate-widths
@click:row="
e =>
$router.push({