package main import ( "fmt" "time" ) templ probeListPage(probes []Probe) {
  1. Home
  2. Probes

Probes

for _, probe := range probes { @probeRow(probe) }
Name URL Last Result
@probeCreateForm()
} templ probeCreateForm() {

Create new probe

This will count towards your probe limit.

} templ probeRow(probe Probe) { { probe.Name } { probe.URL } if probe.LastResult.CreatedAt.IsZero() { Not run yet } else { { probe.LastResult.LastModified } } } templ probeEdit(probe Probe) { } templ probePage(probe Probe, history []ProbeResult) {
  1. Home
  2. { probe.Name }

{ probe.Name }

if probe.LastResultID != 0 { } else { }
Name { probe.Name }
Created At { probe.CreatedAt.Format(time.RFC3339) }
URL { probe.URL }
Last result at { probe.LastResult.CreatedAt.Format(time.RFC3339) }
Last result contents { probe.LastResult.LastModified }
Last result at Probe has not been run yet

Run history

The most recent 15 runs of this probe.

if len(history) != 0 {
for _, check := range history { }
Time Result Status code Last Modified
{ check.CreatedAt.Format(time.RFC3339) } if check.Success { ✔️ Success } else { ❌ Failure } if check.StatusCode != 0 { { fmt.Sprint(check.StatusCode) } } { check.LastModified }
} else {

This probe has not been run yet, wait 15 minutes or so for it to be run.

}
} templ probeRunPage(probe Probe, result ProbeResult) {
  1. Home
  2. Run { fmt.Sprint(result.ID) }

Probe run { fmt.Sprint(result.ID) }

URL { probe.URL }
Success? { fmt.Sprint(result.Success) }
Last Modified { result.LastModified }
Status code { fmt.Sprint(result.StatusCode) }
Region { result.Region }
Remark if result.Remark != "" { { result.Remark } } else { n/a }
}