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, st WorkflowStats) 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
- type WorkflowStats
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: the brand, two fields and a button, on a flat ground. Nothing else.
It used to carry a background grid, a halo on the accent and a card with a luminous ring around it. All three were decoration on a screen with one job, and the ring in particular made the form look like a dialog that had opened over something -- over nothing.
There is no "forgot password" here, and there never was: this installation's accounts come from its own configuration, so a reset link would lead to a screen that cannot exist.
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
Projects is the list of namespaces.
A project is what makes a workflow's slug unique WITHIN it -- two projects can each have a `daily_ingest` -- and it arrives from `brevis publish --project`. This screen used to end there: four numbers and a date, with nothing to click. A page that only tells you a thing exists is a page people stop opening.
Each card now leads to that project's workflows, which is the one question the namespace exists to answer.
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.
func Workflow ¶
func Workflow(w wf.Workflow, latest []postgres.RunSummary, st WorkflowStats) 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
// Project scopes the list to one project's workflows. It is what makes a
// project more than a row on a screen: the slug is unique WITHIN a project,
// so two of them can each have a `daily_ingest`, and until this existed
// there was no way to look at one project's half of that.
Project 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.
type WorkflowStats ¶ added in v0.11.2
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. WorkflowStats is one workflow's numbers, over workflowWindow.
Every field degrades to its zero value on purpose: a definition has to stay readable with the database in trouble, and somebody looking at a broken installation is exactly who needs to read the graph.