Update status-info.component.ts

This commit is contained in:
piotrpekala7 2020-01-20 17:38:40 +01:00
parent 8175c47b6f
commit 4955245b9c

View File

@ -25,10 +25,19 @@ export class StatusInfoComponent implements OnInit {
ngOnInit() {
this.serverId = this.route.snapshot.paramMap.get("server_id");
this.getStatistics();
}
getStatistics() {
this.serverService.get(Number(this.serverId)).then((server: Server) => {
this.computeService.getStatistics(server).subscribe(
(statistics: ComputeStatistics[]) => {
this.computeStatistics = statistics;
setTimeout(() =>
{
this.getStatistics();
},
10000);
}),
error => {
this.toasterService.error('Required server version is 2.3')