mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 20:47:08 +03:00
Network manager WIP
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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('');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user