abtmtr-v4/views/projects/item/clock/update.js

26 lines
694 B
JavaScript
Raw Normal View History

2023-12-07 16:34:09 +00:00
function reqData(start) {
console.log("Pinged API server. Starting: " + start);
var donedata = (e) => {
var resp = e;
var prevSha = "A";
if (!start) prevSha = window.sessionStorage.getItem("commitsha");
if (resp != prevSha) {
window.sessionStorage.setItem("commitsha", resp);
if (start) return;
2024-01-19 16:28:16 +00:00
document.querySelector(
"#updatesha"
).innerHTML = `from job v. ${prevSha} to job v. ${resp}`;
2023-12-07 16:34:09 +00:00
document.querySelector("#updatedialog").classList.add("open");
}
};
2024-01-19 16:28:16 +00:00
fetch_ask("https://ClockCheckGithub.meowcatheorange.repl.co")
.then((x) => x.text())
.then((y) => donedata(y));
2023-12-07 16:34:09 +00:00
}
setInterval(reqData, 60000);
reqData(true);