mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 11:36:59 +03:00
clean up recovery mode
This commit is contained in:
@@ -12,7 +12,7 @@ if (!String.prototype.format) {
|
||||
}
|
||||
|
||||
var releaseURL = 'https://api.github.com/repos/sle118/squeezelite-esp32/releases';
|
||||
var recovery = false;
|
||||
var recovery = true;
|
||||
var enableTimers = true;
|
||||
var commandHeader = 'squeezelite -b 500:2000 -d all=info ';
|
||||
|
||||
@@ -241,7 +241,6 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
$('[name=audio]').on("click", function(){
|
||||
console.log(this);
|
||||
if (this.id == 'bt') {
|
||||
$("#btsinkdiv").show(200);
|
||||
output = 'bt';
|
||||
@@ -257,7 +256,6 @@ $(document).ready(function(){
|
||||
$('#fwcheck').on("click", function(){
|
||||
$("#releaseTable").html("");
|
||||
$.getJSON(releaseURL, function(data) {
|
||||
console.log(data);
|
||||
data.forEach(function(release) {
|
||||
var url = '';
|
||||
release.assets.forEach(function(asset) {
|
||||
@@ -275,7 +273,6 @@ $(document).ready(function(){
|
||||
"<td><input id='generate-command' type='button' class='btn btn-success' value='Select' data-url='"+url+"' onclick='setURL(this);' /></td>"+
|
||||
"</tr>"
|
||||
);
|
||||
console.log(release.assets);
|
||||
});
|
||||
})
|
||||
.fail(function() {
|
||||
@@ -303,6 +300,8 @@ function setURL(button) {
|
||||
headers: { "X-Custom-fwurl": url },
|
||||
data: { 'timestamp': Date.now() }
|
||||
});
|
||||
$('[data-url^="http"]').addClass("btn-success").removeClass("btn-danger");
|
||||
$('[data-url="'+url+'"]').addClass("btn-danger").removeClass("btn-success");
|
||||
}
|
||||
|
||||
function performConnect(conntype){
|
||||
@@ -479,10 +478,11 @@ function getConfig() {
|
||||
if (data.hasOwnProperty('recovery')) {
|
||||
if (data["recovery"] === 1) {
|
||||
recovery = true;
|
||||
$("#tab-wifi").removeClass("active show");
|
||||
$("#tab-system").addClass("active show");
|
||||
$("#navbar").hide();
|
||||
$("#recoverydiv").hide();
|
||||
$("#otadiv").show();
|
||||
$("#command_line").hide();
|
||||
$("#wifi").hide();
|
||||
} else {
|
||||
recovery = false;
|
||||
$("#recoverydiv").show();
|
||||
|
||||
@@ -303,7 +303,7 @@ void http_server_netconn_serve(struct netconn *conn) {
|
||||
ESP_LOGE(TAG,"Unable to process autoexec%u. Name length overflow.",i);
|
||||
break;
|
||||
}
|
||||
if(snprintf(autoexec_key,sizeof(autoexec_key)-1,"autoexec%u",i++)<0)
|
||||
if(snprintf(autoexec_key,sizeof(autoexec_key)-1,"autoexec%u",i)<0)
|
||||
{
|
||||
ESP_LOGE(TAG,"Unable to process autoexec%u. Name length overflow.",i);
|
||||
break;
|
||||
@@ -320,6 +320,7 @@ void http_server_netconn_serve(struct netconn *conn) {
|
||||
{
|
||||
ESP_LOGE(TAG,"command line length is too long : %s = %s", autoexec_name, autoexec_value);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
else {
|
||||
ESP_LOGD(TAG,"No matching command found for name %s", autoexec_name);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<ul class="nav nav-tabs">
|
||||
<ul id="navbar" class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tab-wifi">WiFi</a>
|
||||
</li>
|
||||
@@ -223,20 +223,17 @@
|
||||
</table>
|
||||
<h1>Reboot to recovery system to perform firmware upgrade</h1>
|
||||
<div class="buttons">
|
||||
<input type="button" id="recovery" class="btn btn-primary" value="Recovery" />
|
||||
<input type="button" id="recovery" class="btn btn-warning" value="Recovery" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="otadiv">
|
||||
<header><h1>Firmware upgrade</h1></header>
|
||||
<form name="multipart" action="otaform" method="post" enctype="multipart/form-data" onsubmit="do_upload(this); return false;">
|
||||
<progress id="progr" value="0" max="100" >Upload Progress</progress>
|
||||
<input type="file" name="ota" id="ota" size="20" accept=".bin" onchange="file_change();">
|
||||
<span id="file_info"></span>
|
||||
<input type="submit" id="update" disabled="" value="Upload">
|
||||
</form>
|
||||
<h1>Reboot system with new firmware</h1>
|
||||
<div class="buttons">
|
||||
<input type="button" id="reboot" class="btn btn-primary" value="Reboot" />
|
||||
<input type="button" id="reboot" class="btn btn-warning" value="Reboot" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user