feat(webui): bootstrap account settings management with light and dark mode

This commit is contained in:
Julien Dessaux 2025-01-30 00:19:16 +01:00
parent ab043d8617
commit 98c7d6f578
Signed by: adyxax
GPG key ID: F92E51B86E07177E
13 changed files with 136 additions and 14 deletions

View file

@ -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 == "/" {