1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 23:13:07 +01:00

intermediate: OTA update

This commit is contained in:
wellenvogel
2021-12-14 18:01:38 +01:00
parent 8b9fabe9e4
commit 428f55e87c
6 changed files with 80 additions and 17 deletions

View File

@@ -1445,7 +1445,23 @@ function updateDashboard(data) {
});
}
}
function uploadBin(){
let el=document.getElementById("uploadFile");
if (! el) return;
if ( el.files.length < 1) return;
ensurePass()
.then (function(hash){
let req = new XMLHttpRequest();
req.onloadend=function(){
alert("upload complete");
}
let formData = new FormData();
formData.append("file1", el.files[0]);
req.open("POST", '/api/update?_hash='+encodeURIComponent(hash));
req.send(formData);
})
.catch(function(e){});
}
window.setInterval(update, 1000);
window.setInterval(function () {
let dp = document.getElementById('dashboardPage');