mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 08:27:03 +03:00
Removed AppAdminStore
This commit is contained in:
parent
004eba6be2
commit
62cb918180
6 changed files with 11 additions and 39 deletions
|
|
@ -27,7 +27,7 @@ export class AbstractApp {
|
||||||
}
|
}
|
||||||
|
|
||||||
remote() {
|
remote() {
|
||||||
return null;
|
return this.Remote || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import 'External/Admin/ko';
|
||||||
|
|
||||||
import { Settings, SettingsGet } from 'Common/Globals';
|
import { Settings, SettingsGet } from 'Common/Globals';
|
||||||
|
|
||||||
import { AppAdminStore } from 'Stores/Admin/App';
|
|
||||||
import Remote from 'Remote/Admin/Fetch';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { SettingsAdminScreen } from 'Screen/Admin/Settings';
|
import { SettingsAdminScreen } from 'Screen/Admin/Settings';
|
||||||
|
|
@ -14,10 +13,7 @@ import { AbstractApp } from 'App/Abstract';
|
||||||
class AdminApp extends AbstractApp {
|
class AdminApp extends AbstractApp {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(Remote);
|
super(Remote);
|
||||||
}
|
this.weakPassword = ko.observable(false);
|
||||||
|
|
||||||
remote() {
|
|
||||||
return Remote;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bootend() {
|
bootend() {
|
||||||
|
|
@ -27,19 +23,16 @@ class AdminApp extends AbstractApp {
|
||||||
bootstart() {
|
bootstart() {
|
||||||
super.bootstart();
|
super.bootstart();
|
||||||
|
|
||||||
AppAdminStore.populate();
|
|
||||||
|
|
||||||
this.hideLoading();
|
this.hideLoading();
|
||||||
|
|
||||||
if (!Settings.app('allowAdminPanel')) {
|
if (!Settings.app('allowAdminPanel')) {
|
||||||
rl.route.root();
|
rl.route.root();
|
||||||
setTimeout(() => location.href = '/', 1);
|
setTimeout(() => location.href = '/', 1);
|
||||||
|
} else if (SettingsGet('Auth')) {
|
||||||
|
this.weakPassword(!!SettingsGet('WeakPassword'));
|
||||||
|
startScreens([SettingsAdminScreen]);
|
||||||
} else {
|
} else {
|
||||||
if (SettingsGet('Auth')) {
|
startScreens([LoginAdminScreen]);
|
||||||
startScreens([SettingsAdminScreen]);
|
|
||||||
} else {
|
|
||||||
startScreens([LoginAdminScreen]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bootend();
|
this.bootend();
|
||||||
|
|
|
||||||
|
|
@ -136,10 +136,6 @@ class AppUser extends AbstractApp {
|
||||||
shortcuts.add('escape,enter', '', KeyState.All, () => rl.Dropdowns.detectVisibility());
|
shortcuts.add('escape,enter', '', KeyState.All, () => rl.Dropdowns.detectVisibility());
|
||||||
}
|
}
|
||||||
|
|
||||||
remote() {
|
|
||||||
return Remote;
|
|
||||||
}
|
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
(Settings.app('inIframe') ? parent : window).location.reload();
|
(Settings.app('inIframe') ? parent : window).location.reload();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { ThemeStore } from 'Stores/Theme';
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
import { LanguageStore } from 'Stores/Language';
|
import { LanguageStore } from 'Stores/Language';
|
||||||
import { AppAdminStore } from 'Stores/Admin/App';
|
|
||||||
import LanguagesPopupView from 'View/Popup/Languages';
|
import LanguagesPopupView from 'View/Popup/Languages';
|
||||||
|
|
||||||
export class GeneralAdminSettings {
|
export class GeneralAdminSettings {
|
||||||
|
|
@ -47,12 +46,13 @@ export class GeneralAdminSettings {
|
||||||
capaAdditionalAccounts: Settings.capa(Capa.AdditionalAccounts),
|
capaAdditionalAccounts: Settings.capa(Capa.AdditionalAccounts),
|
||||||
capaIdentities: Settings.capa(Capa.Identities),
|
capaIdentities: Settings.capa(Capa.Identities),
|
||||||
capaAttachmentThumbnails: Settings.capa(Capa.AttachmentThumbnails),
|
capaAttachmentThumbnails: Settings.capa(Capa.AttachmentThumbnails),
|
||||||
capaTemplates: Settings.capa(Capa.Templates)
|
capaTemplates: Settings.capa(Capa.Templates),
|
||||||
|
dataFolderAccess: false
|
||||||
});
|
});
|
||||||
|
|
||||||
this.weakPassword = AppAdminStore.weakPassword;
|
this.weakPassword = rl.app.weakPassword;
|
||||||
|
|
||||||
this.dataFolderAccess = AppAdminStore.dataFolderAccess;
|
// fetch('./data/VERSION?' + Math.random()).then(response => this.dataFolderAccess(response.ok));
|
||||||
|
|
||||||
this.mainAttachmentLimit = ko
|
this.mainAttachmentLimit = ko
|
||||||
.observable(pInt(SettingsGet('AttachmentLimit')) / (1024 * 1024))
|
.observable(pInt(SettingsGet('AttachmentLimit')) / (1024 * 1024))
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,13 @@ import { Capa } from 'Common/Enums';
|
||||||
import { Settings, SettingsGet } from 'Common/Globals';
|
import { Settings, SettingsGet } from 'Common/Globals';
|
||||||
import { addObservablesTo, addSubscribablesTo } from 'Common/Utils';
|
import { addObservablesTo, addSubscribablesTo } from 'Common/Utils';
|
||||||
|
|
||||||
import { AppAdminStore } from 'Stores/Admin/App';
|
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Fetch';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { decorateKoCommands } from 'Knoin/Knoin';
|
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||||
|
|
||||||
export class SecurityAdminSettings {
|
export class SecurityAdminSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.weakPassword = AppAdminStore.weakPassword;
|
this.weakPassword = rl.app.weakPassword;
|
||||||
|
|
||||||
addObservablesTo(this, {
|
addObservablesTo(this, {
|
||||||
useLocalProxyForExternalImages: !!SettingsGet('UseLocalProxyForExternalImages'),
|
useLocalProxyForExternalImages: !!SettingsGet('UseLocalProxyForExternalImages'),
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
import ko from 'ko';
|
|
||||||
import { SettingsGet } from 'Common/Globals';
|
|
||||||
|
|
||||||
export const AppAdminStore = {
|
|
||||||
weakPassword: ko.observable(false),
|
|
||||||
dataFolderAccess: ko.observable(false),
|
|
||||||
|
|
||||||
populate: function() {
|
|
||||||
this.weakPassword(!!SettingsGet('WeakPassword'));
|
|
||||||
/*
|
|
||||||
SettingsGet('WeakPassword')
|
|
||||||
&& fetch('./data/VERSION?' + Math.random()).then(() => this.dataFolderAccess(true));
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue