Give external ldap sync task feedback
This commit is contained in:
@@ -429,14 +429,25 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
||||
|
||||
sync: function () {
|
||||
$scope.externalLdap.syncBusy = true;
|
||||
Client.startExternalLdapSync(function (error, result) {
|
||||
|
||||
Client.startExternalLdapSync(function (error, taskId) {
|
||||
if (error) {
|
||||
$scope.externalLdap.syncBusy = false;
|
||||
console.error('Unable to start ldap syncer task.', error);
|
||||
} else {
|
||||
console.log(result);
|
||||
return;
|
||||
}
|
||||
})
|
||||
|
||||
function refreshTaskStatus() {
|
||||
Client.getTask(taskId, function (error, result) {
|
||||
if (error) console.error(error);
|
||||
if (result && result.active) return $timeout(refreshTaskStatus, 2000);
|
||||
|
||||
$scope.externalLdap.syncBusy = false;
|
||||
});
|
||||
}
|
||||
|
||||
refreshTaskStatus();
|
||||
});
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
|
||||
Reference in New Issue
Block a user