view

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 12 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

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 AccessBadge added in v1.11.0

func AccessBadge(s AccessSummary) templ.Component

AccessBadge renders "Public · 29" / "Restricted · 6" as a button that opens the user list for that row. Restricted-but-zero is called out in amber: the row is tagged with something nobody carries, so it is invisible to every non-admin — almost always a tag that was renamed or never handed out.

func AccessModalHost added in v1.11.0

func AccessModalHost() templ.Component

AccessModalHost is the empty shell the access + tag-usage modals render into. One per page, appended by the layout so every listing gets it for free.

func AccessSearch added in v1.11.0

func AccessSearch(countLabel string) templ.Component

AccessSearch is the one-line filter every admin listing gets: type a name, an id/path, or a tag and the rows that do not match disappear. Matching is client-side over data-search on each row, so it is instant and needs no round trip; an exact id match jumps straight to that row.

countLabel names what is being counted ("connectors", "tools") for the "3 of 46" readout.

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 AnalyticsPage added in v1.11.0

func AnalyticsPage(vm AnalyticsSPAVM, user *entity.User) templ.Component

AnalyticsPage hosts the user-analytics Svelte module inside the admin chrome. The page itself is a shell on purpose — the module is built and versioned on its own, so the table can grow (filters, ranges, a chart) without this file changing again.

func ConfigsHubPage

func ConfigsHubPage(user *entity.User, termux bool) 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, users []UserOption, 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 NetworkPage added in v1.11.1

func NetworkPage(dnsServers string, user *entity.User) templ.Component

func PluginTestsPage added in v1.16.0

func PluginTestsPage(vm PluginTestsVM, user *entity.User) templ.Component

func PluginsPage added in v1.14.0

func PluginsPage(vm PluginsSPAVM, user *entity.User) templ.Component

PluginsPage is a thin shell: data-embed="plugins" tells the manager entry to mount only the plugins view (no manager navbar or breadcrumbs).

func ProvidersAdminPage added in v1.10.0

func ProvidersAdminPage(rows []ProviderAdminRow, allTags []*entity.Tag, users []UserOption, user *entity.User) templ.Component

ProvidersAdminPage lists every provider instance with its two tag sets.

The two columns are two different jobs, not two strengths of the same one. Access decides who may PICK this provider for a project, session, channel or workflow; Manage decides who may look after its ACCOUNT in the Providers menu. Most people need the first and should never see the second, which is why the menu itself is manage-only.

Their empty states also fall opposite ways — blank Access means everyone, blank Manage means nobody but admins — so each picker says which, rather than leaving an operator to infer it once and wrongly.

func ResourcesAdminPage added in v0.17.0

