ui

package
v0.11.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ui exposes the admin observability web UI as an embedded filesystem so the admin server binary is fully self-contained.

Build pipeline (no copy step — vite writes straight into this package):

  1. `npm run build` in ui/ (tsc -b && vite build) writes the bundle directly to server/ui/dist/ — ui/vite.config.ts sets outDir to ../server/ui/dist, so the //go:embed below picks it up as-is.
  2. `go build ./cmd/admin-server` (from server/; or `go build ./server/cmd/admin-server` from the workspace root) produces a binary that serves the static UI at "/" without depending on anything on disk.

During development you run `npm run dev` in ui/ (Vite on :5173 with a proxy to :8080) and access the admin UI directly without going through the Go embed path. The embed path is for production binaries.

The built dist directory (index.html + hashed assets) is committed so the binary is self-contained and `go install …/admin-server` works without a Node toolchain. If a checkout somehow lacks dist, FS still embeds an empty filesystem and the server falls back to the placeholder index from PlaceholderHTML.

Index

Constants

View Source
const PlaceholderHTML = `` /* 1023-byte string literal not displayed */

PlaceholderHTML is what the server serves at "/" when no dist has been built. It tells operators what to do; it never ships in a real release because the committed server/ui/dist is what releases embed.

Variables

This section is empty.

Functions

func FS

func FS() fs.FS

FS returns the dist filesystem rooted at "/", or nil if the embed has no real UI assets (no index.html). A bare .gitkeep does NOT count as "the UI is built"; the explicit check on index.html is what tells us the build pipeline ran successfully.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL