@@ -126,8 +126,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary pull-right" ng-click="mailRelay.submit()" ng-disabled="!mailRelayForm.$dirty || mailRelayForm.$invalid || mailRelay.busy"><i class="fa fa-circle-o-notch fa-spin" ng-show="mailRelay.busy"></i> Save</button>
|
||||
<div class="col-md-2">
|
||||
<button class="btn btn-primary" ng-click="mailRelay.submit()" ng-disabled="!mailRelayForm.$dirty || mailRelayForm.$invalid || mailRelay.busy"><i class="fa fa-circle-o-notch fa-spin" ng-show="mailRelay.busy"></i> Save</button>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<span class="has-error text-center" ng-show="mailRelay.error">{{ mailRelay.error }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -95,11 +95,13 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
];
|
||||
|
||||
$scope.mailRelay = {
|
||||
error: {},
|
||||
error: null,
|
||||
busy: false,
|
||||
preset: $scope.mailRelayPresets[0],
|
||||
|
||||
presetChanged: function () {
|
||||
$scope.mailRelay.error = null;
|
||||
|
||||
$scope.mailRelay.relay.enabled = $scope.mailRelay.preset.enabled;
|
||||
$scope.mailRelay.relay.presetId = $scope.mailRelay.preset.id;
|
||||
$scope.mailRelay.relay.host = $scope.mailRelay.preset.host;
|
||||
@@ -119,10 +121,13 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
$scope.mailRelay.error = null;
|
||||
$scope.mailRelay.busy = true;
|
||||
|
||||
Client.setMailRelay($scope.mailRelay.relay, function (error) {
|
||||
if (error) console.error('Unable to set relay', error);
|
||||
if (error) {
|
||||
$scope.mailRelay.error = error.message;
|
||||
}
|
||||
|
||||
$scope.mailRelay.busy = false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user