KEYCLOAK-5266: Component numberOfPages in clients view is missing (#4411)
This commit is contained in:
parent
8e5752c9db
commit
eb5a5023c6
1 changed files with 9 additions and 4 deletions
|
@ -730,12 +730,17 @@ module.controller('ClientImportCtrl', function($scope, $location, $upload, realm
|
|||
|
||||
module.controller('ClientListCtrl', function($scope, realm, Client, serverInfo, $route, Dialog, Notifications, filterFilter) {
|
||||
$scope.realm = realm;
|
||||
$scope.clients = Client.query({realm: realm.realm, viewableOnly: true});
|
||||
$scope.clients = [];
|
||||
$scope.currentPage = 1;
|
||||
$scope.currentPageInput = 1;
|
||||
$scope.numberOfPages = 1;
|
||||
$scope.pageSize = 20;
|
||||
$scope.numberOfPages = Math.ceil($scope.clients.length/$scope.pageSize);
|
||||
|
||||
|
||||
Client.query({realm: realm.realm, viewableOnly: true}).$promise.then(function(clients) {
|
||||
$scope.numberOfPages = Math.ceil(clients.length/$scope.pageSize);
|
||||
$scope.clients = clients;
|
||||
});
|
||||
|
||||
$scope.$watch('search', function (newVal, oldVal) {
|
||||
$scope.filtered = filterFilter($scope.clients, newVal);
|
||||
$scope.totalItems = $scope.filtered.length;
|
||||
|
@ -743,7 +748,7 @@ module.controller('ClientListCtrl', function($scope, realm, Client, serverInfo,
|
|||
$scope.currentPage = 1;
|
||||
$scope.currentPageInput = 1;
|
||||
}, true);
|
||||
|
||||
|
||||
$scope.removeClient = function(client) {
|
||||
Dialog.confirmDelete(client.clientId, 'client', function() {
|
||||
Client.remove({
|
||||
|
|
Loading…
Reference in a new issue