mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-10 19:21:40 +00:00
Option to minimize added
This commit is contained in:
parent
9e2bc25c01
commit
c23892f836
@ -40,14 +40,20 @@
|
|||||||
|
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
|
|
||||||
|
<button *ngIf="!isMinimized" style="color:white" mat-icon-button (click)="minimize(true)">
|
||||||
|
<mat-icon>remove</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button *ngIf="isMinimized" style="color:white" mat-icon-button (click)="minimize(false)">
|
||||||
|
<mat-icon>remove</mat-icon>
|
||||||
|
</button>
|
||||||
<button style="color:white" mat-icon-button (click)="close()">
|
<button style="color:white" mat-icon-button (click)="close()">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-log-console [hidden]="!(selected.value===0)" [server]="server" [project]="project"></app-log-console>
|
<app-log-console [hidden]="!(selected.value===0) || isMinimized" [server]="server" [project]="project"></app-log-console>
|
||||||
|
|
||||||
<div *ngFor="let node of nodes; let index = index">
|
<div [hidden]="isMinimized" *ngFor="let node of nodes; let index = index">
|
||||||
<app-web-console [hidden]="!(selected.value===(index+1))" [server]="server" [node]="nodes[index]"></app-web-console>
|
<app-web-console [hidden]="!(selected.value===(index+1))" [server]="server" [node]="nodes[index]"></app-web-console>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -28,6 +28,8 @@ export class ConsoleWrapperComponent implements OnInit {
|
|||||||
public isDraggingEnabled: boolean = false;
|
public isDraggingEnabled: boolean = false;
|
||||||
public isLightThemeEnabled: boolean = false;
|
public isLightThemeEnabled: boolean = false;
|
||||||
|
|
||||||
|
public isMinimized: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private consoleService: NodeConsoleService,
|
private consoleService: NodeConsoleService,
|
||||||
private themeService: ThemeService
|
private themeService: ThemeService
|
||||||
@ -38,7 +40,7 @@ export class ConsoleWrapperComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.themeService.getActualTheme() === 'light' ? this.isLightThemeEnabled = true : this.isLightThemeEnabled = false;
|
this.themeService.getActualTheme() === 'light' ? this.isLightThemeEnabled = true : this.isLightThemeEnabled = false;
|
||||||
this.style = { bottom: '20px', left: '20px', width: '720px', height: '456px'};
|
this.style = { bottom: '20px', left: '20px', width: '720px', height: '460px'};
|
||||||
|
|
||||||
this.consoleService.nodeConsoleTrigger.subscribe((node) => {
|
this.consoleService.nodeConsoleTrigger.subscribe((node) => {
|
||||||
this.addTab(node, true);
|
this.addTab(node, true);
|
||||||
@ -50,7 +52,17 @@ export class ConsoleWrapperComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
minimize(value: boolean) {
|
||||||
|
this.isMinimized = value;
|
||||||
|
if (!value) {
|
||||||
|
this.style = { bottom: '20px', left: '20px', width: '720px', height: '460px'};
|
||||||
|
} else {
|
||||||
|
this.style = { bottom: '20px', left: '20px', width: '720px', height: '56px'};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
addTab(node: Node, selectAfterAdding: boolean) {
|
addTab(node: Node, selectAfterAdding: boolean) {
|
||||||
|
this.minimize(false);
|
||||||
this.nodes.push(node);
|
this.nodes.push(node);
|
||||||
|
|
||||||
if (selectAfterAdding) {
|
if (selectAfterAdding) {
|
||||||
@ -99,7 +111,7 @@ export class ConsoleWrapperComponent implements OnInit {
|
|||||||
event.rectangle.width &&
|
event.rectangle.width &&
|
||||||
event.rectangle.height &&
|
event.rectangle.height &&
|
||||||
(event.rectangle.width < 720 ||
|
(event.rectangle.width < 720 ||
|
||||||
event.rectangle.height < 456)
|
event.rectangle.height < 460)
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user