diff --git a/src/app/components/project-map/context-menu/actions/console-device-action-browser/console-device-action-browser.component.ts b/src/app/components/project-map/context-menu/actions/console-device-action-browser/console-device-action-browser.component.ts index 599e50f4..299eb81f 100644 --- a/src/app/components/project-map/context-menu/actions/console-device-action-browser/console-device-action-browser.component.ts +++ b/src/app/components/project-map/context-menu/actions/console-device-action-browser/console-device-action-browser.component.ts @@ -64,13 +64,13 @@ export class ConsoleDeviceActionBrowserComponent { try { var uri; if (this.node.console_type === 'telnet') { - uri = `gns3+telnet://${this.node.console_host}:${this.node.console}?name=${this.node.name}&project_id=${this.node.project_id}&node_id=${this.node.node_id}`; + uri = `gns3+telnet://[${this.node.console_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 === 'vnc') { - uri = `gns3+vnc://${this.node.console_host}:${this.node.console}?name=${this.node.name}&project_id=${this.node.project_id}&node_id=${this.node.node_id}`; + uri = `gns3+vnc://[${this.node.console_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')) { - uri = `gns3+spice://${this.node.console_host}:${this.node.console}?name=${this.node.name}&project_id=${this.node.project_id}&node_id=${this.node.node_id}` + uri = `gns3+spice://[${this.node.console_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('http')) { - uri = `${this.node.console_type}://${this.node.console_host}:${this.node.console}` + uri = `${this.node.console_type}://[${this.node.console_host}]:${this.node.console}` return window.open(uri); // open an http console directly in a new window/tab } else { this.toasterService.error('Supported console types are: telnet, vnc, spice and spice+agent.'); diff --git a/src/app/components/project-map/log-console/log-console.component.ts b/src/app/components/project-map/log-console/log-console.component.ts index 93fc5ecc..5de9592e 100644 --- a/src/app/components/project-map/log-console/log-console.component.ts +++ b/src/app/components/project-map/log-console/log-console.component.ts @@ -226,18 +226,18 @@ export class LogConsoleComponent implements OnInit, AfterViewInit, OnDestroy { this.showCommand(`Launching console for node ${splittedCommand[1]}...`); if (node.console_type === 'telnet') { location.assign( - `gns3+telnet://${node.console_host}:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}` + `gns3+telnet://[${node.console_host}]:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}` ); } else if (node.console_type === 'vnc') { location.assign( - `gns3+vnc://${node.console_host}:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}` + `gns3+vnc://[${node.console_host}]:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}` ); } else if (node.console_type.startsWith('spice')) { location.assign( - `gns3+spice://${node.console_host}:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}` + `gns3+spice://[${node.console_host}]:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}` ); } else if (node.console_type.startsWith('http')) { - window.open(`${node.console_type}://${node.console_host}:${node.console}`); + window.open(`${node.console_type}://[${node.console_host}]:${node.console}`); } else { this.showCommand('Supported console types are: telnet, vnc, spice and spice+agent'); }