diff --git a/components/wifi-manager/code.js b/components/wifi-manager/code.js index 7dbaa78a..99010f33 100644 --- a/components/wifi-manager/code.js +++ b/components/wifi-manager/code.js @@ -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(){ ""+ "" ); - 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(); diff --git a/components/wifi-manager/http_server.c b/components/wifi-manager/http_server.c index 01777b84..9748073d 100644 --- a/components/wifi-manager/http_server.c +++ b/components/wifi-manager/http_server.c @@ -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); diff --git a/components/wifi-manager/index.html b/components/wifi-manager/index.html index 9a20e774..52a42039 100644 --- a/components/wifi-manager/index.html +++ b/components/wifi-manager/index.html @@ -23,7 +23,7 @@ -