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