Files
tunnel/internal/dashboard/embed.go
T
TZGyn bc52af33cf 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.
2026-10-25 16:34:21 +08:00

23 lines
478 B
Go

// 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
}