From ee486aefdfbc997ba9de784aefa7e4c0f6977a02 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Wed, 10 May 2023 03:17:58 +0400 Subject: [PATCH] Added MindflowAdmin page handler and updated mindflow.Post. --- internal/http/handlers.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/http/handlers.go b/internal/http/handlers.go index d2e4eee..28ce4bc 100644 --- a/internal/http/handlers.go +++ b/internal/http/handlers.go @@ -50,11 +50,18 @@ func (h *Handlers) Stuff(w http.ResponseWriter, r *http.Request) { func (h *Handlers) Mindflow(w http.ResponseWriter, r *http.Request) { posts := []mindflow.Post{ - {Category: "Kek", Date: time.Now(), Title: "LMAO", Body: "Testing!"}, + {Category: mindflow.Category{ID: 1, Name: "Update"}, Date: time.Now(), Title: "LMAO", Body: "Testing!"}, } web.Mindflow("/ Mindflow", posts, r, w) } +func (h *Handlers) MindflowAdmin(w http.ResponseWriter, r *http.Request) { + posts := []mindflow.Post{ + {Category: mindflow.Category{ID: 1, Name: "Update"}, Date: time.Now(), Title: "LMAO", Body: "Testing!"}, + } + web.MindflowAdmin("/ Mindflow Administration", posts, r, w) +} + func (h *Handlers) About(w http.ResponseWriter, r *http.Request) { var lst servicestat.ServiceList = make(servicestat.ServiceList) reimu, err := servicestat.GatherStatus("http://reimu.arav.home.arpa:14882/processes") @@ -135,7 +142,7 @@ func (h *Handlers) GuestbookAdmin(w http.ResponseWriter, r *http.Request) { func (h *Handlers) RSS(w http.ResponseWriter, r *http.Request) { posts := []mindflow.Post{ - {Category: "Kek", Date: time.Now(), Title: "LMAO", Body: "Testing!"}, + {Category: mindflow.Category{ID: 1, Name: "Update"}, Date: time.Now(), Title: "LMAO", Body: "Testing!"}, } web.RSS(r.URL.Scheme+"://"+r.Host, "Arav", posts, r, w) }