Files
mpc/ui/embed.go
T
zeekay 29a9ec0d5d feat(ui): embedded MPC admin dashboard — @hanzo/gui + go:embed
Vite + React SPA with 9 pages (Dashboard, Wallets, Vaults, Policies,
Settlements, Bridge, Payments, Audit, Settings) served at /_/mpc/ via
go:embed. Replaces the separate Next.js dashboard pod — the UI now ships
inside the mpcd binary. Uses @tanstack/react-query, wouter hash router,
dark theme, inline styles. Build output: 272KB.
2026-03-16 10:00:00 -07:00

25 lines
660 B
Go

// Package ui embeds the MPC admin dashboard built with Vite + React.
//
// The Go HTTP handler serves the admin UI at the /_/mpc/ path.
// Run `pnpm --dir ui build` in this directory to produce dist/; the
// //go:embed directive below picks up the resulting static assets.
package ui
import (
"embed"
"io/fs"
)
//go:embed all:dist
var distFS embed.FS
// DistDirFS returns a rooted fs.FS pointing at dist/ so it can be passed
// directly to the Base router's Static handler.
func DistDirFS() fs.FS {
sub, err := fs.Sub(distFS, "dist")
if err != nil {
panic("mpc-ui: dist/ missing — run `pnpm --dir ui build` first: " + err.Error())
}
return sub
}