feat: allow frontend to override batchsize
This commit is contained in:
parent
371e5ef7cd
commit
7d0e1c4674
1 changed files with 4 additions and 3 deletions
|
@ -160,7 +160,8 @@ function card(key, history, last_rtt) {
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
let main = document.getElementById("uppe-rs-content");
|
const main = document.getElementById("uppe-rs-content");
|
||||||
|
const batchsize = (new URLSearchParams(window.location.search)).get('batch') || '%%BATCHSIZE%%';
|
||||||
|
|
||||||
async function updateStatus() {
|
async function updateStatus() {
|
||||||
let res = await fetch("/api/status")
|
let res = await fetch("/api/status")
|
||||||
|
@ -176,7 +177,7 @@ async function updateStatus() {
|
||||||
let out = "";
|
let out = "";
|
||||||
|
|
||||||
for (let key of keys) {
|
for (let key of keys) {
|
||||||
let res = await fetch(`/api/status/${key}?limit=%%BATCHSIZE%%`);
|
let res = await fetch(`/api/status/${key}?limit=${batchsize}`);
|
||||||
let history = await res.json();
|
let history = await res.json();
|
||||||
out += card(key, history, status[key]);
|
out += card(key, history, status[key]);
|
||||||
out += "\n";
|
out += "\n";
|
||||||
|
@ -185,7 +186,7 @@ async function updateStatus() {
|
||||||
main.innerHTML = out;
|
main.innerHTML = out;
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(updateStatus, 60 * 1000)
|
setInterval(updateStatus, 5 * 60 * 1000)
|
||||||
updateStatus()
|
updateStatus()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue