mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +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 releaseURL = 'https://api.github.com/repos/sle118/squeezelite-esp32/releases';
|
||||||
var recovery = false;
|
var recovery = true;
|
||||||
var enableTimers = true;
|
var enableTimers = true;
|
||||||
var commandHeader = 'squeezelite -b 500:2000 -d all=info ';
|
var commandHeader = 'squeezelite -b 500:2000 -d all=info ';
|
||||||
|
|
||||||
@@ -241,7 +241,6 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('[name=audio]').on("click", function(){
|
$('[name=audio]').on("click", function(){
|
||||||
console.log(this);
|
|
||||||
if (this.id == 'bt') {
|
if (this.id == 'bt') {
|
||||||
$("#btsinkdiv").show(200);
|
$("#btsinkdiv").show(200);
|
||||||
output = 'bt';
|
output = 'bt';
|
||||||
@@ -257,7 +256,6 @@ $(document).ready(function(){
|
|||||||
$('#fwcheck').on("click", function(){
|
$('#fwcheck').on("click", function(){
|
||||||
$("#releaseTable").html("");
|
$("#releaseTable").html("");
|
||||||
$.getJSON(releaseURL, function(data) {
|
$.getJSON(releaseURL, function(data) {
|
||||||
console.log(data);
|
|
||||||
data.forEach(function(release) {
|
data.forEach(function(release) {
|
||||||
var url = '';
|
var url = '';
|
||||||
release.assets.forEach(function(asset) {
|
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>"+
|
"<td><input id='generate-command' type='button' class='btn btn-success' value='Select' data-url='"+url+"' onclick='setURL(this);' /></td>"+
|
||||||
"</tr>"
|
"</tr>"
|
||||||
);
|
);
|
||||||
console.log(release.assets);
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.fail(function() {
|
.fail(function() {
|
||||||
@@ -303,6 +300,8 @@ function setURL(button) {
|
|||||||
headers: { "X-Custom-fwurl": url },
|
headers: { "X-Custom-fwurl": url },
|
||||||
data: { 'timestamp': Date.now() }
|
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){
|
function performConnect(conntype){
|
||||||
@@ -479,10 +478,11 @@ function getConfig() {
|
|||||||
if (data.hasOwnProperty('recovery')) {
|
if (data.hasOwnProperty('recovery')) {
|
||||||
if (data["recovery"] === 1) {
|
if (data["recovery"] === 1) {
|
||||||
recovery = true;
|
recovery = true;
|
||||||
|
$("#tab-wifi").removeClass("active show");
|
||||||
|
$("#tab-system").addClass("active show");
|
||||||
|
$("#navbar").hide();
|
||||||
$("#recoverydiv").hide();
|
$("#recoverydiv").hide();
|
||||||
$("#otadiv").show();
|
$("#otadiv").show();
|
||||||
$("#command_line").hide();
|
|
||||||
$("#wifi").hide();
|
|
||||||
} else {
|
} else {
|
||||||
recovery = false;
|
recovery = false;
|
||||||
$("#recoverydiv").show();
|
$("#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);
|
ESP_LOGE(TAG,"Unable to process autoexec%u. Name length overflow.",i);
|
||||||
break;
|
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);
|
ESP_LOGE(TAG,"Unable to process autoexec%u. Name length overflow.",i);
|
||||||
break;
|
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);
|
ESP_LOGE(TAG,"command line length is too long : %s = %s", autoexec_name, autoexec_value);
|
||||||
}
|
}
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ESP_LOGD(TAG,"No matching command found for name %s", autoexec_name);
|
ESP_LOGD(TAG,"No matching command found for name %s", autoexec_name);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<ul class="nav nav-tabs">
|
<ul id="navbar" class="nav nav-tabs">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" data-toggle="tab" href="#tab-wifi">WiFi</a>
|
<a class="nav-link active" data-toggle="tab" href="#tab-wifi">WiFi</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -223,20 +223,17 @@
|
|||||||
</table>
|
</table>
|
||||||
<h1>Reboot to recovery system to perform firmware upgrade</h1>
|
<h1>Reboot to recovery system to perform firmware upgrade</h1>
|
||||||
<div class="buttons">
|
<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>
|
</div>
|
||||||
<div id="otadiv">
|
<div id="otadiv">
|
||||||
<header><h1>Firmware upgrade</h1></header>
|
<header><h1>Firmware upgrade</h1></header>
|
||||||
<form name="multipart" action="otaform" method="post" enctype="multipart/form-data" onsubmit="do_upload(this); return false;">
|
<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>
|
<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>
|
</form>
|
||||||
<h1>Reboot system with new firmware</h1>
|
<h1>Reboot system with new firmware</h1>
|
||||||
<div class="buttons">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user