mirror of
https://github.com/luxfi/mpc.git
synced 2026-09-24 00:26:24 +00:00
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.
25 lines
660 B
Go
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
|
|
}
|