show build version in html
This commit is contained in:
@@ -33,5 +33,23 @@ export function uploadFile() {
|
||||
ajax.send(file);
|
||||
}
|
||||
|
||||
interface VersionInfo{
|
||||
git_hash:string,
|
||||
build_time: string
|
||||
}
|
||||
|
||||
let file1Upload = document.getElementById("file1") as HTMLInputElement;
|
||||
file1Upload.onchange = uploadFile;
|
||||
|
||||
let firmware_buildtime = document.getElementById("firmware_buildtime") as HTMLDivElement;
|
||||
let firmware_githash = document.getElementById("firmware_githash") as HTMLDivElement;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
fetch("/version")
|
||||
.then(response => response.json())
|
||||
.then(json => json as VersionInfo)
|
||||
.then(versionInfo => {
|
||||
firmware_buildtime.innerText = versionInfo.build_time;
|
||||
firmware_githash.innerText = versionInfo.git_hash;
|
||||
})
|
||||
}, false);
|
Reference in New Issue
Block a user