feat(web): click Executions' Started time to toggle relative/absolute
Both renderings are pre-rendered server-side into a <button>'s data-relative/data-absolute attributes; app.js swaps textContent (and the hover title, to the opposite value) on click, delegated on document.body so it survives the card's own 5s htmx poll without needing to re-wire after every swap. Click again to swap back.
This commit is contained in:
@@ -359,6 +359,14 @@ table is wide as a result — 13 columns — and scrolls horizontally inside the
|
||||
card's own `.table-wrap` rather than the page, same as the other wide tables
|
||||
(Templates, Services).
|
||||
|
||||
**Started is click-to-toggle.** It renders relative ("2h ago") by default;
|
||||
clicking swaps to the absolute local timestamp, and clicking again swaps
|
||||
back. Both strings are pre-rendered server-side into the button's
|
||||
`data-relative`/`data-absolute` attributes, so the swap (`app.js`, delegated
|
||||
on `document.body`) is instant and needs no request — and keeps working
|
||||
after the card's own 5s poll replaces the row, since the listener isn't on
|
||||
the button itself.
|
||||
|
||||
Runs come from Gitea's Actions API: `/api/v1/admin/actions/runs` (every repo
|
||||
on the instance, admin token) with `/api/v1/user/actions/runs` as the
|
||||
non-admin fallback. Results are cached for 10s, so the card's 5s refresh costs
|
||||
|
||||
Reference in New Issue
Block a user