1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/frontend/app/settings/basic/basic.settings.component.ts

45 lines
1.5 KiB
TypeScript
Raw Normal View History

2017-07-15 22:09:48 +08:00
import {Component} from "@angular/core";
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 {BasicSettingsService} from "./basic.settings.service";
import {BasicConfigDTO} from "../../../../common/entities/settings/BasicConfigDTO";
@Component({
selector: 'settings-basic',
templateUrl: './basic.settings.component.html',
styleUrls: ['./basic.settings.component.css',
'./../_abstract/abstract.settings.component.css'],
providers: [BasicSettingsService],
})
export class BasicSettingsComponent extends SettingsComponent<BasicConfigDTO> {
urlPlaceholder = location.origin;
constructor(_authService: AuthenticationService,
_navigation: NavigationService,
_settingsService: BasicSettingsService,
notification: NotificationService) {
2017-07-15 23:29:40 +08:00
super("Basic", _authService, _navigation, _settingsService, notification, s => ({
port: s.Server.port,
imagesFolder: s.Server.imagesFolder,
applicationTitle: s.Client.applicationTitle,
publicUrl: s.Client.publicUrl
}));
2017-07-15 22:09:48 +08:00
}
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');
}
return val;
}
2017-07-15 22:09:48 +08:00
}