Skip to content

Commit

Permalink
Merge pull request #1476 from GNS3/console-ipv6
Browse files Browse the repository at this point in the history
Support IPv6 for external consoles
  • Loading branch information
grossmj authored Oct 29, 2023
2 parents 58d4255 + 7812ff3 commit f3b8a42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit f3b8a42

Please sign in to comment.