From 0ca1c02d101ba0267afe4d7b104917dd2385e4a3 Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Tue, 13 Oct 2020 18:10:46 +0200 Subject: [PATCH] Update console-device-action-browser.component.ts --- .../console-device-action-browser.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 6e541e5a..c540fbcb 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 @@ -33,12 +33,12 @@ export class ConsoleDeviceActionBrowserComponent { this.node.console_host = this.server.host; } - if (this.node.console_type === "telnet") { - location.assign(`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") { - location.assign(`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 === "spice") { - location.assign(`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}`); + if (this.node.console_type === "telnet" || this.node.console_type === "vnc" || this.node.console_type === "spice") { + try { + location.assign(`gns3+${this.node.console_type}://${this.node.console_host}:${this.node.console}?name=${this.node.name}&project_id=${this.node.project_id}&node_id=${this.node.node_id}`); + } catch (e) { + this.toasterService.error(e); + } } else { this.toasterService.error("Supported console types: telnet, vnc, spice."); }