add dev mode support

This commit is contained in:
2024-12-04 21:38:21 +01:00
parent 4c19d757c6
commit 4a8e0188b3
9 changed files with 2739 additions and 32 deletions

View File

@@ -1,3 +1,6 @@
declare var PUBLIC_URL: string;
export function uploadFile() {
var file1 = document.getElementById("file1") as HTMLInputElement;
var loaded_n_total = document.getElementById("loaded_n_total");
@@ -29,7 +32,7 @@ export function uploadFile() {
status.innerHTML = ajax.responseText;
answer.innerHTML = "aborted";
}, false);
ajax.open("POST", "/ota");
ajax.open("POST", PUBLIC_URL+"/ota");
ajax.send(file);
}
@@ -45,7 +48,7 @@ let firmware_buildtime = document.getElementById("firmware_buildtime") as HTMLDi
let firmware_githash = document.getElementById("firmware_githash") as HTMLDivElement;
document.addEventListener('DOMContentLoaded', function() {
fetch("/version")
fetch(PUBLIC_URL+"/version")
.then(response => response.json())
.then(json => json as VersionInfo)
.then(versionInfo => {