This commit is contained in:
Sebastien
2020-02-19 08:03:12 -05:00
3 changed files with 15 additions and 19 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

@@ -431,13 +431,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

@@ -4,20 +4,20 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- TODO delete -->
<link rel="stylesheet" href="/res/test/bootstrap.min.css">
<link rel="stylesheet" href="/res/bootstrap.css">
<link rel="stylesheet" href="/res/test/bootstrap.min.css"> <!-- TODO delete -->
<link rel="stylesheet" href="/res/style.css">
<link rel="stylesheet" href="style.css"> <!-- TODO delete -->
<script src="/res/jquery.js"></script>
<script src="/res/popper.js"></script>
<script src="/res/bootstrap.js"></script>
<!-- TODO delete -->
<script src="/res/test/jquery.min.js"></script>
<script src="/res/test/popper.min.js"></script>
<script src="/res/test/bootstrap.min.js"></script>
<script src="/res/test/jquery.min.js"></script> <!-- TODO delete -->
<script src="/res/test/popper.min.js"></script> <!-- TODO delete -->
<script src="/res/test/bootstrap.min.js"></script> <!-- TODO delete -->
<script src="/res/code.js"></script>
<script src="code.js"></script> <!-- TODO delete -->
<title>esp32-wifi-manager</title>
@@ -346,16 +346,13 @@
<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>