MeowNex/script.js

35 lines
1.4 KiB
JavaScript
Raw Normal View History

2024-12-18 16:32:37 -08:00
/*jshint esversion: 8 */
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);
2024-12-06 18:28:49 -08:00
fetch ("link.txt")
.then(x => x.text())
.then(y => document.getElementById("links").innerHTML = y);
2024-12-28 20:59:26 -08:00
fetch ("lastquery.txt")
.then(x => x.text())
.then(y => document.getElementById("aichat").innerHTML = y);
async function refresh(){
2024-12-06 18:12:43 -08:00
// Refresh the HTML to show the spinners
2024-12-18 16:33:47 -08:00
document.getElementById("run").innerHTML = "...";
document.getElementById("blocked").innerHTML = "...";
document.getElementById("links").innerHTML = "...";
2024-12-28 20:59:26 -08:00
document.getElementById("aichat").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())
2024-12-18 16:33:47 -08:00
.then(y => document.getElementById("run").innerHTML = y);
2024-12-06 18:12:43 -08:00
fetch ("block.txt")
.then(x => x.text())
.then(y => document.getElementById("blocked").innerHTML = y);
2024-12-06 18:28:49 -08:00
fetch ("link.txt")
.then(x => x.text())
.then(y => document.getElementById("links").innerHTML = y);
2024-12-28 20:59:26 -08:00
fetch ("lastquery.txt")
.then(x => x.text())
.then(y => document.getElementById("aichat").innerHTML = y);
}