dashpages

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PagesConfig

type PagesConfig struct {
	EnableSettings bool
	EnableSearch   bool
	BasePath       string
	EnableAuth     bool
	DefaultAccess  string // "public", "protected", "partial"
	LoginPath      string // relative login path (e.g. "/auth/login")
	// RootContributor, when set, makes "/" render this contributor's landing
	// page in place instead of redirecting to the React shell at {BasePath}/ui.
	RootContributor string
}

PagesConfig holds configuration for the PagesManager.

type PagesManager

type PagesManager struct {
	// contains filtered or unexported fields
}

PagesManager registers and serves dashboard pages using forgeui's routing system. Page handlers return templ components and delegate rendering to the contributor system. Layout wrapping is handled automatically by forgeui.

func NewPagesManager

func NewPagesManager(
	fuiApp *forgeui.App,
	basePath string,
	registry *contributor.ContributorRegistry,
	collector *collector.DataCollector,
	history *collector.DataHistory,
	fragmentProxy *proxy.FragmentProxy,
	settingsAgg *settings.Aggregator,
	config PagesConfig,
) *PagesManager

NewPagesManager creates a new PagesManager.

func (*PagesManager) ContributorPage

func (pm *PagesManager) ContributorPage(ctx *router.PageContext) (templ.Component, error)

ContributorPage renders a page from a named contributor extension. The contributor name and file path are extracted from route parameters. When auth is enabled, it dynamically applies the access level from the contributor's NavItem.Access field.

func (*PagesManager) RegisterPages

func (pm *PagesManager) RegisterPages() error

RegisterPages registers all dashboard page routes with forgeui's router. Core dashboard pages inherit the default layout (typically "dashboard"). Settings pages use the "settings" layout (nested under dashboard).

func (*PagesManager) RemotePage

func (pm *PagesManager) RemotePage(ctx *router.PageContext) (templ.Component, error)

RemotePage fetches a page from a remote contributor via the fragment proxy and returns the raw HTML fragment. ForgeUI wraps it in the dashboard layout.

func (*PagesManager) RemoteWidget

func (pm *PagesManager) RemoteWidget(ctx *router.PageContext) (templ.Component, error)

RemoteWidget fetches a widget from a remote contributor via the fragment proxy.

func (*PagesManager) SetAuthEnabled added in v1.2.0

func (pm *PagesManager) SetAuthEnabled(enabled bool, defaultAccess, loginPath string)

SetAuthEnabled updates the auth configuration at runtime. This is used for late auth registration when an auth provider registers after the pages manager has already been constructed.

func (*PagesManager) SettingsFormPage added in v1.2.0

func (pm *PagesManager) SettingsFormPage(ctx *router.PageContext) (templ.Component, error)

SettingsFormPage renders a contributor's settings form.

func (*PagesManager) SettingsPage added in v1.2.0

func (pm *PagesManager) SettingsPage(ctx *router.PageContext) (templ.Component, error)

SettingsPage renders the settings index page listing all available settings.

func (*PagesManager) SettingsSubmitPage added in v1.2.0

func (pm *PagesManager) SettingsSubmitPage(ctx *router.PageContext) (templ.Component, error)

SettingsSubmitPage processes a settings form submission and re-renders the form.

func (*PagesManager) WidgetFragment

func (pm *PagesManager) WidgetFragment(ctx *router.PageContext) (templ.Component, error)

WidgetFragment renders a single widget as an HTML fragment for HTMX auto-refresh.

Jump to

Keyboard shortcuts

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