mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-20 15:40:29 +00:00
Merge branch 'master' into Widget-dragging
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
<button mat-menu-item (click)="editStyle()">
|
||||
<button mat-menu-item *ngIf="!isImageDrawing" (click)="editStyle()">
|
||||
<mat-icon>style</mat-icon>
|
||||
<span>Edit style</span>
|
||||
</button>
|
||||
|
@ -1,22 +1,26 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, Input, OnChanges } from '@angular/core';
|
||||
import { Drawing } from '../../../../../cartography/models/drawing';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { Project } from '../../../../../models/project';
|
||||
import { StyleEditorDialogComponent } from '../../../drawings-editors/style-editor/style-editor.component';
|
||||
import { ImageElement } from '../../../../../cartography/models/drawings/image-element';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-style-action',
|
||||
templateUrl: './edit-style-action.component.html'
|
||||
})
|
||||
export class EditStyleActionComponent implements OnInit {
|
||||
export class EditStyleActionComponent implements OnChanges {
|
||||
@Input() server: Server;
|
||||
@Input() project: Project;
|
||||
@Input() drawing: Drawing;
|
||||
isImageDrawing: boolean = false;
|
||||
|
||||
constructor(private dialog: MatDialog) {}
|
||||
|
||||
ngOnInit() {}
|
||||
ngOnChanges() {
|
||||
this.isImageDrawing = this.drawing.element instanceof ImageElement;
|
||||
}
|
||||
|
||||
editStyle() {
|
||||
const dialogRef = this.dialog.open(StyleEditorDialogComponent, {
|
||||
|
@ -90,6 +90,9 @@
|
||||
<mat-checkbox [ngModel]="notificationsVisibility" (change)="toggleNotifications($event.checked)">
|
||||
Show notifications
|
||||
</mat-checkbox>
|
||||
<mat-checkbox [ngModel]="layersVisibility" (change)="toggleLayers($event.checked)">
|
||||
Show layers
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
</mat-menu>
|
||||
|
||||
|
@ -83,6 +83,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
public isTopologySummaryVisible: boolean = true;
|
||||
public isInterfaceLabelVisible: boolean = false;
|
||||
public notificationsVisibility: boolean = false;
|
||||
public layersVisibility: boolean = false;
|
||||
|
||||
tools = {
|
||||
selection: true,
|
||||
@ -238,6 +239,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
}));
|
||||
|
||||
this.notificationsVisibility = localStorage.getItem('notificationsVisibility') === 'true' ? true : false;
|
||||
this.layersVisibility = localStorage.getItem('layersVisibility') === 'true' ? true : false;
|
||||
this.addKeyboardListeners();
|
||||
}
|
||||
|
||||
@ -479,6 +481,17 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
public toggleLayers(visible: boolean) {
|
||||
this.layersVisibility = visible;
|
||||
this.mapSettingsService.toggleLayers(visible);
|
||||
if (this.layersVisibility) {
|
||||
localStorage.setItem('layersVisibility', 'true');
|
||||
} else {
|
||||
localStorage.removeItem('layersVisibility')
|
||||
}
|
||||
this.mapChild.applyMapSettingsChanges();
|
||||
}
|
||||
|
||||
private showMessage(msg) {
|
||||
if (this.notificationsVisibility) {
|
||||
if (msg.type === 'error') this.toasterService.error(msg.message);
|
||||
|
Reference in New Issue
Block a user