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