summaryrefslogtreecommitdiff
path: root/pkg/webui/index.go
diff options
context:
space:
mode:
authorJulien Dessaux2025-01-30 00:19:16 +0100
committerJulien Dessaux2025-01-30 00:19:16 +0100
commit98c7d6f5785182117b9fe6ebd6b892f860bc2024 (patch)
tree261f22399f8f3fce71a2e1c4fc79314c2a8c5efd /pkg/webui/index.go
parentfix(webui): fix invalid session cookie handling (diff)
downloadtfstated-98c7d6f5785182117b9fe6ebd6b892f860bc2024.tar.gz
tfstated-98c7d6f5785182117b9fe6ebd6b892f860bc2024.tar.bz2
tfstated-98c7d6f5785182117b9fe6ebd6b892f860bc2024.zip
feat(webui): bootstrap account settings management with light and dark mode
Diffstat (limited to 'pkg/webui/index.go')
-rw-r--r--pkg/webui/index.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/webui/index.go b/pkg/webui/index.go
index 89e5ad6..1168098 100644
--- a/pkg/webui/index.go
+++ b/pkg/webui/index.go
@@ -3,14 +3,23 @@ package webui
import (
"fmt"
"net/http"
+
+ "git.adyxax.org/adyxax/tfstated/pkg/model"
)
type Page struct {
+ LightMode bool
Precedent string
Section string
Title string
}
+func makePage(r *http.Request, page *Page) *Page {
+ settings := r.Context().Value(model.SettingsContextKey{}).(*model.Settings)
+ page.LightMode = settings.LightMode
+ return page
+}
+
func handleIndexGET() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/" {