load and display tankinfo on ui
This commit is contained in:
@@ -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")
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user