feat(index.html): implement auto-reload functionality every 5 seconds

This commit is contained in:
Sergey Krashevich
2024-03-22 16:44:48 +03:00
parent 0bda4d8308
commit 936e84f6e0
+3
View File
@@ -143,6 +143,9 @@
});
}
// Auto-reload every 5 seconds
setInterval(reload, 5000);
const url = new URL('api', location.href);
fetch(url, {cache: 'no-cache'}).then(r => r.json()).then(data => {
const info = document.querySelector('.info');