load and display tankinfo on ui

This commit is contained in:
2025-03-21 23:25:30 +01:00
parent 110cb50098
commit db27de3073
7 changed files with 200 additions and 8 deletions

View File

@@ -20,6 +20,18 @@ import { FileView } from './fileview';
import { LogView } from './log';
export class Controller {
loadTankInfo() : Promise<void> {
return fetch(PUBLIC_URL + "/tank")
.then(response => response.json())
.then(json => json as TankInfo)
.then(tankinfo => {
controller.tankView.setTankInfo(tankinfo)
})
.catch(error => {
console.log(error);
});
}
loadLogLocaleConfig() {
return fetch(PUBLIC_URL + "/log_localization")
.then(response => response.json())
@@ -459,7 +471,11 @@ controller.updateRTCData().then(_ => {
controller.updateFileList().then(_ => {
controller.progressview.addProgress("initial", 90, "read backupinfo");
controller.getBackupInfo().then(_ => {
controller.progressview.removeProgress("initial");
controller.loadLogLocaleConfig().then(_ => {
controller.loadTankInfo().then(_ => {
controller.progressview.removeProgress("initial")
})
})
})
})
})