All checks were successful
Check / check (pull_request) Successful in 11m29s
Split static/js/app.js (581 lines) into 5 focused modules: - utils.js: global utilities store + legacy compat - components.js: reusable Alpine.js components (copy, confirm, dismiss, time) - app-detail.js: app detail page logic (status polling, logs) - deployment.js: deployment card + deployments history page - dashboard.js: dashboard relative time updates Closes #128
22 lines
561 B
JavaScript
22 lines
561 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);
|
|
},
|
|
}));
|
|
});
|