view

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessTokensPage added in v0.4.0

func AccessTokensPage(rows []AccessTokenRow, stats AccessTokensStats, user *entity.User) templ.Component

func AdminJobsPage

func AdminJobsPage(rows []JobRow, allTags []*entity.Tag, user *entity.User) templ.Component

func AdminLayout

func AdminLayout(title string, activeTab string, user *entity.User) templ.Component

func ConfigsHubPage

func ConfigsHubPage(user *entity.User) templ.Component

ConfigsHubPage is the landing page for /admin/advanced. It's a card grid that points to each subsection (Variables, SSO, …). Add a new card when adding a new config category.

func ConnectionsAdminPage added in v0.4.0

func ConnectionsAdminPage(rows []ConnectionRow, stats ConnectionsAdminStats, user *entity.User) templ.Component

func ConnectorsAdminPage added in v0.4.0

func ConnectorsAdminPage(rows []ConnectorAdminRow, allTags []*entity.Tag, user *entity.User) templ.Component

func DashboardPage

func DashboardPage(stats DashboardStats, missing []MissingEntry, user *entity.User) templ.Component

func JustCreatedUserBanner added in v0.16.0

func JustCreatedUserBanner(email, password string) templ.Component

JustCreatedUserBanner is the green callout shown once after a user is created. The plaintext password is unrecoverable from this point on.

func ResourcesAdminPage added in v0.17.0

func ResourcesAdminPage(title string, baseURL string, rows []ResourceAdminRow, allTags []*entity.Tag, user *entity.User) templ.Component

func SSOPage

func SSOPage(rows []entity.SSOProvider, callbackURL string, user *entity.User) templ.Component

SSOPage lists every SSO provider. Each provider is a card with an inline edit form — there's only Google for now, but the UI scales to any providers Bootstrap registers.

func SystemPage added in v0.23.3

func SystemPage(d SystemPageData, user *entity.User) templ.Component

SystemPage renders version info, the update controls (Check → progress → Apply & restart), and the auto-update toggle. The inline script opens an SSE stream for live progress and, on Apply, swaps to a "Restarting…" panel that polls /health until the new build answers, then reloads.

func TagRowFragment

func TagRowFragment(t *entity.Tag, editing bool) templ.Component

func TagsPage

func TagsPage(tags []*entity.Tag, user *entity.User, editID string) templ.Component

func ToolRowFragment

func ToolRowFragment(row ToolRow, tagsJSON string) templ.Component

func ToolsPage

func ToolsPage(rows []ToolRow, allTags []*entity.Tag, user *entity.User) templ.Component

func UserRowFragment

func UserRowFragment(row UserRow, tagsJSON string, adminCount int) templ.Component

func UsersPage

func UsersPage(rows []UserRow, allTags []*entity.Tag, user *entity.User, adminCount int, created UserCreateResult) templ.Component

func VariablesPage

func VariablesPage(rows []entity.Config, editKey string, user *entity.User) templ.Component

Types

type AccessTokenRow added in v0.4.0

type AccessTokenRow struct {
	Token      entity.PersonalAccessToken
	OwnerName  string
	OwnerEmail string
}

AccessTokenRow is the view model for one Personal Access Token in the admin access-tokens table. OwnerName / OwnerEmail are joined from the user table so the row can show who owns the token without an N+1 lookup. PATs are general-purpose bearers — MCP is just one caller — so the surface lives at /admin/access-tokens.

type AccessTokensStats added in v0.4.0

type AccessTokensStats struct {
	ActiveTokens int
	UsersWithPAT int
	NeverUsed    int
}

AccessTokensStats summarises the PAT footprint for the admin landing banner. Counts are computed by the handler so the template stays pure-rendering.

type ConnectionRow added in v0.4.0

type ConnectionRow struct {
	UserID     string
	OwnerName  string
	OwnerEmail string
	ClientID   string
	ClientName string
	GrantedAt  time.Time
	LastUsedAt *time.Time
	TokenCount int
}

ConnectionRow is the view model for one (user, OAuth client) grant in the admin connections table. Owner fields come from the user table; Granted/LastUsed/TokenCount are aggregated across the active access + refresh tokens for that pair.

type ConnectionsAdminStats added in v0.4.0

type ConnectionsAdminStats struct {
	ActiveGrants  int
	UniqueClients int
	UniqueUsers   int
}

ConnectionsAdminStats summarises OAuth grant activity for the admin connections landing.

type ConnectorAdminRow added in v0.4.0

type ConnectorAdminRow struct {
	Connector     entity.Connector
	ModuleName    string
	ModuleIcon    string
	ModuleMissing bool
	TagIDs        []string
}

