Rebuild the admin dashboard as a Svelte 5 + TypeScript app

Frontend in web/ (Vite via bun, pure CSS, no component libraries),
built to internal/dashboard/dist and embedded into the binary; the
Dockerfile builds it in a bun stage. Old static dashboard.html removed.
This commit is contained in:
2026-10-25 16:34:21 +08:00
parent f5fcdd7bbb
commit bc52af33cf
24 changed files with 760 additions and 183 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`{"ok":true}`))
case path == "/openapi.json" && r.Method == http.MethodGet:
writeJSON(w, http.StatusOK, json.RawMessage(openapiStub))
case (path == "/" || path == "/admin") && r.Method == http.MethodGet:
case (path == "/" || path == "/admin" || strings.HasPrefix(path, "/assets/")) && r.Method == http.MethodGet:
a.dashboard(w, r)
case path == "/api/admin/overview" && r.Method == http.MethodGet:
a.adminOverviewHandler(w, r)