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 -- AlterTable
ALTER TABLE "AccessPoint" ADD COLUMN "inventoryTag" TEXT, ALTER TABLE "AccessPoint" ADD COLUMN "encryptedSshPassword" TEXT,
ADD COLUMN "sshPassword" TEXT, ADD COLUMN "encryptedSshUser" TEXT,
ADD COLUMN "sshUser" TEXT; ADD COLUMN "inventoryTag" TEXT;
-- AlterTable -- AlterTable
ALTER TABLE "WifiDevice" ADD COLUMN "frequency" TEXT, ALTER TABLE "WifiDevice" ADD COLUMN "frequency" TEXT,
@ -27,7 +27,17 @@ DROP TABLE "Statistic";
CREATE TABLE "WifiStats" ( CREATE TABLE "WifiStats" (
"id" SERIAL NOT NULL, "id" SERIAL NOT NULL,
"timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "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, "accessPointId" INTEGER NOT NULL,
CONSTRAINT "WifiStats_pkey" PRIMARY KEY ("id") CONSTRAINT "WifiStats_pkey" PRIMARY KEY ("id")

View File

@ -166,8 +166,8 @@ model AccessPoint {
ip String? ip String?
clients Int? clients Int?
sshUser String? encryptedSshUser String?
sshPassword String? encryptedSshPassword String?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
@ -177,11 +177,27 @@ model AccessPoint {
} }
model WifiStats { model WifiStats {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
timestamp DateTime @default(now()) 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 accessPointId Int
accessPoint AccessPoint? @relation("wifistats_to_ap", fields: [accessPointId], references: [id]) accessPoint AccessPoint @relation("wifistats_to_ap", fields: [accessPointId], references: [id])
} }
model Network { model Network {

View File

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

View File

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