gns3-web-ui/src/app/services/mapsettings.service.ts

36 lines
1022 B
TypeScript
Raw Normal View History

2019-06-24 06:24:38 -07:00
import { Injectable } from "@angular/core";
import { Subject } from 'rxjs';
@Injectable()
2019-08-21 06:32:44 -07:00
export class MapSettingsService {
2019-06-24 06:24:38 -07:00
public isMapLocked = new Subject<boolean>();
2019-08-21 06:32:44 -07:00
public isTopologySummaryVisible: boolean = false;
2019-08-26 05:17:50 -07:00
public isLogConsoleVisible: boolean = false;
2019-10-23 03:00:40 -07:00
public isLayerNumberVisible: boolean = false;
public interfaceLabels: Map<string, boolean> = new Map<string, boolean>();
2019-06-24 06:24:38 -07:00
2019-10-23 03:00:40 -07:00
constructor() {
this.isLayerNumberVisible = localStorage.getItem('layersVisibility') === 'true' ? true : false;
}
2019-06-24 06:24:38 -07:00
changeMapLockValue(value: boolean) {
this.isMapLocked.next(value);
}
2019-08-21 06:32:44 -07:00
toggleTopologySummary(value: boolean) {
this.isTopologySummaryVisible = value;
}
2019-08-26 05:17:50 -07:00
toggleLogConsole(value: boolean) {
this.isLogConsoleVisible = value;
}
2019-10-23 03:00:40 -07:00
toggleLayers(value: boolean) {
this.isLayerNumberVisible = value;
}
toggleShowInterfaceLabels(projectId: string, value: boolean) {
this.interfaceLabels.set(projectId, value);
}
2019-06-24 06:24:38 -07:00
}