Documentation
¶
Overview ¶
Package dashboard serves the admin SPA and its backing JSON API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EffectiveBootstrapped ¶ added in v0.1.2
EffectiveBootstrapped is the bootstrap state the SPA acts on: the real database state, or true under NoAuth where no account is required. Single source of truth for the middleware and the status endpoint so the gate and the reported state can never diverge.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves the admin dashboard.
func (*Handler) SetDevRedirect ¶
SetDevRedirect configures the handler to 302-redirect any browser navigation that would otherwise fall through to the embedded SPA (i.e. everything not matched by a more specific route in Register) to origin instead, preserving path and query.
This exists because `make start` never runs a real `vite build` — the embedded build/web directory is just a placeholder stub so the //go:embed directive has something to embed. Without this, hitting the dashboard port directly in dev (or any /login, /bootstrap navigation not proxied to the dev server) serves that meaningless placeholder instead of the actual UI, which is only running on WEB_PORT in dev. Production builds never call this, so it has no effect there.
type Params ¶ added in v0.1.2
type Params struct {
AdminSvc *admin.Service
ProviderSvc *provider.Service
CredSvc *credential.Service
TokenSvc *token.Service
ModelInfoSvc *modelinfo.Service
MetricsSvc *metrics.Service
VirtualSvc *virtual.Service
RouterSvc *router.Service
ConfigSvc *configsvc.Service
LuaSvc *luaplugin.Service
RepoSvc *pluginrepo.Service
ProxySvc *proxypool.Service
GeoBanSvc *geoban.Service
Logger *slog.Logger
// NoAuth skips session checks: dashboard APIs serve without login.
NoAuth bool
}
Params carries every dependency of the dashboard Handler in one value, so adding a service touches one struct instead of every call site.