23 lines
677 B
JavaScript
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);
|
|
},
|
|
}));
|
|
});
|