Give external ldap sync task feedback

This commit is contained in:
Johannes Zellner
2019-08-29 23:19:34 +02:00
parent 426d2aab09
commit 91cf6465df
2 changed files with 16 additions and 5 deletions

View File

@@ -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 () {