From 22dca4fe664080102ed9452aa86c4b7dc0ea5725 Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 19 Jul 2023 17:21:07 +0800 Subject: [PATCH] selected network --- static/app.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/static/app.js b/static/app.js index a138920..357c985 100755 --- a/static/app.js +++ b/static/app.js @@ -3303,3 +3303,17 @@ selectMenu.addEventListener("change", function() { pElement.textContent = selectedValue + " Settings - Changes detected."; pElement2.innerHTML = selectedValue + " Settings -" + "
" + " Saved!"; }); + + +// load selected network item into ssid input +function sendNetworkToSSID(element) { + var networksList = document.getElementById('networks-list'); + var lis = networksList.querySelectorAll("li"); + var ssid_input = document.getElementById('wifi-ssid-input'); + var value = element.innerText; + lis.forEach(function(li) { + li.classList.remove("active"); + }); + ssid_input.value = value; + element.classList.add("active"); +}