mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-04 17:19:06 +00:00
Settings for link labels
This commit is contained in:
parent
76dbcc0782
commit
75de6d2c38
@ -10,9 +10,8 @@
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<div>
|
||||
<mat-checkbox [(ngModel)]="settings.crash_reports"
|
||||
>Send anonymous crash reports</mat-checkbox
|
||||
>
|
||||
<mat-checkbox [(ngModel)]="settings.crash_reports">Send anonymous crash reports</mat-checkbox><br/>
|
||||
<mat-checkbox [(ngModel)]="integrateLinksLabelsToLinks">Integrate link labels to links</mat-checkbox>
|
||||
</div>
|
||||
|
||||
<!-- <div>
|
||||
|
@ -3,6 +3,7 @@ import { SettingsService } from '../../services/settings.service';
|
||||
import { ToasterService } from '../../services/toaster.service';
|
||||
import { ConsoleService } from '../../services/settings/console.service';
|
||||
import { ThemeService } from '../../services/theme.service';
|
||||
import { MapSettingsService } from '../../services/mapsettings.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
@ -12,22 +13,26 @@ import { ThemeService } from '../../services/theme.service';
|
||||
export class SettingsComponent implements OnInit {
|
||||
settings = { ...SettingsService.DEFAULTS };
|
||||
consoleCommand: string;
|
||||
integrateLinksLabelsToLinks: boolean;
|
||||
|
||||
constructor(
|
||||
private settingsService: SettingsService,
|
||||
private toaster: ToasterService,
|
||||
private consoleService: ConsoleService,
|
||||
private themeService: ThemeService
|
||||
private themeService: ThemeService,
|
||||
public mapSettingsService: MapSettingsService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.settings = this.settingsService.getAll();
|
||||
this.consoleCommand = this.consoleService.command;
|
||||
this.integrateLinksLabelsToLinks = this.mapSettingsService.integrateLinkLabelsToLinks;
|
||||
}
|
||||
|
||||
save() {
|
||||
this.settingsService.setAll(this.settings);
|
||||
this.toaster.success('Settings have been saved.');
|
||||
this.mapSettingsService.toggleIntegrateInterfaceLabels(this.integrateLinksLabelsToLinks);
|
||||
}
|
||||
|
||||
setDarkMode(value: boolean) {
|
||||
|
@ -11,10 +11,11 @@ export class MapSettingsService {
|
||||
public mapRenderedEmitter = new EventEmitter<boolean>();
|
||||
|
||||
public showInterfaceLabels: boolean = true;
|
||||
public integrateLinkLabelsToLinks: boolean = false;
|
||||
public integrateLinkLabelsToLinks: boolean = true;
|
||||
|
||||
constructor() {
|
||||
this.isLayerNumberVisible = localStorage.getItem('layersVisibility') === 'true' ? true : false;
|
||||
if (localStorage.getItem('integrateLinkLabelsToLinks')) this.integrateLinkLabelsToLinks = localStorage.getItem('integrateLinkLabelsToLinks') === 'true' ? true : false;
|
||||
}
|
||||
|
||||
changeMapLockValue(value: boolean) {
|
||||
@ -39,5 +40,11 @@ export class MapSettingsService {
|
||||
|
||||
toggleIntegrateInterfaceLabels(value: boolean) {
|
||||
this.integrateLinkLabelsToLinks = value;
|
||||
localStorage.removeItem('integrateLinkLabelsToLinks');
|
||||
if (value) {
|
||||
localStorage.setItem('integrateLinkLabelsToLinks', 'true');
|
||||
} else {
|
||||
localStorage.setItem('integrateLinkLabelsToLinks', 'false');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user