mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-13 22:13:20 +00:00
Merge pull request #496 from GNS3/Web-console-support
Support for default telnet console - basic implementation as agreed
This commit is contained in:
commit
998889b721
@ -197,6 +197,7 @@ import { ShowNodeActionComponent } from './components/project-map/context-menu/a
|
|||||||
import { InfoDialogComponent } from './components/project-map/info-dialog/info-dialog.component';
|
import { InfoDialogComponent } from './components/project-map/info-dialog/info-dialog.component';
|
||||||
import { InfoService } from './services/info.service';
|
import { InfoService } from './services/info.service';
|
||||||
import { BringToFrontActionComponent } from './components/project-map/context-menu/actions/bring-to-front-action/bring-to-front-action.component';
|
import { BringToFrontActionComponent } from './components/project-map/context-menu/actions/bring-to-front-action/bring-to-front-action.component';
|
||||||
|
import { ConsoleDeviceActionBrowserComponent } from './components/project-map/context-menu/actions/console-device-action-browser/console-device-action-browser.component';
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
||||||
@ -323,7 +324,8 @@ if (environment.production) {
|
|||||||
SaveProjectDialogComponent,
|
SaveProjectDialogComponent,
|
||||||
TopologySummaryComponent,
|
TopologySummaryComponent,
|
||||||
InfoDialogComponent,
|
InfoDialogComponent,
|
||||||
BringToFrontActionComponent
|
BringToFrontActionComponent,
|
||||||
|
ConsoleDeviceActionBrowserComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
<button mat-menu-item (click)="openConsole()">
|
||||||
|
<mat-icon>web_asset</mat-icon>
|
||||||
|
<span>Console</span>
|
||||||
|
</button>
|
@ -0,0 +1,23 @@
|
|||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { Node } from '../../../../../cartography/models/node';
|
||||||
|
import { ToasterService } from '../../../../../services/toaster.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-console-device-action-browser',
|
||||||
|
templateUrl: './console-device-action-browser.component.html'
|
||||||
|
})
|
||||||
|
export class ConsoleDeviceActionBrowserComponent {
|
||||||
|
@Input() node: Node;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private toasterService: ToasterService
|
||||||
|
) {}
|
||||||
|
|
||||||
|
openConsole() {
|
||||||
|
if(this.node.status !== "started") {
|
||||||
|
this.toasterService.error("This node must be started before a console can be opened");
|
||||||
|
} else {
|
||||||
|
location.assign(`telnet://${this.node.console_host}:${this.node.console}/`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -12,6 +12,10 @@
|
|||||||
[server]="server"
|
[server]="server"
|
||||||
[nodes]="nodes"
|
[nodes]="nodes"
|
||||||
></app-console-device-action>
|
></app-console-device-action>
|
||||||
|
<app-console-device-action-browser
|
||||||
|
*ngIf="!projectService.isReadOnly(project) && nodes.length===1 && !isElectronApp && nodes[0].console_type!=='none'"
|
||||||
|
[node]="nodes[0]"
|
||||||
|
></app-console-device-action-browser>
|
||||||
<app-duplicate-action *ngIf="drawings.length>0 || nodes.length>0"
|
<app-duplicate-action *ngIf="drawings.length>0 || nodes.length>0"
|
||||||
[server]="server"
|
[server]="server"
|
||||||
[project]="project"
|
[project]="project"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user