1
0
Fork 0
forked from swee/MeowNex
MeowNex/script.js

20 lines
807 B
JavaScript
Raw Normal View History

2024-12-06 18:12:43 -08:00
// Fetching the run value for the first time
fetch ("run.txt")
2024-12-06 18:12:43 -08:00
.then(x => x.text())
.then(y => document.getElementById("run").innerHTML = y);
// Fetching the block value for the first time
fetch ("block.txt")
.then(x => x.text())
2024-12-06 18:12:43 -08:00
.then(y => document.getElementById("blocked").innerHTML = y);
async function refresh(){
2024-12-06 18:12:43 -08:00
// Refresh the HTML to show the spinners
2024-12-06 18:17:40 -08:00
document.getElementById("run").innerHTML = "..."
document.getElementById("blocked").innerHTML = "..."
2024-12-06 18:12:43 -08:00
// Then fetch the values the same way as on the first part of the script.
fetch ("run.txt")
.then(x => x.text())
.then(y => document.getElementById("run").innerHTML = y)
fetch ("block.txt")
.then(x => x.text())
.then(y => document.getElementById("blocked").innerHTML = y);
}