mirror of
https://github.com/portainer/portainer.git
synced 2025-08-06 14:25:31 +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
|
@ -3,7 +3,6 @@
|
|||
<a data-toggle="tooltip" title="Refresh" ui-sref="teams" ui-sref-opts="{reload: true}">
|
||||
<i class="fa fa-refresh" aria-hidden="true"></i>
|
||||
</a>
|
||||
<i id="loadingViewSpinner" class="fa fa-cog fa-spin" style="margin-left: 5px;"></i>
|
||||
</rd-header-title>
|
||||
<rd-header-content>Teams management</rd-header-content>
|
||||
</rd-header>
|
||||
|
@ -50,8 +49,10 @@
|
|||
<!-- !team-leaders -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!state.validName || formValues.Name === ''" ng-click="addTeam()"><i class="fa fa-plus" aria-hidden="true"></i> Add team</button>
|
||||
<i id="createTeamSpinner" class="fa fa-cog fa-spin" style="margin-left: 5px; display: none;"></i>
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.deploymentInProgress || !state.validName || formValues.Name === ''" ng-click="addTeam()" button-spinner="state.deploymentInProgress">
|
||||
<span ng-hide="state.deploymentInProgress"><i class="fa fa-plus" aria-hidden="true"></i> Create team</span>
|
||||
<span ng-show="state.deploymentInProgress">Creating team...</span>
|
||||
</button>
|
||||
<span class="text-danger" ng-if="state.teamCreationError" style="margin: 5px;">
|
||||
<i class="fa fa-exclamation-circle" aria-hidden="true"></i> {{ state.teamCreationError }}
|
||||
</span>
|
||||
|
|
|
@ -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