Documentation
¶
Index ¶
- Constants
- func Layout(w http.ResponseWriter, r *http.Request, webpageTitle, webpageHtml string, ...) string
- func Navbar(r *http.Request, store nodestore.StoreInterface) hb.TagInterface
- func NodeAdminURL(r *http.Request) string
- func SectionNav(r *http.Request, store nodestore.StoreInterface) hb.TagInterface
- func ShortID(id string) string
- func WorkflowMinimap(wf nodestore.WorkflowInterface) string
- type FuncLayout
- type LayoutOptions
- type UiConfig
Constants ¶
const ( KeyEndpoint = "endpoint" KeyAdminHomeURL = "admin_home_url" KeyNodeAdminURL = "node_admin_url" )
context keys used on the admin UI surface
const ( CONTROLLER_HOME = "home" CONTROLLER_WORKFLOWS = "workflows" CONTROLLER_NODES = "nodes" CONTROLLER_MESSAGES = "messages" CONTROLLER_EDITOR = "editor" CONTROLLER_SETTINGS = "settings" )
?controller= dispatch names
const SkinCSS = `` /* 5729-byte string literal not displayed */
SkinCSS is the shared admin skin: signal-red accent on the neutral Bootstrap canvas, mono "quick nav" pill strip, stat cards, status pills, tables, feed, settings sections and the workflow minimap. All colors resolve against Bootstrap CSS variables so light/dark (data-bs-theme) keeps working everywhere. Exported because the editor — a standalone page that bypasses the layout — injects the same skin so the shared chrome renders consistently there.
Variables ¶
This section is empty.
Functions ¶
func Layout ¶
func Layout(w http.ResponseWriter, r *http.Request, webpageTitle, webpageHtml string, options LayoutOptions) string
Layout is the default layout renderer. It builds a complete HTML page using hb.NewWebpage() with Bootstrap CDN, matching the shopadmin pattern. If a FuncLayout is provided in Options, it takes precedence over this default.
func Navbar ¶
func Navbar(r *http.Request, store nodestore.StoreInterface) hb.TagInterface
Navbar renders the application top bar: the mono brand mark with the signal-red flow dot and, on the right, the Bootlegance theme switcher dropdown — mode (light/dark/auto), theme picker and font-size controls. Section navigation lives in SectionNav (the "NODES ›" pill strip emitted inside each page's <main>). The page must include bootlegance.min.js (shared.Layout emits it in the head) for the switcher controls to wire up.
func NodeAdminURL ¶
NodeAdminURL returns the nodeadmin base URL injected into the request context by Handle, defaulting to /nodes.
func SectionNav ¶
func SectionNav(r *http.Request, store nodestore.StoreInterface) hb.TagInterface
SectionNav renders the node admin section navigation as the mono "NODES ›" pill strip. The active tab is derived from the ?controller= query parameter. Workflows, Nodes and Messages tabs show record counts as badges when the store is available.
func ShortID ¶ added in v0.3.0
ShortID renders an entity ID in the compact form used in list columns (first 12 chars — enough to disambiguate visually).
func WorkflowMinimap ¶ added in v0.3.0
func WorkflowMinimap(wf nodestore.WorkflowInterface) string
WorkflowMinimap renders a scaled SVG thumbnail of the workflow topology — real node positions normalized into the 120x44 viewBox with the stored edges drawn as connectors. Empty workflows render the bare dotted thumbnail.
Types ¶
type FuncLayout ¶
type FuncLayout func(w http.ResponseWriter, r *http.Request, webpageTitle, webpageHtml string, options LayoutOptions) string
FuncLayout renders the admin interface inside a host-provided layout (branding, menus). It receives the request and response writer so the host project can access request context when rendering. Returning "" falls back to the default Layout.
type LayoutOptions ¶
type LayoutOptions struct {
Styles []string
StyleURLs []string
Scripts []string
ScriptURLs []string
// Store enables the nav badges (Workflows/Messages counts) in the
// top navbar; nil renders the links badge-free.
Store nodestore.StoreInterface
}
LayoutOptions are the assets a page can inject into the layout
type UiConfig ¶
type UiConfig struct {
Store nodestore.StoreInterface
// Engine is the deployed-workflow engine the settings section
// inspects/tunes — carried as any so shared stays runner-agnostic;
// sections type-assert (stock engine: *noderunner.WorkflowEngine).
Engine any
Layout func(w http.ResponseWriter, r *http.Request, webpageTitle, webpageHtml string, options LayoutOptions) string
}
UiConfig holds the dependencies passed to section UI factories — the shopadmin/taskadmin pattern, with nodestore as the store