mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-21 02:01:19 +00:00
Update web-console-full-window.component.ts
This commit is contained in:
parent
e853849cc9
commit
6d0f41714a
@ -10,6 +10,7 @@ import { ActivatedRoute } from '@angular/router';
|
||||
import { ServerService } from '../../services/server.service';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { NodeService } from '../../services/node.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -22,7 +23,7 @@ export class WebConsoleFullWindowComponent implements OnInit {
|
||||
private serverId: string;
|
||||
private projectId: string;
|
||||
private nodeId: string;
|
||||
|
||||
private subscriptions: Subscription = new Subscription();
|
||||
private server: Server;
|
||||
private node: Node;
|
||||
|
||||
@ -40,6 +41,18 @@ export class WebConsoleFullWindowComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.serverService.isServiceInitialized) {
|
||||
this.getData();
|
||||
} else {
|
||||
this.subscriptions.add(
|
||||
this.serverService.serviceInitialized.subscribe((val) => {
|
||||
if (val) this.getData();
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
getData() {
|
||||
this.serverId = this.route.snapshot.paramMap.get("server_id");
|
||||
this.projectId = this.route.snapshot.paramMap.get("project_id");
|
||||
this.nodeId = this.route.snapshot.paramMap.get("node_id");
|
||||
@ -55,7 +68,7 @@ export class WebConsoleFullWindowComponent implements OnInit {
|
||||
this.title.setTitle(this.node.name);
|
||||
this.openTerminal();
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
openTerminal() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user