mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-19 03:06:31 +00:00
Option to show interface labels should be saved for opened project
This commit is contained in:
parent
03dbac5aba
commit
00597accac
@ -8,7 +8,7 @@
|
||||
[drawings]="drawings"
|
||||
[width]="project.scene_width"
|
||||
[height]="project.scene_height"
|
||||
[show-interface-labels]="project.show_interface_labels"
|
||||
[show-interface-labels]="isInterfaceLabelVisible"
|
||||
[readonly]="inReadOnlyMode"
|
||||
(nodeDragged)="onNodeDragged($event)"
|
||||
(drawingDragged)="onDrawingDragged($event)"
|
||||
@ -24,7 +24,7 @@
|
||||
[drawings]="drawings"
|
||||
[width]="project.scene_width"
|
||||
[height]="project.scene_height"
|
||||
[show-interface-labels]="project.show_interface_labels"
|
||||
[show-interface-labels]="isInterfaceLabelVisible"
|
||||
[selection-tool]="tools.selection"
|
||||
[moving-tool]="tools.moving"
|
||||
[draw-link-tool]="tools.draw_link"
|
||||
@ -78,7 +78,7 @@
|
||||
|
||||
<mat-menu #viewMenu="matMenu" [overlapTrigger]="false">
|
||||
<div class="options-item">
|
||||
<mat-checkbox [ngModel]="project.show_interface_labels" (change)="toggleShowInterfaceLabels($event.checked)">
|
||||
<mat-checkbox [ngModel]="isInterfaceLabelVisible" (change)="toggleShowInterfaceLabels($event.checked)">
|
||||
Show interface labels
|
||||
</mat-checkbox>
|
||||
<mat-checkbox [ngModel]="isConsoleVisible" (change)="toggleShowConsole($event.checked)">
|
||||
|
@ -78,6 +78,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
public isProjectMapMenuVisible: boolean = false;
|
||||
public isConsoleVisible: boolean = false;
|
||||
public isTopologySummaryVisible: boolean = false;
|
||||
public isInterfaceLabelVisible: boolean = false;
|
||||
|
||||
tools = {
|
||||
selection: true,
|
||||
@ -156,6 +157,12 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
}),
|
||||
mergeMap((project: Project) => {
|
||||
this.project = project;
|
||||
|
||||
if (this.mapSettingsService.interfaceLabels.has(project.project_id)) {
|
||||
this.isInterfaceLabelVisible = this.mapSettingsService.interfaceLabels.get(project.project_id);
|
||||
} else {
|
||||
this.isInterfaceLabelVisible = this.project.show_interface_labels;
|
||||
}
|
||||
|
||||
this.recentlyOpenedProjectService.setServerId(this.server.id.toString());
|
||||
this.recentlyOpenedProjectService.setProjectId(this.project.project_id);
|
||||
@ -403,8 +410,9 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
this.toolsService.drawLinkToolActivation(this.tools.draw_link);
|
||||
}
|
||||
|
||||
public toggleShowInterfaceLabels(enabled: boolean) {
|
||||
this.project.show_interface_labels = enabled;
|
||||
public toggleShowInterfaceLabels(visible: boolean) {
|
||||
this.isInterfaceLabelVisible = visible;
|
||||
this.mapSettingsService.toggleShowInterfaceLabels(this.project.project_id, this.isInterfaceLabelVisible);
|
||||
}
|
||||
|
||||
public toggleShowConsole(visible: boolean) {
|
||||
|
@ -6,6 +6,7 @@ export class MapSettingsService {
|
||||
public isMapLocked = new Subject<boolean>();
|
||||
public isTopologySummaryVisible: boolean = false;
|
||||
public isLogConsoleVisible: boolean = false;
|
||||
public interfaceLabels: Map<string, boolean> = new Map<string, boolean>();
|
||||
|
||||
constructor() {}
|
||||
|
||||
@ -20,4 +21,8 @@ export class MapSettingsService {
|
||||
toggleLogConsole(value: boolean) {
|
||||
this.isLogConsoleVisible = value;
|
||||
}
|
||||
|
||||
toggleShowInterfaceLabels(projectId: string, value: boolean) {
|
||||
this.interfaceLabels.set(projectId, value);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user