Documentation
¶
Overview ¶
Package nodeadmin provides a mountable admin interface for the nodestore-backed node domain, following the same dracory admin module pattern as flowadmin.
The package exposes a single entry point, New(Options), which returns an http.Handler that the host application can mount under any path on any router (net/http ServeMux, chi, gin, echo, etc.).
The admin UI surface is one Handle(w, r) mounted at "/" dispatching on the ?controller= query parameter through a routes map built once at construction (default: the home dashboard). Sections are functions (section.UI(uiConfig).SectionName(w, r)); outer chrome is host-owned through Options.FuncLayout, falling back to shared.Layout. The API is served under /api/* by the api subpackage backed by nodestore.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStoreRequired = errors.New("nodeadmin: store is required")
ErrStoreRequired is returned by New when Options.Store is nil
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface {
http.Handler
// Handle is the single admin-surface entry point: the
// ?controller= query parameter is dispatched through the routes
// map built once at construction.
Handle(w http.ResponseWriter, r *http.Request)
// HTTPRouter returns the shared-listener adapter mounted on this
// handler — the nodebase.HTTPRouter the engine is wired with at New.
// Routes registered through it serve on this handler, behind the
// same access check.
HTTPRouter() nodebase.HTTPRouter
}
Interface defines the node admin. It is a standard http.Handler and can be mounted on any router.
type Options ¶
type Options struct {
// Store is the nodestore.StoreInterface used for persistence
// (required).
Store nodestore.StoreInterface
// IsAccessAllowed reports whether the request may use the admin.
// Authentication is host-owned (GOD ruling 2026-11-25): sessions,
// login, users and roles all live outside this package — it only
// asks this one question per request. Nil means open (standalone
// or dev mode).
IsAccessAllowed func(r *http.Request) bool
// denied — the host decides: a redirect to its login page, a JSON
// 401 for API clients, etc. Nil replies "authentication required"
// with status 401.
OnUnauthorized func(w http.ResponseWriter, r *http.Request)
// GetAuthUserID returns the authenticated user's ID for display
// and audit purposes only — it is never consulted for the access
// decision. Optional.
GetAuthUserID func(r *http.Request) string
// AdminHomeURL is the admin home link exposed to sections through
// the request context (default: "/").
AdminHomeURL string
// NodeAdminURL is the base URL the node admin is mounted on —
// injected into the request context for section link building
// (default: "/nodes").
NodeAdminURL string
// Engine is the engine deployed workflows run in, expressed as the
// narrow api.EngineInterface contract — nodeadmin does not depend
// on a concrete runner (GOD ruling 2026-11-24; the stock
// noderunner.WorkflowEngine satisfies it structurally). If nil a
// fresh noderunner engine is created. On mount, engines that
// support it resume every workflow whose persisted deployed flag
// is set (restart-resume).
Engine api.EngineInterface
// FuncLayout is an optional function to render the admin interface
// inside your own layout (branding, menus, etc.). If nil, the
// default shared.Layout is used.
FuncLayout shared.FuncLayout
// DisableChrome hands chrome ownership to the host: the editor —
// a standalone page that bypasses FuncLayout — emits no nodeadmin
// navbar or section pills so an embedding host can wrap it in its
// own chrome. Sections are unaffected (they already render through
// FuncLayout when set). The zero value keeps the default chrome.
DisableChrome bool
}
Options contains all dependencies and configuration for the node admin.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api provides the JSON API for the node admin surface — POST endpoints returning dracory/api envelopes, same convention as flowadmin/api but backed by nodestore.
|
Package api provides the JSON API for the node admin surface — POST endpoints returning dracory/api envelopes, same convention as flowadmin/api but backed by nodestore. |
|
Package dashboard serves the end-user dashboard client page — the single-file HTML shell + widget renderers ported from the retiring pkg/flowdashboard.
|
Package dashboard serves the end-user dashboard client page — the single-file HTML shell + widget renderers ported from the retiring pkg/flowdashboard. |
|
Package editor serves the workflow editor — the same Vue app as flowadmin's /editor — as a nodeadmin section selected through ?controller=editor.
|
Package editor serves the workflow editor — the same Vue app as flowadmin's /editor — as a nodeadmin section selected through ?controller=editor. |
|
Package nodes renders the all-node-instances list section — a flat inventory of every stored node entity across workflows, with its type, parent workflow, node group and wire counts, and an open-in-editor deep link.
|
Package nodes renders the all-node-instances list section — a flat inventory of every stored node entity across workflows, with its type, parent workflow, node group and wire counts, and an open-in-editor deep link. |
|
Package settings is the settings section of the node admin, modeled on flowadmin's settingsmanager (itself the taskadmin/shopadmin folder-per-controller pattern): the nodeadmin dispatch map invokes section.UI(uiConfig).SettingsManager(w, r) for ?controller=settings — no action renders the page through the UiConfig layout, ?action=load-settings and ?action=save-setting answer JSON AJAX requests in the dracory/api envelope under the same controller URL.
|
Package settings is the settings section of the node admin, modeled on flowadmin's settingsmanager (itself the taskadmin/shopadmin folder-per-controller pattern): the nodeadmin dispatch map invokes section.UI(uiConfig).SettingsManager(w, r) for ?controller=settings — no action renders the page through the UiConfig layout, ?action=load-settings and ?action=save-setting answer JSON AJAX requests in the dracory/api envelope under the same controller URL. |