Show the last event as a relative time with a UTC tooltip (closes #567)
check / check (push) Waiting to run

The "Last event" figure in the webhook page's Statistics block now shows how long ago the newest event arrived, as its two largest units of d, h, m and s with no spaces ("59s", "1m1s", "3d4h"; a zero second unit is left off). It is worked out when the page is served, and a time ahead of the server clock shows "0s". Its tooltip is the full time in UTC. With no event it still shows "none", without a tooltip. A unit test pins each unit boundary, and the headless-browser test checks the figure and its tooltip.

Model: opus-5-5
This commit was merged in pull request #568.
This commit is contained in:
2026-10-26 19:18:38 +01:00
parent eda8e80844
commit 19978c6324
5 changed files with 166 additions and 25 deletions
+5 -1
View File
@@ -22,7 +22,11 @@
</div>
<div>
<span class="text-gray-500">Last event</span>
<span class="font-medium text-gray-900">{{with .LastEventAt}}{{.UTC.Format "2006-01-02 15:04:05 UTC"}}{{else}}none{{end}}</span>
{{if .LastEvent}}
<span class="font-medium text-gray-900" title="{{.LastEventUTC}}">{{.LastEvent}}</span>
{{else}}
<span class="font-medium text-gray-900">none</span>
{{end}}
</div>
<div>
<span class="text-gray-500">Retention</span>