From a110be31d258beda40fbf554c6059baa9a954b7b Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 2 Mar 2022 23:09:52 +0800 Subject: [PATCH] enable wi-fi saving --- static/app.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/static/app.js b/static/app.js index 6feb1c0..7eefea1 100755 --- a/static/app.js +++ b/static/app.js @@ -1385,23 +1385,23 @@ let countryCodeInput = document.getElementById("country-code-input"); let joinNetworkBtn = document.querySelector("#join-network-btn"); let connectedText = document.querySelector("#connected-text"); -// joinNetworkBtn.addEventListener("click", () => { -// localStorage.setItem("wifiSsid", wifiSsidInput.value); -// localStorage.setItem("wifiPass", wifiPassInput.value); -// localStorage.setItem("countryCode", countryCodeInput.value); +joinNetworkBtn.addEventListener("click", () => { + localStorage.setItem("wifiSsid", wifiSsidInput.value); + localStorage.setItem("wifiPass", wifiPassInput.value); + localStorage.setItem("countryCode", countryCodeInput.value); // connectedText.style.display = "block"; // setTimeout(() => { // connectedText.style.display = "none"; // }, 2000); -// data = {country:countryCodeInput.value, ssid:wifiSsidInput.value, pwd:wifiPassInput.value} + data = {country:countryCodeInput.value, ssid:wifiSsidInput.value, pwd:wifiPassInput.value} -// fetch("/wifi", { -// method: "POST", -// body: JSON.stringify(data), -// }); -// }); + fetch("/wifi", { + method: "POST", + body: JSON.stringify(data), + }); + }); // change display format let displayFormatDropDown = document.querySelector("#inputDisplayFormat");