mirror of
https://github.com/goharbor/harbor
synced 2025-04-21 22:28:14 +00:00
Fixed toggling admin options.
This commit is contained in:
parent
60ae6fba1b
commit
8f758120d9
@ -36,25 +36,22 @@
|
|||||||
.error(toggleAdminFailed);
|
.error(toggleAdminFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleAdminSuccess(data, status) {
|
function toggleStatus() {
|
||||||
if(vm.isAdmin) {
|
vm.isAdmin = !vm.isAdmin;
|
||||||
vm.isAdmin = false;
|
vm.enabled = vm.isAdmin ? 0 : 1;
|
||||||
}else{
|
|
||||||
vm.isAdmin = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleAdminSuccess(data, status) {
|
||||||
console.log('Toggled userId:' + vm.userId + ' to admin:' + vm.isAdmin);
|
console.log('Toggled userId:' + vm.userId + ' to admin:' + vm.isAdmin);
|
||||||
|
toggleStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleAdminFailed(data, status) {
|
function toggleAdminFailed(data, status) {
|
||||||
|
console.log('Failed to toggle admin:' + data);
|
||||||
|
toggleStatus();
|
||||||
$scope.$emit('modalTitle', $filter('tr')('error'));
|
$scope.$emit('modalTitle', $filter('tr')('error'));
|
||||||
$scope.$emit('modalMessage', $filter('tr')('failed_to_toggle_admin'));
|
$scope.$emit('modalMessage', $filter('tr')('failed_to_toggle_admin'));
|
||||||
$scope.$emit('raiseError', true);
|
$scope.$emit('raiseError', true);
|
||||||
if(vm.isAdmin) {
|
|
||||||
vm.isAdmin = false;
|
|
||||||
}else{
|
|
||||||
vm.isAdmin = true;
|
|
||||||
}
|
|
||||||
console.log('Failed to toggle admin:' + data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user