mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 15:07:02 +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 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue