Network manager WIP

This commit is contained in:
Sebastien L
2022-02-25 14:23:56 -05:00
parent bda4c18abe
commit 3eab93b595
19 changed files with 470 additions and 193 deletions

View File

@@ -344,10 +344,27 @@
</div>
</div>
</div>
<div class="card-body if_wifi" style="display: none" >
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Joined</th>
<th scope="col">Name</th>
<th scope="col">Signal</th>
<th scope="col">Security</th>
</tr>
</thead>
<tbody id="wifiTable"></tbody>
</table>
<button type="button" id="updateAP" class="btn btn-info btn-sm">Scan</button>
</div>
</div>
</div>
<div class="tab-pane fade " id="tab-commands">
<fieldset id="commands-list"></fieldset>
</div>

View File

@@ -1039,7 +1039,18 @@ $(document).ready(function () {
saveAutoexec1(true);
});
$('#btn_disconnect').on('click', function () {
handleDisconnect();
ConnectedTo={};
refreshAPHTML2();
$.ajax({
url: '/connect.json',
dataType: 'text',
method: 'DELETE',
cache: false,
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({
timestamp: Date.now(),
}),
});
});
$('#btnJoin').on('click', function () {
handleConnect();
@@ -1296,7 +1307,7 @@ function rssiToIcon(rssi) {
}
function refreshAP() {
if (ConnectedTo.urc === connectReturnCode.ETH) return;
if (ConnectedTo?.urc === connectReturnCode.ETH) return;
$.getJSON('/scan.json', async function () {
await sleep(2000);
$.getJSON('/ap.json', function (data) {
@@ -1346,7 +1357,7 @@ function refreshAPHTML2(data) {
$('#wifiStsIcon').html(rssiToIcon(ConnectedTo.rssi));
}
else if (ConnectedTo.urc !== connectReturnCode.ETH) {
else if (ConnectedTo?.urc !== connectReturnCode.ETH) {
$('span#foot-if').html('');
}