mirror of
https://github.com/portainer/portainer.git
synced 2025-08-01 20:05:23 +02:00
feat(ux): replace spinners (#1383)
This commit is contained in:
parent
9bef7cd69f
commit
d68708add7
133 changed files with 701 additions and 1061 deletions
|
@ -5,7 +5,8 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M
|
|||
userGroupGroupCreationError: '',
|
||||
selectedItemCount: 0,
|
||||
validName: false,
|
||||
pagination_count: Pagination.getPaginationCount('teams')
|
||||
pagination_count: Pagination.getPaginationCount('teams'),
|
||||
deploymentInProgress: false
|
||||
};
|
||||
$scope.sortType = 'Name';
|
||||
$scope.sortReverse = false;
|
||||
|
@ -54,7 +55,7 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M
|
|||
};
|
||||
|
||||
$scope.addTeam = function() {
|
||||
$('#createTeamSpinner').show();
|
||||
$scope.state.deploymentInProgress = true;
|
||||
$scope.state.teamCreationError = '';
|
||||
var teamName = $scope.formValues.Name;
|
||||
var leaderIds = [];
|
||||
|
@ -71,22 +72,13 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M
|
|||
Notifications.error('Failure', err, 'Unable to create team');
|
||||
})
|
||||
.finally(function final() {
|
||||
$('#createTeamSpinner').hide();
|
||||
$scope.state.deploymentInProgress = false;
|
||||
});
|
||||
};
|
||||
|
||||
function deleteSelectedTeams() {
|
||||
$('#loadingViewSpinner').show();
|
||||
var counter = 0;
|
||||
var complete = function () {
|
||||
counter = counter - 1;
|
||||
if (counter === 0) {
|
||||
$('#loadingViewSpinner').hide();
|
||||
}
|
||||
};
|
||||
angular.forEach($scope.teams, function (team) {
|
||||
if (team.Checked) {
|
||||
counter = counter + 1;
|
||||
TeamService.deleteTeam(team.Id)
|
||||
.then(function success(data) {
|
||||
var index = $scope.teams.indexOf(team);
|
||||
|
@ -95,9 +87,6 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M
|
|||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to remove team');
|
||||
})
|
||||
.finally(function final() {
|
||||
complete();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -114,7 +103,6 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M
|
|||
};
|
||||
|
||||
function initView() {
|
||||
$('#loadingViewSpinner').show();
|
||||
var userDetails = Authentication.getUserDetails();
|
||||
var isAdmin = userDetails.role === 1 ? true: false;
|
||||
$scope.isAdmin = isAdmin;
|
||||
|
@ -130,9 +118,6 @@ function ($q, $scope, $state, TeamService, UserService, TeamMembershipService, M
|
|||
$scope.teams = [];
|
||||
$scope.users = [];
|
||||
Notifications.error('Failure', err, 'Unable to retrieve teams');
|
||||
})
|
||||
.finally(function final() {
|
||||
$('#loadingViewSpinner').hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue