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
- 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_MESSAGES = "messages" CONTROLLER_EDITOR = "editor" CONTROLLER_SETTINGS = "settings" )
?controller= dispatch names
const MountAppJS = `` /* 194-byte string literal not displayed */
MountAppJS mounts the shared app-navigation chrome — every section page passes it via LayoutOptions.Scripts so the navbar renders (the shell layout emits <app-navigation> inside #app)
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-level navigation bar: brand, section links (active derived from ?controller=, badges when the store is available) and the Bootlegance theme switcher dropdown — mode (light/dark/auto), theme picker and font-size controls. 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 pills, matching the nav-pills pattern used across the external admin packages (shopadmin, taskadmin). The active tab is derived from the ?controller= query parameter. Workflows and Messages tabs show record counts as badges when the store is available.
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