Documentation
¶
Overview ¶
templ: version: v0.3.1020
templ: version: v0.3.1020
Index ¶
- Constants
- func Login(d LoginData) templ.Component
- func Overview(d OverviewData) templ.Component
- func Projects(ps []postgres.ProjectSummary) templ.Component
- func Run(r run.Run, logs []postgres.StepLog, raised []alerts.Record) templ.Component
- func Runs(runs []postgres.RunSummary, f RunFilter, total int) templ.Component
- func Workflow(w wf.Workflow, latest []postgres.RunSummary) templ.Component
- func Workflows(ws []postgres.WorkflowSummary, tags []string, f Filter, total, filtered int) templ.Component
- type Filter
- type LoginData
- type NextRun
- type OverviewData
- type Pagination
- type RunFilter
Constants ¶
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 ¶
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 Run ¶
Run shows one run. The header comes from the server already rendered; only the DAG with each step's state depends on JavaScript.
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) With ¶ added in v0.7.0
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.
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 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.