2017-07-15 23:29:40 +08:00
|
|
|
import {Component, OnChanges} from "@angular/core";
|
2017-07-15 22:31:43 +08:00
|
|
|
import {SettingsComponent} from "../_abstract/abstract.settings.component";
|
|
|
|
import {AuthenticationService} from "../../model/network/authentication.service";
|
|
|
|
import {NavigationService} from "../../model/navigation.service";
|
|
|
|
import {NotificationService} from "../../model/notification.service";
|
|
|
|
import {OtherSettingsService} from "./other.settings.service";
|
|
|
|
import {OtherConfigDTO} from "../../../../common/entities/settings/OtherConfigDTO";
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'settings-other',
|
|
|
|
templateUrl: './other.settings.component.html',
|
|
|
|
styleUrls: ['./other.settings.component.css',
|
|
|
|
'./../_abstract/abstract.settings.component.css'],
|
|
|
|
providers: [OtherSettingsService],
|
|
|
|
})
|
2017-07-15 23:29:40 +08:00
|
|
|
export class OtherSettingsComponent extends SettingsComponent<OtherConfigDTO> implements OnChanges {
|
2017-07-15 22:31:43 +08:00
|
|
|
|
|
|
|
constructor(_authService: AuthenticationService,
|
|
|
|
_navigation: NavigationService,
|
|
|
|
_settingsService: OtherSettingsService,
|
|
|
|
notification: NotificationService) {
|
2017-07-15 23:29:40 +08:00
|
|
|
super("Other", _authService, _navigation, _settingsService, notification, s => ({
|
|
|
|
enableThreading: s.Server.enableThreading,
|
|
|
|
enableOnScrollThumbnailPrioritising: s.Client.enableOnScrollThumbnailPrioritising,
|
|
|
|
enableOnScrollRendering: s.Client.enableOnScrollRendering,
|
|
|
|
enableCache: s.Client.enableCache
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnChanges(): void {
|
|
|
|
this.hasAvailableSettings = !this.simplifiedMode;
|
2017-07-15 22:31:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async save(): Promise<boolean> {
|
|
|
|
const val = await super.save();
|
|
|
|
if (val == true) {
|
|
|
|
|
|
|
|
this.notification.info('Restart the server to apply the new settings', "Info");
|
|
|
|
}
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|