mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-19 04:57:51 +00:00
commit
6873432833
@ -26,8 +26,9 @@
|
|||||||
"rxjs/add/operator/map",
|
"rxjs/add/operator/map",
|
||||||
"rxjs-compat/add/operator/map",
|
"rxjs-compat/add/operator/map",
|
||||||
"classnames",
|
"classnames",
|
||||||
"stylenames"
|
"stylenames",
|
||||||
],
|
"ipaddr.js"
|
||||||
|
],
|
||||||
"outputPath": "dist",
|
"outputPath": "dist",
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
"main": "src/main.ts",
|
"main": "src/main.ts",
|
||||||
@ -243,4 +244,4 @@
|
|||||||
"cli": {
|
"cli": {
|
||||||
"analytics": false
|
"analytics": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gns3-web-ui",
|
"name": "gns3-web-ui",
|
||||||
"version": "2.2.44",
|
"version": "2.2.46",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "GNS3 Technology Inc.",
|
"name": "GNS3 Technology Inc.",
|
||||||
"email": "developers@gns3.com"
|
"email": "developers@gns3.com"
|
||||||
@ -66,6 +66,7 @@
|
|||||||
"d3-ng2-service": "^2.2.0",
|
"d3-ng2-service": "^2.2.0",
|
||||||
"eev": "^0.1.5",
|
"eev": "^0.1.5",
|
||||||
"ini": "^2.0.0",
|
"ini": "^2.0.0",
|
||||||
|
"ipaddr.js": "^2.1.0",
|
||||||
"material-design-icons": "^3.0.1",
|
"material-design-icons": "^3.0.1",
|
||||||
"mousetrap": "^1.6.5",
|
"mousetrap": "^1.6.5",
|
||||||
"ng-circle-progress": "^1.6.0",
|
"ng-circle-progress": "^1.6.0",
|
||||||
|
@ -4,6 +4,7 @@ import { Node } from '../../../../../cartography/models/node';
|
|||||||
import { Server } from '../../../../../models/server';
|
import { Server } from '../../../../../models/server';
|
||||||
import { NodeService } from '../../../../../services/node.service';
|
import { NodeService } from '../../../../../services/node.service';
|
||||||
import { ToasterService } from '../../../../../services/toaster.service';
|
import { ToasterService } from '../../../../../services/toaster.service';
|
||||||
|
import * as ipaddr from 'ipaddr.js';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-console-device-action-browser',
|
selector: 'app-console-device-action-browser',
|
||||||
@ -63,14 +64,18 @@ export class ConsoleDeviceActionBrowserComponent {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
var uri;
|
var uri;
|
||||||
|
var host = this.node.console_host;
|
||||||
|
if (ipaddr.IPv6.isValid(host)) {
|
||||||
|
host = `[${host}]`;
|
||||||
|
}
|
||||||
if (this.node.console_type === 'telnet') {
|
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://${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') {
|
} 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://${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')) {
|
||||||
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://${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')) {
|
} 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}://${host}:${this.node.console}`
|
||||||
return window.open(uri); // open an http console directly in a new window/tab
|
return window.open(uri); // open an http console directly in a new window/tab
|
||||||
} else {
|
} else {
|
||||||
this.toasterService.error('Supported console types are: telnet, vnc, spice and spice+agent.');
|
this.toasterService.error('Supported console types are: telnet, vnc, spice and spice+agent.');
|
||||||
|
@ -26,6 +26,7 @@ import { NodeConsoleService } from '../../../services/nodeConsole.service';
|
|||||||
import { ThemeService } from '../../../services/theme.service';
|
import { ThemeService } from '../../../services/theme.service';
|
||||||
import { version } from '../../../version';
|
import { version } from '../../../version';
|
||||||
import { LogEventsDataSource } from './log-events-datasource';
|
import { LogEventsDataSource } from './log-events-datasource';
|
||||||
|
import * as ipaddr from 'ipaddr.js';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
@ -224,20 +225,24 @@ export class LogConsoleComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
} else if (this.regexConsole.test(this.command)) {
|
} else if (this.regexConsole.test(this.command)) {
|
||||||
if (node.status === 'started') {
|
if (node.status === 'started') {
|
||||||
this.showCommand(`Launching console for node ${splittedCommand[1]}...`);
|
this.showCommand(`Launching console for node ${splittedCommand[1]}...`);
|
||||||
|
var host = node.console_host;
|
||||||
|
if (ipaddr.IPv6.isValid(host)) {
|
||||||
|
host = `[${host}]`;
|
||||||
|
}
|
||||||
if (node.console_type === 'telnet') {
|
if (node.console_type === 'telnet') {
|
||||||
location.assign(
|
location.assign(
|
||||||
`gns3+telnet://[${node.console_host}]:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}`
|
`gns3+telnet://${host}:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}`
|
||||||
);
|
);
|
||||||
} else if (node.console_type === 'vnc') {
|
} else if (node.console_type === 'vnc') {
|
||||||
location.assign(
|
location.assign(
|
||||||
`gns3+vnc://[${node.console_host}]:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}`
|
`gns3+vnc://${host}:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}`
|
||||||
);
|
);
|
||||||
} else if (node.console_type.startsWith('spice')) {
|
} else if (node.console_type.startsWith('spice')) {
|
||||||
location.assign(
|
location.assign(
|
||||||
`gns3+spice://[${node.console_host}]:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}`
|
`gns3+spice://${host}:${node.console}?name=${node.name}&project_id=${node.project_id}&node_id=${node.node_id}`
|
||||||
);
|
);
|
||||||
} else if (node.console_type.startsWith('http')) {
|
} else if (node.console_type.startsWith('http')) {
|
||||||
window.open(`${node.console_type}://[${node.console_host}]:${node.console}`);
|
window.open(`${node.console_type}://${host}:${node.console}`);
|
||||||
} else {
|
} else {
|
||||||
this.showCommand('Supported console types are: telnet, vnc, spice and spice+agent');
|
this.showCommand('Supported console types are: telnet, vnc, spice and spice+agent');
|
||||||
}
|
}
|
||||||
|
@ -6148,6 +6148,11 @@ ipaddr.js@1.9.1, ipaddr.js@^1.9.0:
|
|||||||
resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz"
|
resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz"
|
||||||
integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
|
integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
|
||||||
|
|
||||||
|
ipaddr.js@^2.1.0:
|
||||||
|
version "2.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.1.0.tgz#2119bc447ff8c257753b196fc5f1ce08a4cdf39f"
|
||||||
|
integrity sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==
|
||||||
|
|
||||||
is-absolute-url@^3.0.3:
|
is-absolute-url@^3.0.3:
|
||||||
version "3.0.3"
|
version "3.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz#96c6a22b6a23929b11ea0afb1836c36ad4a5d698"
|
resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz#96c6a22b6a23929b11ea0afb1836c36ad4a5d698"
|
||||||
|
Loading…
Reference in New Issue
Block a user