This commit is contained in:
Stefan Bethke 2025-05-21 17:58:34 +02:00
commit d60f8f8be0
6 changed files with 115 additions and 11 deletions

View file

@ -1,3 +1,26 @@
(function(){
(function () {
setInterval(function () {
fetch("/api").then(function (response) {
return response.json();
}).then(function (json) {
let e = document.getElementById("lock-status");
e.innerText = JSON.stringify(json.locks);
})
}, 10000)
for (let e of document.querySelectorAll("button.lock-unlock")) {
e.onclick = function () {
fetch("/api", {
method: "POST",
body: JSON.stringify({
name: e.name,
contentType: "application/json",
})
}).then(function (response) {
//
})
}
}
console.log("Setup complete")
})();