message for system status page

This commit is contained in:
piotrpekala7 2020-06-24 11:49:29 +02:00
parent 1658845022
commit 3e2c537a6d
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,6 @@
<div *ngIf="!computeStatistics.length">
Statistics not loaded
</div>
<div *ngFor='let statistics of computeStatistics'>
{{statistics.compute_name}}
<app-status-chart [computeStatistics]="statistics"></app-status-chart>

View File

@ -15,6 +15,7 @@ import { ToasterService } from '../../../services/toaster.service';
export class StatusInfoComponent implements OnInit {
public serverId: string = "";
public computeStatistics: ComputeStatistics[] = [];
public connectionFailed: boolean;
constructor(
private route: ActivatedRoute,
@ -30,8 +31,7 @@ export class StatusInfoComponent implements OnInit {
getStatistics() {
this.serverService.get(Number(this.serverId)).then((server: Server) => {
this.computeService.getStatistics(server).subscribe(
(statistics: ComputeStatistics[]) => {
this.computeService.getStatistics(server).subscribe((statistics: ComputeStatistics[]) => {
this.computeStatistics = statistics;
setTimeout(() =>
{
@ -40,7 +40,7 @@ export class StatusInfoComponent implements OnInit {
20000);
}),
error => {
this.toasterService.error('Required server version is 2.3')
this.connectionFailed = true;
}
});
}