dashboard

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

templ: version: v0.3.1001

Package dashboard provides a server-rendered web UI for Engram Cloud. It uses templ for HTML templating and htmx for partial page updates. All static assets are embedded in the binary via go:embed.

templ: version: v0.3.1001

templ: version: v0.3.1001

Index

Constants

This section is empty.

Variables

View Source
var StaticFS embed.FS

StaticFS embeds the static/ directory (htmx.min.js, pico.min.css, styles.css) into the binary so no external files are needed at runtime.

Functions

func AdminForbidden

func AdminForbidden() templ.Component

AdminForbidden renders the 403 page for non-admin users.

func AdminHealthPage

func AdminHealthPage(health *cloudstore.SystemHealthInfo) templ.Component

AdminHealthPage renders the system health detail view.

func AdminPage

AdminPage renders the admin dashboard landing with sub-navigation.

func AdminProjectsPage

func AdminProjectsPage(controls []cloudstore.ProjectSyncControl) templ.Component

AdminProjectsPage renders organization-level project sync controls.

func AdminUsersPage

func AdminUsersPage(users []cloudstore.CloudUser) templ.Component

AdminUsersPage renders the user management view.

func BrowserPage

func BrowserPage(projects []string, types []string, activeProject string, search string, activeType string) templ.Component

BrowserPage renders the knowledge browser with subtabs and filter controls.

func ContributorDetailPage

func ContributorDetailPage(user *cloudstore.CloudUser, contributor *cloudstore.ContributorStat, sessions []cloudstore.CloudSessionSummary, observations []cloudstore.CloudObservation, prompts []cloudstore.CloudPrompt) templ.Component

func ContributorsPage

func ContributorsPage(contributors []cloudstore.ContributorStat) templ.Component

ContributorsPage renders the contributors list view.

func DashboardHome

func DashboardHome(username string) templ.Component

DashboardHome renders the main dashboard landing content with project stats.

func DashboardStatsPartial

func DashboardStatsPartial(stats []cloudstore.ProjectStat, projects []string) templ.Component

DashboardStatsPartial renders the project stats table, loaded via htmx.

func EmptyState

func EmptyState(title string, message string) templ.Component

EmptyState renders a centered empty-state placeholder.

func Layout

func Layout(title string, username string, activeTab string, isAdmin bool, content templ.Component) templ.Component

Layout wraps page content in the base HTML shell with nav, head, and footer. activeTab should be one of: "dashboard", "browser", "projects", "contributors", "admin".

func LoginPage

func LoginPage(errorMsg string) templ.Component

LoginPage renders the standalone login page (no layout wrapper).

func Mount

func Mount(mux *http.ServeMux, store *cloudstore.CloudStore, authSvc *auth.Service, cfg DashboardConfig)

Mount registers all dashboard routes on the given mux. It attaches:

  • GET /dashboard/static/* — embedded static files (htmx, CSS)
  • GET /dashboard/health — dashboard health check
  • GET /dashboard/login — login page (unauthenticated)
  • POST /dashboard/login — login form submission
  • POST /dashboard/logout — clear session cookie
  • GET /dashboard/ — main dashboard (authenticated)
  • GET /dashboard/stats — dashboard stats partial (htmx)
  • GET /dashboard/browser — knowledge browser page
  • GET /dashboard/browser/observations — observations partial (htmx)
  • GET /dashboard/browser/sessions — sessions partial (htmx)
  • GET /dashboard/browser/prompts — prompts partial (htmx)
  • GET /dashboard/projects — projects list
  • GET /dashboard/projects/{name} — project detail
  • GET /dashboard/contributors — contributors list
  • GET /dashboard/admin — admin overview (admin only)
  • GET /dashboard/admin/users — admin user management (admin only)
  • GET /dashboard/admin/health — admin system health (admin only)
func NavTabs(activeTab string, isAdmin bool) templ.Component

NavTabs renders the navigation tab bar. activeTab should be one of: "dashboard", "browser", "projects", "contributors", "admin".

func ObservationDetailPage

func ObservationDetailPage(observation *cloudstore.CloudObservation, session *cloudstore.CloudSession, related []cloudstore.CloudObservation) templ.Component

ObservationDetailPage renders the full observation payload with session context.

func ObservationsPartial

func ObservationsPartial(observations []cloudstore.CloudObservation) templ.Component

ObservationsPartial renders the observations list, loaded as an htmx partial.

func ProjectDetailPage

func ProjectDetailPage(project string, stats *cloudstore.ProjectStat, control *cloudstore.ProjectSyncControl, sessions []cloudstore.CloudSessionSummary, observations []cloudstore.CloudObservation, prompts []cloudstore.CloudPrompt) templ.Component

ProjectDetailPage renders the detail view for a single project.

func ProjectsPage

func ProjectsPage(stats []cloudstore.ProjectStat, controls map[string]cloudstore.ProjectSyncControl) templ.Component

ProjectsPage renders the projects list view.

func PromptDetailPage

func PromptDetailPage(prompt *cloudstore.CloudPrompt, session *cloudstore.CloudSession, related []cloudstore.CloudPrompt) templ.Component

func PromptsPartial

func PromptsPartial(prompts []cloudstore.CloudPrompt) templ.Component

PromptsPartial renders the prompts list, loaded as an htmx partial.

func SessionDetailPage

func SessionDetailPage(session *cloudstore.CloudSession, observations []cloudstore.CloudObservation, prompts []cloudstore.CloudPrompt) templ.Component

SessionDetailPage renders a connected session detail surface with all related activity.

func SessionsPartial

func SessionsPartial(sessions []cloudstore.CloudSessionSummary) templ.Component

SessionsPartial renders the sessions list, loaded as an htmx partial.

func StatusBadge

func StatusBadge(label string, variant string) templ.Component

StatusBadge renders a colored status badge. variant should be one of: "success", "warning", "danger", "muted".

Types

type DashboardConfig

type DashboardConfig struct {
	// AdminEmail is the email of the admin user. When set, the Admin tab is
	// visible to the authenticated user whose email matches this value.
	// Populated from the ENGRAM_CLOUD_ADMIN environment variable.
	AdminEmail string
}

DashboardConfig holds dashboard-specific configuration.

Jump to

Keyboard shortcuts

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