From e869615ec7e70dbba8b509da3a8af71e69fc38de Mon Sep 17 00:00:00 2001 From: Spacelord Date: Mon, 1 May 2023 22:15:35 +0200 Subject: [PATCH] Add basic bootstrap dashboard with sample data. --- allowedStaticPaths.json | 4 +- prisma/schema.prisma | 28 +++--- src/frontend/demopage.eta.html | 73 +++++++++++++- src/frontend/foot.eta.html | 4 - src/frontend/index.eta.html | 6 ++ src/frontend/partials/controls.eta.html | 67 +++++++++++++ src/frontend/partials/controlsFoot.eta.html | 3 + src/frontend/partials/foot.eta.html | 5 + src/frontend/{ => partials}/head.eta.html | 1 + src/index.ts | 15 ++- src/routes/dev/setDemoData.ts | 4 +- src/routes/frontend/etaTest.ts | 1 - src/routes/frontend/index.ts | 4 +- static/css/dashboard.css | 100 ++++++++++++++++++++ 14 files changed, 282 insertions(+), 33 deletions(-) delete mode 100644 src/frontend/foot.eta.html create mode 100644 src/frontend/index.eta.html create mode 100644 src/frontend/partials/controls.eta.html create mode 100644 src/frontend/partials/controlsFoot.eta.html create mode 100644 src/frontend/partials/foot.eta.html rename src/frontend/{ => partials}/head.eta.html (91%) create mode 100644 static/css/dashboard.css diff --git a/allowedStaticPaths.json b/allowedStaticPaths.json index ac33778..70d6c5e 100644 --- a/allowedStaticPaths.json +++ b/allowedStaticPaths.json @@ -7,7 +7,7 @@ "/darkreader/darkreader.js", "/bootstrap-icons/font/fonts/bootstrap-icons.woff2", "/bootstrap/dist/css/bootstrap.min.css.map", - "/@popperjs/core/dist/cjs/popper.js" + "/@popperjs/core/dist/umd/popper.min.js" ], - "debugMode": true + "debugMode": false } diff --git a/prisma/schema.prisma b/prisma/schema.prisma index fa19a9d..a9a4177 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -10,14 +10,6 @@ datasource db { url = env("DATABASE_URL") } -enum Category { - Light - Audio - Laptop - Adapter - Other -} - enum Status { normal borrowed @@ -26,22 +18,23 @@ enum Status { } model Item { - id Int @id @default(autoincrement()) - SKU String @unique + id Int @id @default(autoincrement()) + SKU String @unique Amount Int Comment String? name String manufacturer String - category Category + category Category @relation(fields: [categoryId], references: [id]) + categoryId Int status Status StorageLocation StorageLocation? @relation(fields: [storageLocationId], references: [id]) storageLocationId Int? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } model StorageLocation { - id Int @id @default(autoincrement()) + id Int @id @default(autoincrement()) name String storageBuilding StorageBuilding? @relation(fields: [storageBuildingId], references: [id]) storageBuildingId Int? @@ -58,3 +51,10 @@ model StorageBuilding { country String StorageLocation StorageLocation[] } + +model Category { + id Int @id @default(autoincrement()) + name String + description String? + Item Item[] +} diff --git a/src/frontend/demopage.eta.html b/src/frontend/demopage.eta.html index 8ce42be..03ecb57 100644 --- a/src/frontend/demopage.eta.html +++ b/src/frontend/demopage.eta.html @@ -1,8 +1,73 @@ -<%~ E.includeFile("head.eta.html", {"title": "Bootstrap Demo Page"}) %> +<%~ E.includeFile("partials/head.eta.html", {"title": "Bootstrap Demo Page"}) %> +<%~ E.includeFile("partials/controls.eta.html", {"active": "Orders"}) %> -