From a013a26d94731ec3c55174b69d5b3e4a72e13448 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Wed, 17 Sep 2025 01:28:23 -0400 Subject: [PATCH] Improved the stream page some more and now going to make the game display page a parody of a steam page. --- .ozai.json | 2 +- Makefile | 7 +++++++ admin/handlers.go | 1 + data/models.go | 4 ++++ migrations/20250802154952_create_game_table.sql | 12 ++++++++++-- static/js/code.js | 1 + static/style.css | 9 --------- tools/restart.ps1 | 1 + 8 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 tools/restart.ps1 diff --git a/.ozai.json b/.ozai.json index b59adad..fbabbb5 100644 --- a/.ozai.json +++ b/.ozai.json @@ -1,5 +1,5 @@ { - "HostPort": ":9998", + "HostPort": ":9999", "Processes": { "webapp": { "URL": "/webapp", diff --git a/Makefile b/Makefile index 6b17baa..3fad02e 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,13 @@ ifeq '$(OS)' 'Windows_NT' GO_IS_STUPID_EXE=.exe endif +all: build +ifeq '$(OS)' 'Windows_NT' + powershell -ExecutionPolicy bypass "./tools/restart.ps1" +else + curl http://127.0.0.1:9999/webapp || true +endif + build: build_bot go build . diff --git a/admin/handlers.go b/admin/handlers.go index be693cc..5a77249 100644 --- a/admin/handlers.go +++ b/admin/handlers.go @@ -169,4 +169,5 @@ func Setup(app *fiber.App) { app.Post("/api/admin/new/table/:table", PostApiInsert) app.Get("/api/admin/table/:table/:id", GetApiSelectOne) app.Post("/api/admin/table/:table/:id", PostApiUpdate) + app.Delete("/api/admin/table/:table/:id", DeleteApi) } diff --git a/data/models.go b/data/models.go index 00829fc..3021b26 100644 --- a/data/models.go +++ b/data/models.go @@ -32,6 +32,10 @@ type Game struct { Slug string `db:"slug" json:"slug"` Title string `db:"title" json:"title"` Description string `db:"description" json:"description"` + Image string `db:"image" json:"image"` + Url string `db:"url" json:"url"` + Tags string `db:"tags" json:"tags"` + Video string `db:"video" json:"video"` } func Models() map[string]reflect.Type { diff --git a/migrations/20250802154952_create_game_table.sql b/migrations/20250802154952_create_game_table.sql index 67c2063..4ab9ae8 100644 --- a/migrations/20250802154952_create_game_table.sql +++ b/migrations/20250802154952_create_game_table.sql @@ -1,7 +1,15 @@ -- +goose Up -- +goose StatementBegin -CREATE TABLE game (id INTEGER PRIMARY KEY, - slug TEXT, title TEXT, description TEXT); +CREATE TABLE game ( + id INTEGER PRIMARY KEY, + slug TEXT, + title TEXT, + description TEXT, + image TEXT, + url TEXT, + tags TEXT, + video TEXT +); -- +goose StatementEnd -- +goose Down diff --git a/static/js/code.js b/static/js/code.js index f6ccf53..f5e97cf 100644 --- a/static/js/code.js +++ b/static/js/code.js @@ -75,6 +75,7 @@ const ConfirmDelete = async (table, obj_id) => { await fetch("/api/admin/table/" + table + "/" + obj_id, { method: "DELETE" }); window.location = "/admin/table/" + table; + return true; } else { return false; } diff --git a/static/style.css b/static/style.css index 2efde42..fb91331 100644 --- a/static/style.css +++ b/static/style.css @@ -339,9 +339,6 @@ .items-center { align-items: center; } - .items-stretch { - align-items: stretch; - } .justify-between { justify-content: space-between; } @@ -354,9 +351,6 @@ .justify-evenly { justify-content: space-evenly; } - .justify-stretch { - justify-content: stretch; - } .gap-0\! { gap: calc(var(--spacing) * 0) !important; } @@ -499,9 +493,6 @@ .\!p-4 { padding: calc(var(--spacing) * 4) !important; } - .p-0 { - padding: calc(var(--spacing) * 0); - } .p-0\! { padding: calc(var(--spacing) * 0) !important; } diff --git a/tools/restart.ps1 b/tools/restart.ps1 new file mode 100644 index 0000000..9da1d6c --- /dev/null +++ b/tools/restart.ps1 @@ -0,0 +1 @@ +curl http://127.0.0.1:9999/webapp *> $null