2021-12-03 19:32:21 +08:00
|
|
|
import { SaveSettingsStep } from 'Common/Enums';
|
2021-03-10 18:44:48 +08:00
|
|
|
import { SettingsGet } from 'Common/Globals';
|
2022-02-17 16:36:29 +08:00
|
|
|
import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
|
|
|
import { addObservablesTo, addSubscribablesTo } from 'External/ko';
|
2016-07-16 03:54:37 +08:00
|
|
|
|
2020-09-15 01:40:56 +08:00
|
|
|
import Remote from 'Remote/Admin/Fetch';
|
2016-08-24 06:17:50 +08:00
|
|
|
|
2021-09-23 02:17:44 +08:00
|
|
|
export class BrandingAdminSettings /*extends AbstractViewSettings*/ {
|
2016-07-16 05:29:42 +08:00
|
|
|
constructor() {
|
2021-12-03 19:32:21 +08:00
|
|
|
addObservablesTo(this, {
|
|
|
|
title: SettingsGet('Title'),
|
|
|
|
loadingDesc: SettingsGet('LoadingDescription'),
|
|
|
|
faviconUrl: SettingsGet('FaviconUrl'),
|
|
|
|
|
|
|
|
titleTrigger: SaveSettingsStep.Idle,
|
|
|
|
loadingDescTrigger: SaveSettingsStep.Idle,
|
|
|
|
faviconUrlTrigger: SaveSettingsStep.Idle
|
|
|
|
});
|
2016-07-16 03:54:37 +08:00
|
|
|
|
2021-12-03 19:32:21 +08:00
|
|
|
addSubscribablesTo(this, {
|
|
|
|
title: (value =>
|
|
|
|
Remote.saveConfig({
|
|
|
|
Title: value.trim()
|
|
|
|
}, settingsSaveHelperSimpleFunction(this.titleTrigger, this))
|
|
|
|
).debounce(999),
|
2016-07-16 03:54:37 +08:00
|
|
|
|
2021-12-03 19:32:21 +08:00
|
|
|
loadingDesc: (value =>
|
|
|
|
Remote.saveConfig({
|
|
|
|
LoadingDescription: value.trim()
|
|
|
|
}, settingsSaveHelperSimpleFunction(this.loadingDescTrigger, this))
|
|
|
|
).debounce(999),
|
2016-07-16 03:54:37 +08:00
|
|
|
|
2021-12-03 19:32:21 +08:00
|
|
|
faviconUrl: (value =>
|
|
|
|
Remote.saveConfig({
|
|
|
|
FaviconUrl: value.trim()
|
|
|
|
}, settingsSaveHelperSimpleFunction(this.faviconUrlTrigger, this))
|
|
|
|
).debounce(999)
|
|
|
|
});
|
2016-07-16 03:54:37 +08:00
|
|
|
}
|
|
|
|
}
|