mail from validation: add busy indicator
This commit is contained in:
@@ -520,7 +520,10 @@
|
|||||||
Masquerading allows users and apps to send emails with an arbitrary username in the FROM address
|
Masquerading allows users and apps to send emails with an arbitrary username in the FROM address
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<button ng-class="domain.mailConfig.mailFromValidation ? 'btn btn-danger' : 'btn btn-primary'" ng-click="toggleMailFromValidation()">{{ domain.mailConfig.mailFromValidation ? "Enable" : "Disable" }}</button>
|
<button ng-class="domain.mailConfig.mailFromValidation ? 'btn btn-danger' : 'btn btn-primary'" ng-disabled="mailFromValidation.busy" ng-click="mailFromValidation.submit()">
|
||||||
|
<i class="fa fa-circle-notch fa-spin" ng-show="mailFromValidation.busy"></i>
|
||||||
|
{{ domain.mailConfig.mailFromValidation ? "Enable" : "Disable" }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -184,11 +184,25 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.toggleMailFromValidation = function () {
|
$scope.mailFromValidation = {
|
||||||
Client.setMailFromValidation($scope.domain.domain, !$scope.domain.mailConfig.mailFromValidation, function (error) {
|
busy: false,
|
||||||
if (error) return console.error(error);
|
|
||||||
$scope.refreshDomain();
|
submit: function () {
|
||||||
});
|
$scope.mailFromValidation.busy = true;
|
||||||
|
|
||||||
|
Client.setMailFromValidation($scope.domain.domain, !$scope.domain.mailConfig.mailFromValidation, function (error) {
|
||||||
|
if (error) {
|
||||||
|
$scope.mailFromValidation.busy = false;
|
||||||
|
return console.error(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
// give sometime for the mail container to restart
|
||||||
|
$timeout(function () {
|
||||||
|
$scope.mailFromValidation.busy = false;
|
||||||
|
$scope.refreshDomain();
|
||||||
|
}, 5000);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.incomingEmail = {
|
$scope.incomingEmail = {
|
||||||
|
|||||||
Reference in New Issue
Block a user