mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-20 13:33:06 +00:00
Update status-info.component.ts
This commit is contained in:
parent
61cca78609
commit
8175c47b6f
@ -4,6 +4,7 @@ import { ComputeService } from '../../../services/compute.service';
|
||||
import { ComputeStatistics } from '../../../models/computeStatistics';
|
||||
import { ServerService } from '../../../services/server.service';
|
||||
import { Server } from '../../../models/server';
|
||||
import { ToasterService } from '../../../services/toaster.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -18,15 +19,20 @@ export class StatusInfoComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private computeService: ComputeService,
|
||||
private serverService: ServerService
|
||||
private serverService: ServerService,
|
||||
private toasterService: ToasterService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.serverId = this.route.snapshot.paramMap.get("server_id");
|
||||
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;
|
||||
});
|
||||
}),
|
||||
error => {
|
||||
this.toasterService.error('Required server version is 2.3')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user