recovery mode detection

This commit is contained in:
Christian Herzog
2019-09-18 21:03:59 +02:00
parent fd235df8fb
commit 560c9c2d81
2 changed files with 19 additions and 13 deletions

View File

@@ -11,7 +11,7 @@ if (!String.prototype.format) {
};
}
var recovery = 0;
var recovery = false;
var enableTimers = true;
var commandHeader = 'squeezelite -b 500:2000 -d all=info ';
@@ -187,16 +187,6 @@ $(document).ready(function(){
selectOutput(this);
});
if (recovery) {
$("#recoverydiv").hide();
$("#otadiv").show();
$("#command_line").hide();
$("#wifi").hide();
} else {
$("#recoverydiv").show();
$("#otadiv").hide();
}
//first time the page loads: attempt to get the connection status and start the wifi scan
refreshAP();
getConfig();
@@ -379,6 +369,19 @@ function getConfig() {
$("#autoexec-cb")[0].checked=false;
$("#autoexec-command").hide(200);
}
}
if (data.hasOwnProperty('recovery')) {
if (data["recovery"] === 1) {
recovery = true;
$("#recoverydiv").hide();
$("#otadiv").show();
$("#command_line").hide();
$("#wifi").hide();
} else {
recovery = false;
$("#recoverydiv").show();
$("#otadiv").hide();
}
}
if (data.hasOwnProperty('list')) {
data.list.forEach(function(line) {