mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-18 14:58:15 +00:00
Web console in new tab
This commit is contained in:
@ -119,8 +119,6 @@ export class ConsoleWrapperComponent implements OnInit {
|
||||
height: `${event.rectangle.height - 60}px`,
|
||||
width: `${event.rectangle.width}px`
|
||||
};
|
||||
|
||||
this.consoleService.resizeTerminal();
|
||||
}
|
||||
|
||||
close() {
|
||||
|
@ -0,0 +1,4 @@
|
||||
<button mat-menu-item (click)="openConsole()">
|
||||
<mat-icon>http</mat-icon>
|
||||
<span>Web console in new tab</span>
|
||||
</button>
|
@ -0,0 +1,32 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Node } from '../../../../../cartography/models/node';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-http-console-new-tab-action',
|
||||
templateUrl: './http-console-new-tab-action.component.html'
|
||||
})
|
||||
export class HttpConsoleNewTabActionComponent implements OnInit {
|
||||
@Input() server: Server;
|
||||
@Input() nodes: Node[];
|
||||
|
||||
constructor(
|
||||
private toasterService: ToasterService,
|
||||
private router: Router
|
||||
) { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
openConsole() {
|
||||
this.nodes.forEach(n => {
|
||||
if (n.status === 'started') {
|
||||
window.open(`${this.router.url}/nodes/${n.node_id}`);
|
||||
} else {
|
||||
this.toasterService.error('To open console please start the node');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -20,6 +20,11 @@
|
||||
[server]="server"
|
||||
[nodes]="nodes"
|
||||
></app-http-console-action>
|
||||
<app-http-console-new-tab-action
|
||||
*ngIf="!projectService.isReadOnly(project) && nodes.length"
|
||||
[server]="server"
|
||||
[nodes]="nodes"
|
||||
></app-http-console-new-tab-action>
|
||||
<app-console-device-action
|
||||
*ngIf="!projectService.isReadOnly(project) && nodes.length && isElectronApp"
|
||||
[server]="server"
|
||||
|
Reference in New Issue
Block a user