2015-11-19 01:32:29 +08:00
|
|
|
import ko from 'ko';
|
2019-07-05 03:19:24 +08:00
|
|
|
import { settingsGet } from 'Storage/Settings';
|
|
|
|
import { AbstractAppStore } from 'Stores/AbstractApp';
|
2015-01-27 05:06:00 +08:00
|
|
|
|
2019-07-05 03:19:24 +08:00
|
|
|
class AppAdminStore extends AbstractAppStore {
|
2016-07-16 05:29:42 +08:00
|
|
|
constructor() {
|
2015-11-19 01:32:29 +08:00
|
|
|
super();
|
2015-01-27 05:06:00 +08:00
|
|
|
|
|
|
|
this.determineUserLanguage = ko.observable(false);
|
|
|
|
this.determineUserDomain = ko.observable(false);
|
|
|
|
|
|
|
|
this.weakPassword = ko.observable(false);
|
|
|
|
this.useLocalProxyForExternalImages = ko.observable(false);
|
2017-10-02 01:54:50 +08:00
|
|
|
|
|
|
|
this.dataFolderAccess = ko.observable(false);
|
2015-01-27 05:06:00 +08:00
|
|
|
}
|
|
|
|
|
2015-11-19 01:32:29 +08:00
|
|
|
populate() {
|
|
|
|
super.populate();
|
2015-01-27 05:06:00 +08:00
|
|
|
|
2016-07-16 03:54:37 +08:00
|
|
|
this.determineUserLanguage(!!settingsGet('DetermineUserLanguage'));
|
|
|
|
this.determineUserDomain(!!settingsGet('DetermineUserDomain'));
|
2015-01-27 05:06:00 +08:00
|
|
|
|
2016-07-16 03:54:37 +08:00
|
|
|
this.weakPassword(!!settingsGet('WeakPassword'));
|
|
|
|
this.useLocalProxyForExternalImages(!!settingsGet('UseLocalProxyForExternalImages'));
|
2020-07-22 20:54:21 +08:00
|
|
|
/*
|
2017-10-02 01:54:50 +08:00
|
|
|
if (settingsGet('Auth')) {
|
2020-07-22 20:54:21 +08:00
|
|
|
window.fetch('./data/VERSION?' + window.Math.random()).then(() => this.dataFolderAccess(true));
|
2017-10-02 01:54:50 +08:00
|
|
|
}
|
2020-07-22 20:54:21 +08:00
|
|
|
*/
|
2017-10-02 01:54:50 +08:00
|
|
|
}
|
2015-11-19 01:32:29 +08:00
|
|
|
}
|
2015-01-27 05:06:00 +08:00
|
|
|
|
2016-09-13 04:50:21 +08:00
|
|
|
export default new AppAdminStore();
|