casi otro

This commit is contained in:
richonguzman 2024-09-24 16:25:36 -03:00
parent a44b48525c
commit d32939a3b9
8 changed files with 28 additions and 28 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -285,10 +285,10 @@
d="M8.5 5.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0" d="M8.5 5.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0"
/> />
</svg> </svg>
WiFi Access Trackers
</h5> </h5>
<small <small
>Add all Wi-Fi Networks intended to be used.</small >Add all Trackers configuration intended to be used.</small
> >
</div> </div>
<div class="col-lg-9 col-sm-12"> <div class="col-lg-9 col-sm-12">
@ -310,7 +310,7 @@
aria-expanded="false" aria-expanded="false"
aria-controls="add-ap" aria-controls="add-ap"
> >
Add network Add Tracker
</button> </button>
</div> </div>
</div> </div>

Binary file not shown.

View File

@ -75,24 +75,24 @@ function loadSettings(settings) {
document.getElementById("personalNote").value = settings.personalNote; document.getElementById("personalNote").value = settings.personalNote;
document.getElementById("action.symbol").value = settings.beacon.overlay + settings.beacon.symbol; document.getElementById("action.symbol").value = settings.beacon.overlay + settings.beacon.symbol;
document.querySelector(".list-networks").innerHTML = ""; document.querySelector(".list-tracker").innerHTML = "";
// Networks // Networks
const wifiNetworks = settings.wifi.AP || []; const trackers = settings.beacons || [];
const networksContainer = document.querySelector(".list-networks"); const trackersContainer = document.querySelector(".list-tracker");
let networkCount = 0; let trackerCount = 0;
wifiNetworks.forEach((network) => { trackers.forEach((tracker) => {
const networkElement = document.createElement("div"); const trackerElement = document.createElement("div");
networkElement.classList.add("row", "network", "border-bottom", "py-2"); trackerElement.classList.add("row", "network", "border-bottom", "py-2");
// Increment the name, id, and for attributes // Increment the name, id, and for attributes
const attributeName = `wifi.AP.${networkCount}`; const attributeName = `beacons.${trackerCount}`;
networkElement.innerHTML = ` trackerElement.innerHTML = `
<div class="form-floating col-5 px-1 mb-2"> <div class="form-floating col-5 px-1 mb-2">
<input type="text" class="form-control form-control-sm" name="${attributeName}.ssid" id="${attributeName}.ssid" value="${network.ssid}"> <input type="text" class="form-control form-control-sm" name="${attributeName}.callsign" id="${attributeName}.callsign" value="${tracker.callsign}">
<label for="${attributeName}.ssid">SSID</label> <label for="${attributeName}.callsign">callsign</label>
</div> </div>
<div class="form-floating col-5 px-1 mb-2"> <div class="form-floating col-5 px-1 mb-2">
<input type="password" class="form-control form-control-sm" name="${attributeName}.password" id="${attributeName}.password" value="${network.password}"> <input type="password" class="form-control form-control-sm" name="${attributeName}.password" id="${attributeName}.password" value="${network.password}">
@ -106,8 +106,8 @@ function loadSettings(settings) {
</div> </div>
</div> </div>
`; `;
networksContainer.appendChild(networkElement); trackersContainer.appendChild(trackerElement);
networkCount++; trackerCount++;
}); });
@ -317,20 +317,20 @@ WebadminCheckbox.addEventListener("change", function () {
}); });
document.querySelector(".new button").addEventListener("click", function () { document.querySelector(".new button").addEventListener("click", function () {
const networksContainer = document.querySelector(".list-networks"); const trackersContainer = document.querySelector(".list-tracker");
let networkCount = document.querySelectorAll(".network").length; let trackerCount = document.querySelectorAll(".network").length;
const networkElement = document.createElement("div"); const trackerElement = document.createElement("div");
networkElement.classList.add("row", "network", "border-bottom", "py-2"); trackerElement.classList.add("row", "network", "border-bottom", "py-2");
// Increment the name, id, and for attributes // Increment the name, id, and for attributes
const attributeName = `wifi.AP.${networkCount}`; const attributeName = `beacons.${trackerCount}`;
networkElement.innerHTML = ` trackerElement.innerHTML = `
<div class="form-floating col-6 col-md-5 px-1 mb-2"> <div class="form-floating col-6 col-md-5 px-1 mb-2">
<input type="text" class="form-control form-control-sm" name="${attributeName}.ssid" id="${attributeName}.ssid" placeholder="" > <input type="text" class="form-control form-control-sm" name="${attributeName}.callsign" id="${attributeName}.callsign" placeholder="" >
<label for="${attributeName}.ssid">SSID</label> <label for="${attributeName}.callsign">callsign</label>
</div> </div>
<div class="form-floating col-6 col-md-5 px-1 mb-2"> <div class="form-floating col-6 col-md-5 px-1 mb-2">
<input type="password" class="form-control form-control-sm" name="${attributeName}.password" id="${attributeName}.password" placeholder=""> <input type="password" class="form-control form-control-sm" name="${attributeName}.password" id="${attributeName}.password" placeholder="">
@ -344,12 +344,12 @@ document.querySelector(".new button").addEventListener("click", function () {
</div> </div>
</div> </div>
`; `;
networksContainer.appendChild(networkElement); trackersContainer.appendChild(trackerElement);
networkCount++; trackerCount++;
// Add the new network element to the end of the document // Add the new network element to the end of the document
document.querySelector(".new").before(networkElement); document.querySelector(".new").before(trackerElement);
}); });
document document
@ -460,7 +460,7 @@ function checkConnection() {
form.addEventListener("submit", async (event) => { form.addEventListener("submit", async (event) => {
event.preventDefault(); event.preventDefault();
document.getElementById("wifi.APs").value = document.getElementById("beacons").value =
document.querySelectorAll(".network").length; document.querySelectorAll(".network").length;
fetch(form.action, { fetch(form.action, {

Binary file not shown.

Binary file not shown.