pages

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

View Source
const DefaultPerPage = 25

DefaultPerPage is the lists' page size. Twenty-five fits a laptop screen without endless scrolling and without forcing a page turn on every glance.

Variables

This section is empty.

Functions

func Login

func Login(d LoginData) templ.Component

Login is the sign-in screen, in the same style as the rest of the interface: a grid background with a halo on the accent, the brand centred above, and a single card with a luminous ring.

It sits OUTSIDE the Base layout: the sidebar navigates to screens this session cannot see yet, and offering those links to somebody who has not signed in only produces a trip back to the login itself.

func Overview

func Overview(d OverviewData) templ.Component

func Projects added in v0.7.0

func Projects(ps []postgres.ProjectSummary) templ.Component

func Run

func Run(r run.Run, logs []postgres.StepLog, raised []alerts.Record) templ.Component

Run shows one run. The header comes from the server already rendered; only the DAG with each step's state depends on JavaScript.

func Runs

func Runs(runs []postgres.RunSummary, f RunFilter, total int) templ.Component

func Workflow

func Workflow(w wf.Workflow, latest []postgres.RunSummary) templ.Component

Workflow shows the published definition. With no run state: it is the screen for "what this workflow is", and it has to serve a workflow that never ran too.

func Workflows

func Workflows(ws []postgres.WorkflowSummary, tags []string, f Filter, total, filtered int) templ.Component

Types

type Filter added in v0.7.0

type Filter struct {
	Search string
	State  string // ultimo estado: failed, queued, running, success
	Active string // active | paused
	Tag    string

	// Sort is the sort field; Desc inverts it. They live in the URL for the same
	// reason the filters do: a sorted screen has to be pasteable to somebody
	// else.
	Sort string
	Desc bool

	Page    int
	PerPage int
}

Filter holds the search bar's state. It lives in the URL, not in memory: that way an applied filter can be pasted into the on-call chat and opens the same on the other lado.

func (Filter) Arrow added in v0.7.0

func (f Filter) Arrow(field string) string

Arrow is the direction indicator in the header.

func (Filter) With added in v0.7.0

func (f Filter) With(field, value string) string

With returns the same URL with one field swapped — since every chip becomes a link, the rest of the filter has to survive the click.

Changing a filter always returns to the first page: staying on page 7 of a result that now has two would be an empty screen with no explanation.

func (Filter) WithPage added in v0.7.0

func (f Filter) WithPage(n int) string

WithPage navigates without touching anything else.

func (Filter) WithSort added in v0.7.0

func (f Filter) WithSort(field string) string

WithSort flips the direction when the field is already the sorted one, and starts ascending when it is another — the behaviour any table teaches.

type LoginData added in v0.7.0

type LoginData struct {
	// Target is where to return to after signing in. Already sanitized by
	// auth.Target.
	Target string

	// Err appears above the form. One message, and a generic one on purpose:
	// telling "no such user" from "wrong password" hands whoever is guessing
	// which of the two halves they already got right.
	Err string
}

LoginData is the sign-in screen's state.

type NextRun added in v0.7.0

type NextRun struct {
	Workflow string
	Cron     string
	Timezone string
	When     time.Time
}

ProximaExecucao is a future trigger, already computed from the cron.

type OverviewData added in v0.7.0

type OverviewData struct {
	Window   time.Duration
	Ind      postgres.Indicators
	Buckets  []postgres.Bucket
	EmCurso  []postgres.RunSummary
	Proximas []NextRun
	Recentes []postgres.RunSummary
	Pending  int
}

OverviewData is everything the landing screen shows. A struct rather than seven parameters: the signature was already illegible with four.

type Pagination added in v0.7.0

type Pagination struct {
	Page    int
	PerPage int
	Total   int

	// PageLink builds each page's URL. Injected so the same component serves
	// /workflows and /runs, which have different filters.
	PageLink func(int) string
}

Pagination is the footer of any paginated list.

func (Pagination) First added in v0.7.0

func (p Pagination) First() int

func (Pagination) Last added in v0.7.0

func (p Pagination) Last() int

func (Pagination) Pages added in v0.7.0

func (p Pagination) Pages() int

func (Pagination) Window added in v0.7.0

func (p Pagination) Window() []int

Window returns the page numbers to show, centred on the current one. Listing them all would break the footer with a hundred pages.

type RunFilter added in v0.7.0

type RunFilter struct {
	State    string
	Workflow string
	De       string // YYYY-MM-DDTHH, the same format the chart emits
	Ate      string
	Label    string // descricao legivel do periodo, montada no servidor

	Page    int
	PerPage int
}

RunFilter is the run screen's slice. It arrives through the query string, so a dashboard chart can point at "that hour's runs" with a link.

func (RunFilter) Active added in v0.7.0

func (f RunFilter) Active() bool

Active says whether there is any slice — without it the screen would show the "filters aplicados" vazia.

func (RunFilter) With added in v0.7.0

func (f RunFilter) With(field, value string) string

func (RunFilter) WithPage added in v0.7.0

func (f RunFilter) WithPage(n int) string

Jump to

Keyboard shortcuts

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