mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
prettier --write
This commit is contained in:
parent
450528ff00
commit
8a0be3212d
164 changed files with 7053 additions and 9008 deletions
|
|
@ -1,31 +1,27 @@
|
|||
|
||||
import ko from 'ko';
|
||||
import _ from '_';
|
||||
|
||||
import {
|
||||
trim, triggerAutocompleteInputChange
|
||||
} from 'Common/Utils';
|
||||
import { trim, triggerAutocompleteInputChange } from 'Common/Utils';
|
||||
|
||||
import {StorageResultType, Notification, Magics} from 'Common/Enums';
|
||||
import {getNotification} from 'Common/Translator';
|
||||
import {$win} from 'Common/Globals';
|
||||
import { StorageResultType, Notification, Magics } from 'Common/Enums';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
import { $win } from 'Common/Globals';
|
||||
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
import Remote from 'Remote/Admin/Ajax';
|
||||
|
||||
import {getApp} from 'Helper/Apps/Admin';
|
||||
import { getApp } from 'Helper/Apps/Admin';
|
||||
|
||||
import {view, command, ViewType, routeOff} from 'Knoin/Knoin';
|
||||
import {AbstractViewNext} from 'Knoin/AbstractViewNext';
|
||||
import { view, command, ViewType, routeOff } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
@view({
|
||||
name: 'View/Admin/Login',
|
||||
type: ViewType.Center,
|
||||
templateID: 'AdminLogin'
|
||||
})
|
||||
class LoginAdminView extends AbstractViewNext
|
||||
{
|
||||
class LoginAdminView extends AbstractViewNext {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -42,8 +38,8 @@ class LoginAdminView extends AbstractViewNext
|
|||
this.loginError = ko.observable(false);
|
||||
this.passwordError = ko.observable(false);
|
||||
|
||||
this.loginErrorAnimation = ko.observable(false).extend({'falseTimeout': 500});
|
||||
this.passwordErrorAnimation = ko.observable(false).extend({'falseTimeout': 500});
|
||||
this.loginErrorAnimation = ko.observable(false).extend({ 'falseTimeout': 500 });
|
||||
this.passwordErrorAnimation = ko.observable(false).extend({ 'falseTimeout': 500 });
|
||||
|
||||
this.loginFocus = ko.observable(false);
|
||||
|
||||
|
|
@ -67,7 +63,6 @@ class LoginAdminView extends AbstractViewNext
|
|||
|
||||
@command((self) => !self.submitRequest())
|
||||
submitCommand() {
|
||||
|
||||
triggerAutocompleteInputChange();
|
||||
|
||||
this.loginError(false);
|
||||
|
|
@ -76,38 +71,33 @@ class LoginAdminView extends AbstractViewNext
|
|||
this.loginError('' === trim(this.login()));
|
||||
this.passwordError('' === trim(this.password()));
|
||||
|
||||
if (this.loginError() || this.passwordError())
|
||||
{
|
||||
if (this.loginError() || this.passwordError()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.submitRequest(true);
|
||||
$win.trigger('rl.tooltips.diactivate');
|
||||
|
||||
Remote.adminLogin((sResult, oData) => {
|
||||
Remote.adminLogin(
|
||||
(sResult, oData) => {
|
||||
$win.trigger('rl.tooltips.diactivate');
|
||||
$win.trigger('rl.tooltips.activate');
|
||||
|
||||
$win.trigger('rl.tooltips.diactivate');
|
||||
$win.trigger('rl.tooltips.activate');
|
||||
|
||||
if (StorageResultType.Success === sResult && oData && 'AdminLogin' === oData.Action)
|
||||
{
|
||||
if (oData.Result)
|
||||
{
|
||||
getApp().loginAndLogoutReload(true);
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
if (StorageResultType.Success === sResult && oData && 'AdminLogin' === oData.Action) {
|
||||
if (oData.Result) {
|
||||
getApp().loginAndLogoutReload(true);
|
||||
} else if (oData.ErrorCode) {
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(oData.ErrorCode));
|
||||
}
|
||||
} else {
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(oData.ErrorCode));
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this.login(), this.password());
|
||||
},
|
||||
this.login(),
|
||||
this.password()
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -133,4 +123,4 @@ class LoginAdminView extends AbstractViewNext
|
|||
}
|
||||
}
|
||||
|
||||
export {LoginAdminView, LoginAdminView as default};
|
||||
export { LoginAdminView, LoginAdminView as default };
|
||||
|
|
|
|||
|
|
@ -1,25 +1,22 @@
|
|||
|
||||
import $ from '$';
|
||||
import key from 'key';
|
||||
|
||||
import {leftPanelDisabled} from 'Common/Globals';
|
||||
import {KeyState} from 'Common/Enums';
|
||||
import { leftPanelDisabled } from 'Common/Globals';
|
||||
import { KeyState } from 'Common/Enums';
|
||||
|
||||
import {view, ViewType, settingsMenuKeysHandler} from 'Knoin/Knoin';
|
||||
import {AbstractViewNext} from 'Knoin/AbstractViewNext';
|
||||
import { view, ViewType, settingsMenuKeysHandler } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
@view({
|
||||
name: 'View/Admin/Settings/Menu',
|
||||
type: ViewType.Left,
|
||||
templateID: 'AdminMenu'
|
||||
})
|
||||
class MenuSettingsAdminView extends AbstractViewNext
|
||||
{
|
||||
class MenuSettingsAdminView extends AbstractViewNext {
|
||||
/**
|
||||
* @param {?} screen
|
||||
*/
|
||||
constructor(screen) {
|
||||
|
||||
super();
|
||||
|
||||
this.leftPanelDisabled = leftPanelDisabled;
|
||||
|
|
@ -36,4 +33,4 @@ class MenuSettingsAdminView extends AbstractViewNext
|
|||
}
|
||||
}
|
||||
|
||||
export {MenuSettingsAdminView, MenuSettingsAdminView as default};
|
||||
export { MenuSettingsAdminView, MenuSettingsAdminView as default };
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import ko from 'ko';
|
||||
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
|
@ -9,18 +8,17 @@ import DomainStore from 'Stores/Admin/Domain';
|
|||
import PluginStore from 'Stores/Admin/Plugin';
|
||||
import PackageStore from 'Stores/Admin/Package';
|
||||
|
||||
import {getApp} from 'Helper/Apps/Admin';
|
||||
import { getApp } from 'Helper/Apps/Admin';
|
||||
|
||||
import {view, ViewType} from 'Knoin/Knoin';
|
||||
import {AbstractViewNext} from 'Knoin/AbstractViewNext';
|
||||
import { view, ViewType } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
@view({
|
||||
name: 'View/Admin/Settings/Pane',
|
||||
type: ViewType.Right,
|
||||
templateID: 'AdminPane'
|
||||
})
|
||||
class PaneSettingsAdminView extends AbstractViewNext
|
||||
{
|
||||
class PaneSettingsAdminView extends AbstractViewNext {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
|
@ -31,16 +29,18 @@ class PaneSettingsAdminView extends AbstractViewNext
|
|||
this.community = RL_COMMUNITY;
|
||||
|
||||
this.adminManLoading = ko.computed(
|
||||
() => '000' !== [
|
||||
DomainStore.domains.loading() ? '1' : '0',
|
||||
PluginStore.plugins.loading() ? '1' : '0',
|
||||
PackageStore.packages.loading() ? '1' : '0'
|
||||
].join('')
|
||||
() =>
|
||||
'000' !==
|
||||
[
|
||||
DomainStore.domains.loading() ? '1' : '0',
|
||||
PluginStore.plugins.loading() ? '1' : '0',
|
||||
PackageStore.packages.loading() ? '1' : '0'
|
||||
].join('')
|
||||
);
|
||||
|
||||
this.adminManLoadingVisibility = ko.computed(
|
||||
() => (this.adminManLoading() ? 'visible' : 'hidden')
|
||||
).extend({rateLimit: 300});
|
||||
this.adminManLoadingVisibility = ko
|
||||
.computed(() => (this.adminManLoading() ? 'visible' : 'hidden'))
|
||||
.extend({ rateLimit: 300 });
|
||||
}
|
||||
|
||||
logoutClick() {
|
||||
|
|
@ -50,4 +50,4 @@ class PaneSettingsAdminView extends AbstractViewNext
|
|||
}
|
||||
}
|
||||
|
||||
export {PaneSettingsAdminView, PaneSettingsAdminView as default};
|
||||
export { PaneSettingsAdminView, PaneSettingsAdminView as default };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue