check / check (push) Successful in 3m21s
A database or log target sends no HTTP request, yet each of its attempts read "success Status: — (no response)", which for an http target means a failed connection. The shared attempt template now reads a successful database attempt as "archived" and a successful log attempt as "written to the log", and shows no status for either, in the event log and on the event's page. http and slack attempts are unchanged. One test per target type checks both pages. Model: opus-5-5
37 lines
2.0 KiB
HTML
37 lines
2.0 KiB
HTML
{{define "delivery_attempts"}}
|
|
<!-- A delivery's recorded attempts, as handlers.DeliveryView holds
|
|
them: in the event log and on an event's own page. -->
|
|
{{if .AttemptsOmitted}}
|
|
<p class="text-xs text-gray-500">{{.AttemptsOmitted}} attempt{{if ne .AttemptsOmitted 1}}s{{end}} omitted between the first and last shown.</p>
|
|
{{end}}
|
|
{{range .Results}}
|
|
{{/* Inside this loop, dot is one attempt and $ the whole delivery. */}}
|
|
<div class="rounded-md bg-white border border-gray-200 p-2">
|
|
<div class="flex flex-wrap items-center gap-3 text-xs">
|
|
<span class="text-gray-500">Attempt {{.AttemptNum}}</span>
|
|
<span class="{{if .Success}}text-green-600{{else}}text-red-600{{end}}">{{if not .Success}}failure{{else if eq $.Target.Type "database"}}archived{{else if eq $.Target.Type "log"}}written to the log{{else}}success{{end}}</span>
|
|
{{/* A database or log target sends no HTTP request, so its attempts have no status code. */}}
|
|
{{if not (eq $.Target.Type "database" "log")}}
|
|
<span class="text-gray-500">Status: {{if .HasStatusCode}}{{.StatusCode}}{{else}}— (no response){{end}}</span>
|
|
{{end}}
|
|
<span class="text-gray-500">Duration: {{.DurationMS}} ms</span>
|
|
</div>
|
|
{{if .Error}}
|
|
<p class="mt-2 text-xs text-red-700 break-all">Error: {{.Error}}</p>
|
|
{{end}}
|
|
{{if .ResponseBody}}
|
|
<pre class="mt-2 text-xs text-gray-700 overflow-x-auto whitespace-pre-wrap break-all">{{.ResponseBody}}</pre>
|
|
{{end}}
|
|
{{if .ResponseTruncated}}
|
|
{{if .ResponseSizeKnown}}
|
|
<p class="mt-1 text-xs text-gray-500">Response truncated for display: showing {{.ResponseShownBytes}} of {{.ResponseBytes}} bytes.</p>
|
|
{{else}}
|
|
<p class="mt-1 text-xs text-gray-500">Showing {{.ResponseShownBytes}} of the {{.ResponseBytes}} recorded bytes. The response reached the recording limit, so the remote may have sent more that was never stored.</p>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<p class="text-xs text-gray-500">No attempts recorded yet.</p>
|
|
{{end}}
|
|
{{end}}
|