package web
// The CI pages: the runs of a repository, a run with its jobs, a job with its
// steps and its log (actions.go). A state is always a word as well as a
// symbol and a colour.
// CheckIcon is the symbol of a state: a mark in the colour of its kind, with
// the state as its text for a screen reader.
templ CheckIcon(kind, state string) {
}
templ Actions(l Layout, p ActionsPage) {
@Shell(l, nil) {
if len(p.Disabled) > 0 {
disabled workflows (they start no run):
for _, f := range p.Disabled {
{ f }{ " " }
}
}
if len(p.Runs) == 0 {
no runs yet: a push that matches a workflow of .github/workflows starts one.
}
// RecentActionsBlock is the "Recent actions" section of the summary rail; its
// id is the target of the live updates. Without a run it is hidden.
templ RecentActionsBlock(a RecentActions) {
}
templ RunDetail(l Layout, p RunPage) {
@Shell(l, runRail(p)) {
@LiveSlot("run-notice")
if p.WorkflowDisabled {
disabled this workflow is disabled: no event starts a run of it (ermite workflow enable).
}
@RunBody(p)
if p.Artifacts != nil {
@RunArtifacts(*p.Artifacts)
}
@RunSummaries(p.Summaries, p.SummariesMore)
}
}
// runBodyFragment is the body of the run page as a live fragment.
templ runBodyFragment(p RunPage) {
@RunBody(p)
}
// RunBody is the jobs of a run, replaced by the live updates.
templ RunBody(p RunPage) {
}
// AnnotationList is a list of annotations: the level as a mark with its word,
// the job and the step, the title and the message, and file:line. Everything
// comes from the workflow and is text. Without grouped, each item names its job (the
// run page); grouped lists the annotations by step instead (the job page).
templ AnnotationList(anns []AnnotationView, more bool, grouped bool) {
}
}
// JobAnnotations is the annotations of the job page, replaced by the live
// updates; the element exists even when there is none, so that the first one
// has something to replace.
templ JobAnnotations(anns []AnnotationView, more bool) {
if len(anns) > 0 {
Annotations { itoa(len(anns)) }
@AnnotationList(anns, more, true)
}
}
// RunArtifacts is the artifacts of a run, with the space the artifacts of
// the repository use. Names come from the workflow and are text.
templ RunArtifacts(a ArtifactsView) {
}
// RunSummaries is the job summaries of a run, one block per step that wrote
// one. The Markdown is rendered by the README renderer: raw HTML dropped, URLs
// filtered, images shown as their alt text.
templ RunSummaries(sums []JobSummaries, more bool) {
for _, j := range sums {
}
if p.CancelAction != "" || p.RerunAction != "" {
Actions
if p.CancelAction != "" {
}
if p.RerunAction != "" {
}
if p.CanRerunFailed {
}
}
}
// JobHead is the title of the job page with its state and its error, replaced
// by the live updates. total is the number of lines the log holds.
templ JobHead(j JobRow, total int64) {
}
}
// LogLine is a line of the log. Group and error markers of the runner show as
// headings and errors, never as raw text.
templ LogLine(ln LogLineView) {
}
// CommitChecks is the combined state of the checks of a commit, as a mark
// with a count, linking to the page that explains it.
templ CommitChecks(c ChecksSummary) {
if c.Total > 0 {
@CheckIcon(c.Kind, c.State)
{ c.Label }
}
}
// MRChecksSum is the state of the checks of a merge request in the bar above
// the diff, a link to the checks of the rail. The event stream replaces it
// with the checks section (same event, fragments.go).
templ MRChecksSum(c ChecksSummary) {
if c.Total > 0 {
@CheckIcon(c.Kind, c.State)
{ c.Label }
} else {
no checks
}
}
// MRChecks is the checks section of the rail of a merge request.
templ MRChecks(c ChecksSection) {
Checks { itoa(len(c.Rows)) }
if len(c.Rows) == 0 {
no checks
} else {
for _, r := range c.Rows {
@CheckIcon(r.Kind, r.State)
if r.Href != "" {
{ r.Name }
} else {
{ r.Name }
}
{ r.State }
if r.Waiting {
waiting for a runner
}