fix(web): fix assets exposure
CI / validate (push) Successful in 26m13s

This commit is contained in:
2026-08-25 16:44:54 +02:00
parent 1344053741
commit fbbe35ad24
3 changed files with 31 additions and 21 deletions
+27
View File
@@ -353,6 +353,8 @@ func newHandlerServicesWithCatalog(authService *auth.Service, repository reposit
mux.HandleFunc("GET /static/dogama-logo.png", s.logo)
mux.HandleFunc("GET /static/dogama.png", s.brandLogo)
mux.HandleFunc("GET /static/dogama-brand-banner.png", s.brandBanner)
mux.HandleFunc("GET /static/icons.svg", s.icons)
mux.HandleFunc("GET /favicon.ico", s.favicon)
mux.HandleFunc("GET /setup", s.setupForm)
mux.HandleFunc("POST /setup", s.setupSubmit)
mux.HandleFunc("GET /login", s.loginForm)
@@ -2406,6 +2408,31 @@ func (s *server) themeStylesheet(w http.ResponseWriter, _ *http.Request) {
_, _ = io.Copy(w, body)
}
func (s *server) icons(w http.ResponseWriter, _ *http.Request) {
body, err := assets.Open("static/icons.svg")
if err != nil {
http.Error(w, "Not found.", http.StatusNotFound)
return
}
defer func() { _ = body.Close() }()
w.Header().Set("Content-Type", "image/svg+xml")
w.Header().Set("Cache-Control", "public, max-age=86400")
_, _ = io.Copy(w, body)
}
func (s *server) favicon(w http.ResponseWriter, _ *http.Request) {
body, err := assets.Open("static/favicon.ico")
if err != nil {
http.Error(w, "Not found.", http.StatusNotFound)
return
}
defer func() { _ = body.Close() }()
w.Header().Set("Content-Type", "image/x-icon")
w.Header().Set("Cache-Control", "public, max-age=86400")
_, _ = io.Copy(w, body)
}
func (s *server) logo(w http.ResponseWriter, _ *http.Request) {
body, err := assets.Open("static/dogama-logo.png")
if err != nil {
+1 -19
View File
@@ -81,7 +81,7 @@
.sidebar nav a: :before,
.sidebar nav span.disabled::before {
color: #a9b4ca;
display: grid;
display: grid;
flex: 0 0 22px;
font-size: 1rem;
height: 22px;
@@ -91,15 +91,6 @@
.sidebar nav a.active::before {
color: var(--accent-cyan);
}
.nav-instances::before {
content: "\25A4";
}
.nav-catalog::before {
content: "\2667";
}
.nav-backups::before {
content: "\25A3";
}
.nav-settings::after {
content: "\203A";
margin-left: auto;
@@ -150,15 +141,6 @@
.account .signout-button:hover {
color: var(--text-primary);
}
.nav-dashboard::before {
content: none;
}
.nav-audit::before {
content: none;
}
.nav-settings::before {
content: none;
}
.page-heading {
align-items: center;
gap: 24px;
+3 -2
View File
@@ -26,6 +26,7 @@
</a>
{{if .IsAdmin}}
<a class="nav-audit {{if eq .ActivePage "audit"}}active{{end}}" href="/audit">
<svg class="ui-icon" aria-hidden="true"><use href="/static/icons.svg#history"></use></svg>
{{.Msg "nav.audit"}}
</a>
<a class="nav-administration {{if eq .ActivePage "administration"}}active{{end}}" href="/administration">
@@ -49,12 +50,12 @@
</small>
</span>
</div>
<aside class="sidebar">
<nav aria-label="{{.Msg "nav.primary"}}">
<a class="nav-account {{if eq .ActivePage "account"}}active{{end}}" href="/account">
<svg class="ui-icon" aria-hidden="true"><use href="/static/icons.svg#settings"></use></svg>
{{.Msg "nav.settings"}}
</a>
</aside>
</nav>
<form method="post" action="/logout">
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
<button class="signout-button" type="submit">