Files
upaas/static/js/dashboard.js
clawbot 7920e723a6
All checks were successful
Check / check (pull_request) Successful in 5s
style: run make fmt on JS static files
2026-03-09 17:01:10 -07:00

23 lines
677 B
JavaScript

/**
* upaas - Dashboard Page Component
*
* Periodically updates relative timestamps on the main dashboard.
*/
document.addEventListener("alpine:init", () => {
Alpine.data("dashboard", () => ({
init() {
// Update relative times every minute
setInterval(() => {
this.$el.querySelectorAll("[data-time]").forEach((el) => {
const time = el.getAttribute("data-time");
if (time) {
el.textContent =
Alpine.store("utils").formatRelativeTime(time);
}
});
}, 60000);
},
}));
});