ConnectorAdminRow is the view model for a single connector instance in the admin connectors table. ModuleName/Icon come from the in-memory registry; when the row's Key has no registered module (deleted from code after a deploy) ModuleMissing is true so the UI can mark it.

type DashboardStats

type DashboardStats struct {
	TotalJobs          int
	EnabledJobs        int
	RunningJobs        int
	TotalTools         int
	TotalConfigs       int
	MissingConfigs     int
	TotalConnectors    int
	DisabledConnectors int
	ActiveTokens       int
	ConnectedApps      int
}

type JobRow

type JobRow struct {
	Job         entity.Job
	Disabled    bool
	IsSystem    bool
	TagIDs      []string
	ConfigCount int
}

JobRow is the view model for a single job row in the admin jobs table.

IsSystem mirrors the entity.Tag.IsSystem flag for any tag attached to this job's path. When true the row is rendered read-only — no Hide button, tag picker locked, no Save — because a System job is owned by code (see internal/tags/defaults.go and connector-runs-purge for the canonical example). Server-side guards in handler.setJobDisabled and handler.setJobTags backstop the same rule.

type MissingEntry

type MissingEntry struct {
	Scope   string
	Key     string
	Name    string
	Icon    string
	URL     string
	Missing []string
}

type ResourceAdminRow added in v0.17.0

type ResourceAdminRow struct {
	ID        string
	Name      string
	Icon      string
	CreatedBy string
	TagIDs    []string
	Path      string
}

ResourceAdminRow is a generic view model used by the Projects, Workflows, and Skills admin pages. Each row shows a name, optional icon, optional created-by audit field, and a tag picker addressed by Path.

type SystemPageData added in v0.23.3

type SystemPageData struct {
	// App identity + build (mirrors wick_info).
	AppName        string // configured app name (e.g. "wick-lab")
	CurrentVersion string // running app version
	WickVersion    string // embedded wick framework version
	Commit         string // build commit (short)
	BuildTime      string // build timestamp
	AccessType     string // "http" (web) or "cli"
	DBType         string // "sqlite" / "postgres" / "none"
	DBStatus       string // "connected" / "error: …" / "disabled"

	// Update state.
	Configured    bool   // a release source is set; check/apply are usable
	IsOfficial    bool   // release repo is the canonical wick repo (wick-agent)
	LatestVersion string // last-known latest tag (may be empty)
	HasStaged     bool   // a downloaded binary is ready to apply
	StagedVersion string // version of the staged binary
	Phase         string // coordinator phase at load time
	Percent       int    // download percent at load time
	ReleaseNotes  string // latest release body (what changed)
	PublishedAt   string // latest release date (RFC3339)
	WantedAsset   string // asset that was missing when no build exists for this OS
	ChangelogURL  string // link to the full changelog (site or GitHub releases)
	Error         string // last error, if any
	AutoUpdate    bool   // auto-update toggle state

	// Wick framework update state (non-official builds). Sourced from the
	// background version cache — the public wick repo is always checkable,
	// independent of whether THIS app set a release source. Rendered
	// server-side at first paint, so no live fetch on load. On official
	// builds these go unused (app == framework; the app fields above carry
	// the framework's update state too).
	WickUpdateKnown  bool   // a wick version check has resolved
	WickUpdate       bool   // a newer wick framework release exists
	WickLatest       string // latest wick release tag
	WickNotes        string // wick changelog (current→latest), markdown
	WickPublishedAt  string // latest wick release date (RFC3339)
	WickChangelogURL string // full wick changelog link
}

SystemPageData is everything the System page needs for first paint. The live download progress arrives over SSE after load, but these fields make the no-JS / first-render state correct: version rows, the auto-update toggle, and whether a staged update is ready to apply.

type ToolRow

type ToolRow struct {
	Tool        tool.Tool
	Visibility  entity.ToolVisibility
	Disabled    bool
	TagIDs      []string
	ConfigCount int
}

ToolRow is the view model for a single tool row in the admin table.

type UserCreateResult added in v0.16.0

type UserCreateResult struct {
	Email    string
	Password string
	ErrMsg   string
}

UserCreateResult carries the one-time outcome of an admin "Add user" submit. Password is the freshly generated plaintext, surfaced once in a banner on the synchronous POST response and never stored or shown again. ErrMsg holds a creation error (e.g. duplicate email) to render instead. All fields are zero on a normal page load.

type UserRow

type UserRow struct {
	User   *entity.User
	TagIDs []string
}

UserRow is the view model for a single user row in the admin table.

Jump to

Keyboard shortcuts

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