mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-24 15:16:38 +00:00
Auxiliary console support
This commit is contained in:
parent
9c754f3444
commit
42599dafb5
@ -14,6 +14,7 @@ export class Properties {
|
|||||||
headless: boolean;
|
headless: boolean;
|
||||||
linked_clone: boolean;
|
linked_clone: boolean;
|
||||||
on_close: string;
|
on_close: string;
|
||||||
|
aux: number;
|
||||||
ram: number;
|
ram: number;
|
||||||
nvram: number;
|
nvram: number;
|
||||||
usage: string;
|
usage: string;
|
||||||
|
@ -2,3 +2,11 @@
|
|||||||
<mat-icon>web_asset</mat-icon>
|
<mat-icon>web_asset</mat-icon>
|
||||||
<span>Console</span>
|
<span>Console</span>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
mat-menu-item
|
||||||
|
*ngIf="node.node_type === 'docker' || node.node_type === 'dynamips'"
|
||||||
|
(click)="openConsole(auxiliary=true)"
|
||||||
|
>
|
||||||
|
<mat-icon>web_asset</mat-icon>
|
||||||
|
<span>Auxiliary console</span>
|
||||||
|
</button>
|
||||||
|
@ -18,14 +18,14 @@ export class ConsoleDeviceActionBrowserComponent {
|
|||||||
|
|
||||||
constructor(private toasterService: ToasterService, private nodeService: NodeService, private protocolHandlerService: ProtocolHandlerService) {}
|
constructor(private toasterService: ToasterService, private nodeService: NodeService, private protocolHandlerService: ProtocolHandlerService) {}
|
||||||
|
|
||||||
openConsole() {
|
openConsole(auxiliary: boolean = false) {
|
||||||
this.nodeService.getNode(this.server, this.node).subscribe((node: Node) => {
|
this.nodeService.getNode(this.server, this.node).subscribe((node: Node) => {
|
||||||
this.node = node;
|
this.node = node;
|
||||||
this.startConsole();
|
this.startConsole(auxiliary);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
startConsole() {
|
startConsole(auxiliary: boolean) {
|
||||||
if (this.node.status !== 'started') {
|
if (this.node.status !== 'started') {
|
||||||
this.toasterService.error('This node must be started before a console can be opened');
|
this.toasterService.error('This node must be started before a console can be opened');
|
||||||
} else {
|
} else {
|
||||||
@ -44,7 +44,14 @@ export class ConsoleDeviceActionBrowserComponent {
|
|||||||
host = `[${host}]`;
|
host = `[${host}]`;
|
||||||
}
|
}
|
||||||
if (this.node.console_type === 'telnet') {
|
if (this.node.console_type === 'telnet') {
|
||||||
uri = `gns3+telnet://${host}:${this.node.console}?name=${this.node.name}&project_id=${this.node.project_id}&node_id=${this.node.node_id}`;
|
|
||||||
|
var console_port;
|
||||||
|
if (auxiliary === true) {
|
||||||
|
console_port = this.node.properties.aux;
|
||||||
|
} else {
|
||||||
|
console_port = this.node.console;
|
||||||
|
}
|
||||||
|
uri = `gns3+telnet://${host}:${console_port}?name=${this.node.name}&project_id=${this.node.project_id}&node_id=${this.node.node_id}`;
|
||||||
} else if (this.node.console_type === 'vnc') {
|
} else if (this.node.console_type === 'vnc') {
|
||||||
uri = `gns3+vnc://${host}:${this.node.console}?name=${this.node.name}&project_id=${this.node.project_id}&node_id=${this.node.node_id}`;
|
uri = `gns3+vnc://${host}:${this.node.console}?name=${this.node.name}&project_id=${this.node.project_id}&node_id=${this.node.node_id}`;
|
||||||
} else if (this.node.console_type.startsWith('spice')) {
|
} else if (this.node.console_type.startsWith('spice')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user