From 0809a6e70cad7ada7f43ba07c2b3d4a729c7df37 Mon Sep 17 00:00:00 2001 From: Christian Herzog Date: Sun, 16 Feb 2020 19:42:48 +0100 Subject: [PATCH] tweak FW upload UI --- components/wifi-manager/code.js | 1 - components/wifi-manager/http_server_handlers.c | 4 ++-- components/wifi-manager/index.html | 17 +++++++---------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/components/wifi-manager/code.js b/components/wifi-manager/code.js index d3d10638..b4e1b852 100644 --- a/components/wifi-manager/code.js +++ b/components/wifi-manager/code.js @@ -368,7 +368,6 @@ $(document).ready(function(){ console.log('sent config JSON with data:', JSON.stringify(data)); }); $("#fwUpload").on("click", function() { - var upload_path = "/flash.json"; var fileInput = document.getElementById("flashfilename").files; if (fileInput.length == 0) { diff --git a/components/wifi-manager/http_server_handlers.c b/components/wifi-manager/http_server_handlers.c index b7b305ea..fb899170 100644 --- a/components/wifi-manager/http_server_handlers.c +++ b/components/wifi-manager/http_server_handlers.c @@ -430,13 +430,13 @@ esp_err_t resource_filehandler(httpd_req_t *req){ httpd_resp_set_hdr(req, "Content-Encoding", "gzip"); const size_t file_size = (bootstrap_js_gz_end - bootstrap_js_gz_start); httpd_resp_send(req, (const char *)bootstrap_js_gz_start, file_size); - } + } else if(strstr(filename, "bootstrap.css")) { set_content_type_from_file(req, filename); httpd_resp_set_hdr(req, "Content-Encoding", "gzip"); const size_t file_size = (bootstrap_css_gz_end - bootstrap_css_gz_start); httpd_resp_send(req, (const char *)bootstrap_css_gz_start, file_size); - } + } else { ESP_LOGE_LOC(TAG, "Unknown resource [%s] from path [%s] ", filename,filepath); /* Respond with 404 Not Found */ diff --git a/components/wifi-manager/index.html b/components/wifi-manager/index.html index 1ea702c8..3f7b67e1 100644 --- a/components/wifi-manager/index.html +++ b/components/wifi-manager/index.html @@ -346,19 +346,16 @@

Firmware URL:

- +
-
OR
-
-
- - -
-
- Upload +

OR

+
+ +
+
- +