From 691e4ba30113cee3508a54fd2383e34f38b55bde Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 16 Apr 2025 15:13:01 -0600 Subject: feat: render a blank html page for the dashboard --- app/controllers/dashboard/controller.go | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'app/controllers/dashboard/controller.go') diff --git a/app/controllers/dashboard/controller.go b/app/controllers/dashboard/controller.go index cd1c44f..d805027 100644 --- a/app/controllers/dashboard/controller.go +++ b/app/controllers/dashboard/controller.go @@ -1,6 +1,7 @@ package dashboard import ( + "html/template" "net/http" "github.com/xlgmokha/x/pkg/context" @@ -31,4 +32,42 @@ func (c *Controller) Show(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) w.Header().Add("Content-Type", "text/html") + const tpl = ` + + + + + + + SparkleLab - {{.Title}} + + + +
+ + {{range .Sparkles}} +
{{ . }}
+ {{else}} +
No Sparkles
+ {{end}} +
+ +` + + t := x.Must(template.New("show").Parse(tpl)) + data := struct { + Title string + Sparkles []string + }{ + Title: "SparkleLab", + Sparkles: []string{}, + } + t.Execute(w, data) } -- cgit v1.2.3