change hostname button

This commit is contained in:
Neythen
2021-11-26 15:33:10 +00:00
parent f51c3b38c3
commit b32fb2307d
4 changed files with 20 additions and 0 deletions

View File

@@ -1309,6 +1309,13 @@ let hostNameText = document.getElementById("host-name");
hostNameBtn.addEventListener("click", () => {
hostNameText.innerText = hostNameInput.value;
localStorage.setItem("hostName", hostNameText.innerText);
data = {hostname:hostNameText.innerText}
fetch("/hostname", {
method: "POST",
body: JSON.stringify(data),
});
});
// change brightness