lolin32 board added. fw and UI de-cluttered.

This commit is contained in:
2024-02-11 09:02:39 +00:00
parent ffeb1d3a2c
commit 0546fec678
10 changed files with 414 additions and 1727 deletions

9
data/js/aja.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,45 +1,64 @@
var _elapsedTime = 0;
function getParams() {
aja()
.url('/params')
.on('success', function (data) {
document.getElementById('Iim').value = data.Iim || -1;
document.getElementById('Imp').value = data.Imp || -1;
document.getElementById('Tu').value = data.Tu || -1;
document.getElementById('Tl').value = data.Tl || -1;
M.updateTextFields();
})
.go();
const url = '/paraams';
fetch(url)
.then((respone)=>{
return respone.json();
})
.then((data)=>{
document.getElementById('Iim').value = data.Iim || -1;
document.getElementById('Imp').value = data.Imp || -1;
document.getElementById('Tu').value = data.Tu || -1;
document.getElementById('Tl').value = data.Tl || -1;
M.updateTextFields();
})
}
function setParams() {
aja()
.method('post')
.url('/params')
.data({ Iim: document.getElementById('Iim').value, Imp: document.getElementById('Imp').value, Tu: document.getElementById('Tu').value, Tl: document.getElementById('Tl').value})
.go();
const data = new URLSearchParams();
data.append('Iim',document.getElementById('Iim').value);
data.append('Imp',document.getElementById('Imp').value);
data.append('Tu',document.getElementById('Tu').value);
data.append('Tl',document.getElementById('Tl').value);
fetch('/params', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: data
})
}
function joinNetwork() {
aja()
.method('post')
.url('/setWiFi')
.data({ ssid: document.getElementById('ssid').value, pass: document.getElementById('pass').value, ip: document.getElementById('ip').value, gateway: document.getElementById('gateway').value})
.go();
const data = new URLSearchParams();
data.append('ssid', document.getElementById("ssid").value);
data.append('pass', document.getElementById("pass").value);
data.append('gateway', document.getElementById("gateway").value);
data.append('ip', document.getElementById("ip").value);
fetch('/setWiFi', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: data
})
}
function scanNetworks() {
aja()
.url('/scanNetworks')
.on('success', function (data) {
var listHTML = "";
data.forEach((network)=>{
listHTML += '<tr><td>'+network.ssid+'</td><td>'+network.channel+'</td><td>'+network.rssi+'</td></tr>';
});
document.getElementById("networks").innerHTML = listHTML;
})
.go();
async function scanNetworks() {
let raw = await fetch("/scanNetworks");
let data = await raw.json();
var listHTML = "";
data.forEach((network)=>{
listHTML += '<tr><td>'+network.ssid+'</td><td>'+network.channel+'</td><td>'+network.rssi+'</td></tr>';
});
document.getElementById("networks").innerHTML = listHTML;
}
setInterval(function () {