Control xhttp concurrency

This commit is contained in:
logicog
2026-03-10 06:16:18 +01:00
parent c2f5a91763
commit fa37940075
10 changed files with 106 additions and 45 deletions
+10 -3
View File
@@ -151,7 +151,7 @@ function getCounters(port) {
}
};
xhttp.open("GET", "/counters.json?port=" + port, true);
xhttp.timeout = 1500; xhttp.send();
xhttp.timeout = 1500; sendXHTTP(xhttp);
}
@@ -184,8 +184,6 @@ function fillStats() {
}
}
const stat = setInterval(fillStats, 1000);
const popup = document.getElementById('popup');
const closePopup = document.getElementById('closePopup');
closePopup.addEventListener('click', () => {
@@ -196,3 +194,12 @@ window.addEventListener('click', (event) => {
popup.style.display = 'none';
}
});
window.addEventListener("load", function() {
update( () => {
update();
fillStats();
const stat = setInterval(fillStats, 1000);
const interval = setInterval(update, 2000);
});
});