func ResourcesAdminPage(title string, baseURL string, rows []ResourceAdminRow, allTags []*entity.Tag, owner ResourceOwnerEdit, 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 SchedulesAdminPage added in v1.10.0

func SchedulesAdminPage(vm ScheduleAdminVM, user *entity.User) templ.Component

SchedulesAdminPage lists every scheduled message with the identity its fires run as, and lets an admin re-point that identity.

The "runs as nobody" case is called out rather than left blank: such a schedule falls back to wick's internal principal, which carries no access tags, so it silently reaches less than the person who created it. That is the failure this page is meant to make obvious at a glance.

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 TagNames added in v1.2.9

func TagNames(all []*entity.Tag, ids []string) []string

TagNames resolves tag ids to names for a row's search blob. Unknown ids are skipped — a tag deleted under a row should not make it unsearchable.

func TagRowFragment

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

func TagUsageCell added in v1.11.0

func TagUsageCell(tagID string, users int, items int) templ.Component

TagUsageCell renders the Tags page counters: how many people carry the tag and how many things it opens, with an info button for the breakdown.

func TagsPage

func TagsPage(tags []*entity.Tag, user *entity.User, editID string, usage map[string]TagCounts) 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 AccessSummary added in v1.11.0

type AccessSummary struct {
	Path      string
	Public    bool
	UserCount int
	TotalUser int
	// Anyone: the item is reachable WITHOUT logging in. Only tools have this
	// state (entity.VisibilityPublic, "no login needed"); it outranks tags,
	// so it is rendered on its own rather than folded into Public.
	Anyone bool
	// OwnerScoped: this surface keeps an UNTAGGED row private to its owner
	// rather than open to everyone (projects, data tables, workflows,
	// skills). Such a row must never render as "Public".
	OwnerScoped bool
	// TagsInert: the row carries filter tags that the code deciding its
	// visibility never reads, so they grant nothing. Surfaced rather than
	// hidden — otherwise the only symptom is a share that silently does not
	// work.
	TagsInert bool
	// Unknown: the count could not be read (DB error). Rendered as "—" so a
	// failed query never masquerades as "nobody has access".
	Unknown bool
}

AccessSummary is the reach of one tag-gated row, as rendered by AccessBadge.

Public means the row carries no FILTER tag, which is not a mistake — it is wick's rule that an untagged thing belongs to everyone who can log in. The badge still prints the number, because "public" alone never tells an admin whether that is 3 people or 30.

func (AccessSummary) Reach added in v1.11.0

func (s AccessSummary) Reach() int

Reach is the number the badge shows: everyone for a public row, the tag-holders for a restricted one.

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 AnalyticsSPAVM added in v1.11.0

type AnalyticsSPAVM struct {
	AssetURL string
	DataURL  string
}

AnalyticsSPAVM is the thin shell's data: where the module's bundle lives, and which API it reads. Everything else is the module's business.

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 ConnectorAccountAdminRow added in v1.2.9

type ConnectorAccountAdminRow struct {
	Account    entity.ConnectorAccount
	OwnerLabel string
	TagIDs     []string
	// Access is the reach badge for the ACCOUNT itself — an account's tags
	// are a separate grant from its row's, which is exactly the distinction
	// that is easy to get wrong when reading the page.
	Access   AccessSummary
	TagNames []string
}

ConnectorAccountAdminRow is the view model for one connected OAuth account under its connector instance. OwnerLabel is the wick user who connected it ("" when the account predates ownership being recorded).

type ConnectorAdminRow added in v0.4.0

type ConnectorAdminRow struct {
	Connector     entity.Connector
	ModuleName    string
	ModuleIcon    string
	ModuleMissing bool
	// OwnerLabel is Connector.CreatedBy as a person. The raw column is a
	// uuid, and the owner of an instance is the one non-admin who can
	// configure it and see every account connected to it — a question the
	// page can only answer with a name.
	OwnerLabel string
	TagIDs     []string
	// Accounts are the OAuth identities connected to this instance, listed
	// underneath it. Each one is taggable in its own right: an account is
	// private to whoever connected it unless the instance shares the whole
	// pool, so a tag here is how an admin hands ONE account to a team.
	Accounts []ConnectorAccountAdminRow
	// Access is the reach badge; TagNames feeds the search blob.
	Access   AccessSummary
	TagNames []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
	// Access is the reach badge; TagNames feeds the search blob.
	Access   AccessSummary
	TagNames []string
}

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 MergeTarget added in v1.0.0

type MergeTarget struct {
	ID    string
	Label string
}

MergeTarget is one selectable destination account.

type MissingEntry

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

type PluginTestRow added in v1.16.0

type PluginTestRow struct {
	Req        entity.PluginTestRequest
	OwnerName  string
	OwnerEmail string
	// State is the displayed state: pending, active, expired, rejected, revoked.
	State string
	// Credential is the token that filed it, readable (PAT name …last4, or
	// the agent session).
	Credential string
}

PluginTestRow is one request joined with its requester's name/email.

type PluginTestsVM added in v1.16.0

type PluginTestsVM struct {
	Enabled bool
	Rows    []PluginTestRow
	// Filter is the selected state tab ("" = all); Counts is the number of
	// requests per state, over the unfiltered history.
	Filter string
	Counts map[string]int
	Total  int
}

PluginTestsVM is the Admin → Plugins → Development mode tab (/admin/plugins/dev-mode): the master switch and the recent requests (newest first).

type PluginsSPAVM added in v1.14.0

type PluginsSPAVM struct {
	AssetURL string
	Base     string
}

PluginsSPAVM hosts the manager SPA's plugins view in the admin chrome. AssetURL + Base come from manager.SPAMount(): the same bundle /manager serves, with its router still rooted at /manager so API calls resolve.

type ProviderAdminRow added in v1.10.0

type ProviderAdminRow struct {
	Type     string
	Name     string
	Binary   string
	Disabled bool
	// AccessTagIDs narrow WHO SEES the instance. Empty = everyone.
	AccessTagIDs []string
	// ManageTagIDs grant reconnect + usage re-check. Empty = admins only.
	ManageTagIDs []string
	// Path is the instance key used in the form URLs ("claude/engineer").
	Path string
	// Access is the reach badge for the ACCESS column (who may pick this
	// provider); TagNames feeds the search blob.
	Access   AccessSummary
	TagNames []string
	// OwnerID / OwnerLabel: the one user carrying the instance's owner tag
	// ("" = no owner). The owner may do what the instance's owner permissions allow.
	OwnerID    string
	OwnerLabel string
}

ProviderAdminRow is one provider instance on the access page: who may see it, and who may act on it.

type ResourceAdminRow added in v0.17.0

type ResourceAdminRow struct {
	ID        string
	Name      string
	Icon      string
	CreatedBy string
	// OwnerLabel is CreatedBy rendered as a person: the wick user's name and
	// email. A raw uuid in the Owner column names nobody — an admin reading
	// the page cannot tell whose project it is without looking the id up by
	// hand, which is the one question the column exists to answer. Falls back
	// to the id when it resolves to no user (a deleted account, or an id that
	// was never a user at all), because showing the id beats showing nothing.
	OwnerLabel string
	TagIDs     []string
	Path       string
	// Access is who can reach this row — see AccessBadge. Zero value renders
	// as a public badge, which is what an untagged row is.
	Access AccessSummary
	// TagNames feeds the search blob so a row is findable by the tag it
	// carries, not only by name or id.
	TagNames []string
	// Locked, when set, is why this row can never be shared (the Captain, a
	// remote set to "Only me"). The row is listed so an admin sees it exists,
	// but it shows no access badge and no tag picker.
	Locked 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 ResourceOwnerEdit added in v1.11.0

type ResourceOwnerEdit struct {
	Enabled bool
	Users   []UserOption
}

ResourceOwnerEdit turns the Owner column from a label into a picker. Only the surfaces that can actually re-stamp an owner pass Enabled — the rest render the same column read-only, so one page template still serves all of them.

type ScheduleAdminRow added in v1.10.0

type ScheduleAdminRow struct {
	ID string
	// Type is message | watch; LastResult is a watch's latest run result
	// (matched | pending | error), empty for messages.
	Type       string
	LastResult string
	Message    string
	Kind       string
	Status     string
	Cron       string
	NextRunAt  string
	// NextRunLabel is the short, human form of NextRunAt ("13 Sep 10:30").
	// The full timestamp stays in NextRunAt for the tooltip — a column of
	// RFC3339 strings is what pushed this table into a sideways scroll.
	NextRunLabel string
	SessionID    string
	SessionMode  string
	ProjectID    string
	ProjectName  string
	CreatedBy    string
	OwnerUserID  string
	OwnerLabel   string
	// RunAsUserID is the explicit admin override, empty when the schedule
	// simply runs as its owner.
	RunAsUserID string
	// RunAs is what the runner will actually use, and RunAsLabel its display
	// name. Empty means the fire is attached to nobody.
	RunAs      string
	RunAsLabel string
}

ScheduleAdminRow is one scheduled message on the admin page. Identity is the point of this screen, so OwnerLabel / RunAsLabel are always rendered — including when they are empty, which is the state worth noticing.

type ScheduleAdminVM added in v1.10.0

type ScheduleAdminVM struct {
	Rows  []ScheduleAdminRow
	Users []ScheduleUserOption
	// Status is the active filter — "live" (default), "all", or a concrete
	// status like "done". Live is the default because a finished schedule can
	// no longer run as the wrong user, so it is never the thing to act on.
	Status string
	Query  string
	// Counts is per-filter totals over EVERY schedule, so a tab still says how
	// much sits behind it while you are looking at another one.
	Counts     map[string]int
	Page       int
	Pages      int
	Total      int
	PageSize   int
	Configured bool
}

ScheduleAdminVM is the whole page: the rows for the CURRENT filter and page, plus the state needed to render the controls and keep them sticky across navigation.

type ScheduleUserOption added in v1.10.0

type ScheduleUserOption = UserOption

ScheduleUserOption is one entry in the "Run as" picker. An alias rather than its own type: the projects and connectors owner pickers offer the same list of approved users, and one shape means one builder (Handler.userOptions) feeds all three.

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

	// Live process state, so the page can tell a completed handover from a
	// page it merely reloaded, and can show what a Force swap would cut off.
	ServingPID int    // pid of the process that rendered this page
	Settle     string // drain settle window, e.g. "15s"

	// A build that is installed or downloaded but not yet running. The card
	// only appears while one is waiting — with nothing to swap there is
	// nothing to say.
	SwapPending bool
	SwapFrom    string // version running now
	SwapTo      string // version waiting
	SwapSource  string // binary path, or "staged update (not applied yet)"
	SwapBuilt   string // build timestamp of the waiting binary
	// SwapBlocked is why the waiting build will never be applied on its own.
	// Empty is the normal case. When set, the card says so instead of
	// counting down to a swap that cannot happen.
	SwapBlocked string
	SwapWant    string   // the version that WOULD be accepted
	Graceful    bool     // this process can hand its socket to a successor
	Busy        []string // work in flight right now ("agent turns=2 (sess-x)")
}

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 TagCounts added in v1.11.0

type TagCounts struct {
	Users int
	Items int
}

TagCounts is one tag's reach, rendered by TagUsageCell: how many approved users carry it and how many items it gates.

type ToolRow

type ToolRow struct {
	Tool        tool.Tool
	Visibility  entity.ToolVisibility
	Disabled    bool
	TagIDs      []string
	ConfigCount int
	// Access is the reach badge; TagNames feeds the search blob.
	Access   AccessSummary
	TagNames []string
}

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 UserOption added in v1.2.9

type UserOption struct {
	ID    string
	Label string
}

UserOption is one entry in a user picker — the "Run as" select on the schedules page, and the "Owner" select on projects and connectors. Label is the display name the admin reads; ID is what the form posts back.

type UserRow

type UserRow struct {
	User   *entity.User
	TagIDs []string
	// NeedsMerge marks an account created by a channel that reports no email
	// (Telegram), which wick therefore could not match to a person. Such a row
	// is not meant to be approved on its own — approving it would leave that
	// person with two accounts — so the UI offers a merge instead.
	NeedsMerge bool
	// MergeTargets lists the accounts this one may be folded into. Only
	// approved non-channel accounts, since merging into a pending or synthetic
	// account just moves the problem.
	MergeTargets []MergeTarget
	// Self marks the row belonging to the admin looking at the page. It is
	// the one account "View as" is not offered for — switching into yourself
	// does nothing except strand the return cookie.
	Self bool
}

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