WIP
This commit is contained in:
parent
9565ba3596
commit
d60f8f8be0
6 changed files with 115 additions and 11 deletions
|
@ -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")
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue