tweak FW upload UI

This commit is contained in:
Christian Herzog
2020-02-16 19:42:48 +01:00
parent c9fab19ce8
commit 0809a6e70c
3 changed files with 9 additions and 13 deletions

View File

@@ -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) {

View File

@@ -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 */

View File

@@ -346,19 +346,16 @@
<h2>Firmware URL:</h2>
<textarea id="fwurl" maxlength="350"></textarea>
<div class="buttons">
<input type="button" id="flash" class="btn btn-danger" value="Flash!" /><span id="flash-status"></span>
<input type="button" id="flash" class="btn btn-danger" value="Flash!" /><span id="flash-status"></span>
</div>
<br />OR<br />
<div class="input-group mb-3" id="uploaddiv">
<div class="custom-file">
<input type="file" class="custom-file-input" id="flashfilename">
<label class="custom-file-label" for="flashfilename"></label>
</div>
<div class="input-group-append">
<span class="input-group-text" id="fwUpload">Upload</span>
<p>OR</p>
<div class="form-group">
<input type="file" class="form-control-file" id="flashfilename" aria-describedby="fileHelp">
<div class="buttons">
<button type="button" class="btn btn-danger" id="fwUpload">Upload!</button>
</div>
</div>
<div id="otadiv">
<div class="progress" id="progress">
<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width:0%">