forked from rosa/hakurei
cmd/pkgserver: fix dark mode in test web UI
This commit is contained in:
@@ -28,15 +28,24 @@ func serveStaticContent(w http.ResponseWriter, r *http.Request) {
|
||||
case "/static/test.js":
|
||||
http.ServeFileFS(w, r, content, "ui/static/test.js")
|
||||
case "/static/test.css":
|
||||
http.ServeFileFS(w, r, content, "ui/static/test.css")
|
||||
darkTheme := r.CookiesNamed("dark_theme")
|
||||
if len(darkTheme) > 0 && darkTheme[0].Value == "true" {
|
||||
http.ServeFileFS(w, r, content, "ui/static/test_dark.css")
|
||||
} else {
|
||||
http.ServeFileFS(w, r, content, "ui/static/test_light.css")
|
||||
}
|
||||
case "/static/all_tests.js":
|
||||
http.ServeFileFS(w, r, content, "ui/static/all_tests.js")
|
||||
case "/static/test_tests.js":
|
||||
http.ServeFileFS(w, r, content, "ui/static/test_tests.js")
|
||||
case "/static/success-closed.svg":
|
||||
http.ServeFileFS(w, r, content, "ui/static/success-closed.svg")
|
||||
case "/static/success-open.svg":
|
||||
http.ServeFileFS(w, r, content, "ui/static/success-open.svg")
|
||||
case "/static/success-closed-white.svg":
|
||||
http.ServeFileFS(w, r, content, "ui/static/success-closed-white.svg")
|
||||
case "/static/success-open-white.svg":
|
||||
http.ServeFileFS(w, r, content, "ui/static/success-open-white.svg")
|
||||
case "/static/success-closed-black.svg":
|
||||
http.ServeFileFS(w, r, content, "ui/static/success-closed-black.svg")
|
||||
case "/static/success-open-black.svg":
|
||||
http.ServeFileFS(w, r, content, "ui/static/success-open-black.svg")
|
||||
case "/static/failure-closed.svg":
|
||||
http.ServeFileFS(w, r, content, "ui/static/failure-closed.svg")
|
||||
case "/static/failure-open.svg":
|
||||
|
||||
Reference in New Issue
Block a user