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
+22
View File
@@ -0,0 +1,22 @@
// Package dashboard embeds the built Svelte admin dashboard from web/.
package dashboard
import (
"embed"
"io/fs"
)
// dist holds the built frontend. A committed .gitkeep keeps the embed
// pattern valid in checkouts where `bun run build` has not run yet.
//
//go:embed all:dist
var files embed.FS
// FS returns the dashboard files rooted at the build output directory.
func FS() fs.FS {
sub, err := fs.Sub(files, "dist")
if err != nil {
return files
}
return sub
}