mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 21:17:18 +03:00
add update AP button
This commit is contained in:
@@ -54,7 +54,7 @@ function startCheckStatusInterval(){
|
|||||||
|
|
||||||
function startRefreshAPInterval(){
|
function startRefreshAPInterval(){
|
||||||
RefreshAPIIntervalActive = true;
|
RefreshAPIIntervalActive = true;
|
||||||
refreshAPInterval = setTimeout(refreshAP, 2800);
|
refreshAPInterval = setTimeout(refreshAP(false), 2800);
|
||||||
}
|
}
|
||||||
|
|
||||||
function RepeatCheckStatusInterval(){
|
function RepeatCheckStatusInterval(){
|
||||||
@@ -430,8 +430,13 @@ $(document).ready(function(){
|
|||||||
enableStatusTimer = true;
|
enableStatusTimer = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#updateAP').on("click", function(){
|
||||||
|
refreshAP(true);
|
||||||
|
console.log("refresh AP");
|
||||||
|
});
|
||||||
|
|
||||||
//first time the page loads: attempt to get the connection status and start the wifi scan
|
//first time the page loads: attempt to get the connection status and start the wifi scan
|
||||||
refreshAP();
|
refreshAP(false);
|
||||||
getConfig();
|
getConfig();
|
||||||
|
|
||||||
//start timers
|
//start timers
|
||||||
@@ -518,8 +523,8 @@ function rssiToIcon(rssi){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshAP(){
|
function refreshAP(force){
|
||||||
if (!enableAPTimer) return;
|
if (!enableAPTimer && !force) return;
|
||||||
$.getJSON( "/ap.json", function( data ) {
|
$.getJSON( "/ap.json", function( data ) {
|
||||||
if(data.length > 0){
|
if(data.length > 0){
|
||||||
//sort by signal strength
|
//sort by signal strength
|
||||||
|
|||||||
@@ -60,7 +60,9 @@
|
|||||||
<section id="manual_add">
|
<section id="manual_add">
|
||||||
<div class="ape">ADD (HIDDEN) SSID</div>
|
<div class="ape">ADD (HIDDEN) SSID</div>
|
||||||
</section>
|
</section>
|
||||||
<h2>or choose a network...</h2>
|
<h2>or choose a network...
|
||||||
|
<button type="button" id="updateAP" class="btn btn-info btn-sm">Update</button>
|
||||||
|
</h2>
|
||||||
<section id="wifi-list">
|
<section id="wifi-list">
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -362,3 +362,8 @@ tr.hide {
|
|||||||
float: right;
|
float: right;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button#updateAP {
|
||||||
|
float: right;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user