mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
Add error message on adminpanel contacts configuration page.
This commit is contained in:
parent
a531846b8f
commit
869e0ed181
9 changed files with 120 additions and 60 deletions
|
|
@ -21,11 +21,13 @@ function AdminContacts()
|
|||
this.testing = ko.observable(false);
|
||||
this.testContactsSuccess = ko.observable(false);
|
||||
this.testContactsError = ko.observable(false);
|
||||
this.testContactsErrorMessage = ko.observable('');
|
||||
|
||||
this.testContactsCommand = Utils.createCommand(this, function () {
|
||||
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
this.testContactsErrorMessage('');
|
||||
this.testing(true);
|
||||
|
||||
RL.remote().testContacts(this.onTestContactsResponse, {
|
||||
|
|
@ -45,13 +47,18 @@ Utils.addSettingsViewModel(AdminContacts, 'AdminSettingsContacts', 'Contacts', '
|
|||
|
||||
AdminContacts.prototype.onTestContactsResponse = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
this.testContactsErrorMessage('');
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && oData.Result.Result)
|
||||
{
|
||||
this.testContactsSuccess(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.testContactsError(true);
|
||||
this.testContactsErrorMessage(oData.Result.Message || '');
|
||||
}
|
||||
|
||||
this.testing(false);
|
||||
|
|
@ -61,6 +68,7 @@ AdminContacts.prototype.onShow = function ()
|
|||
{
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
this.testContactsErrorMessage('');
|
||||
};
|
||||
|
||||
AdminContacts.prototype.onBuild = function ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue