Browse Source

Small changes in reset delays after web upgrade

fastled
Xose Pérez 7 years ago
parent
commit
517d1fd3f6
4 changed files with 14 additions and 14 deletions
  1. BIN
      code/espurna/data/index.html.gz
  2. +10
    -10
      code/espurna/static/index.html.gz.h
  3. +2
    -2
      code/espurna/web.ino
  4. +2
    -2
      code/html/custom.js

BIN
code/espurna/data/index.html.gz View File


+ 10
- 10
code/espurna/static/index.html.gz.h
File diff suppressed because it is too large
View File


+ 2
- 2
code/espurna/web.ino View File

@ -823,10 +823,10 @@ void _onHome(AsyncWebServerRequest *request) {
void _onUpgrade(AsyncWebServerRequest *request) {
AsyncWebServerResponse *response = request->beginResponse(200, "text/plain", Update.hasError() ? "FAIL" : "OK");
response->addHeader("Connection", "close");
request->send(response);
deferred.once_ms(100, []() {
ESP.restart();
});
request->send(response);
}
void _onUpgradeData(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {
@ -878,7 +878,7 @@ void webSetup() {
_server->on("/config", HTTP_GET, _onGetConfig);
_server->on("/auth", HTTP_GET, _onAuth);
_server->on("/apis", HTTP_GET, _onAPIs);
// _server->on("/rpc", HTTP_GET, _onRPC);
_server->on("/rpc", HTTP_GET, _onRPC);
_server->on("/upgrade", HTTP_POST, _onUpgrade, _onUpgradeData);
// Serve static files


+ 2
- 2
code/html/custom.js View File

@ -81,10 +81,10 @@ function doUpgrade() {
success: function(data, text) {
$("#upgrade-progress").hide();
if (data == 'OK') {
alert("Firmware image uploaded, board rebooting. This page will be refreshed in 3 seconds.");
alert("Firmware image uploaded, board rebooting. This page will be refreshed in 5 seconds.");
setTimeout(function() {
window.location = "/";
}, 3000);
}, 5000);
} else {
alert("There was an error trying to upload the new image, please try again.");
}


Loading…
Cancel
Save