feat: add better auto refresh
This commit is contained in:
@@ -99,16 +99,17 @@
|
||||
document.getElementById('last-updated').textContent = new Date().toLocaleString();
|
||||
}
|
||||
|
||||
// Update timestamp every 30 seconds
|
||||
setInterval(updateTimestamp, 30000);
|
||||
updateTimestamp();
|
||||
|
||||
// Auto refresh page every 5 minutes for dashboard
|
||||
if (window.location.pathname === '/dashboard') {
|
||||
// Auto refresh functionality for all pages except logs
|
||||
if (window.location.pathname !== '/dashboard/logs') {
|
||||
// Update timestamp and refresh page every 10 seconds
|
||||
setInterval(() => {
|
||||
updateTimestamp();
|
||||
window.location.reload();
|
||||
}, 300000);
|
||||
}, 10000);
|
||||
}
|
||||
|
||||
// Initial timestamp update
|
||||
updateTimestamp();
|
||||
</script>
|
||||
|
||||
{% block scripts %}{% endblock %}
|
||||
|
@@ -151,7 +151,10 @@
|
||||
document.getElementById('current-time').textContent = new Date().toLocaleString();
|
||||
}
|
||||
|
||||
// Initial update
|
||||
updateCurrentTime();
|
||||
setInterval(updateCurrentTime, 1000);
|
||||
|
||||
// Note: Page auto-refreshes every 10 seconds via base.html
|
||||
// The current time will be updated on each refresh
|
||||
</script>
|
||||
{% endblock %}
|
@@ -209,9 +209,7 @@
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
// Auto-refresh every 60 seconds
|
||||
setInterval(() => {
|
||||
window.location.reload();
|
||||
}, 60000);
|
||||
// Note: Page auto-refreshes every 10 seconds via base.html
|
||||
// No additional refresh logic needed here
|
||||
</script>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user