diff --git a/awx/ui/client/src/inventories/manage/inventory-manage.route.js b/awx/ui/client/src/inventories/manage/inventory-manage.route.js index ddcbf85e1d..87d2daacb4 100644 --- a/awx/ui/client/src/inventories/manage/inventory-manage.route.js +++ b/awx/ui/client/src/inventories/manage/inventory-manage.route.js @@ -98,9 +98,13 @@ export default { }, // target ui-views with name@inventoryManage state 'groupsList@inventoryManage': { - templateProvider: function(InventoryGroups, generateList, $templateRequest) { + templateProvider: function(InventoryGroups, generateList, $templateRequest, $stateParams, GetBasePath) { + let list = _.cloneDeep(InventoryGroups); + if($stateParams && $stateParams.group) { + list.basePath = GetBasePath('groups') + $stateParams.group[$stateParams.group.length-1] + '/children'; + } let html = generateList.build({ - list: InventoryGroups, + list: list, mode: 'edit' }); html = generateList.wrapPanel(html); @@ -112,9 +116,13 @@ export default { controller: GroupsListController }, 'hostsList@inventoryManage': { - templateProvider: function(InventoryHosts, generateList) { + templateProvider: function(InventoryHosts, generateList, $stateParams, GetBasePath) { + let list = _.cloneDeep(InventoryHosts); + if($stateParams && $stateParams.group) { + list.basePath = GetBasePath('groups') + $stateParams.group[$stateParams.group.length-1] + '/all_hosts'; + } let html = generateList.build({ - list: InventoryHosts, + list: list, mode: 'edit' }); return generateList.wrapPanel(html); diff --git a/awx/ui/client/src/shared/paginate/paginate.controller.js b/awx/ui/client/src/shared/paginate/paginate.controller.js index 407f9e10f6..bd9ff29032 100644 --- a/awx/ui/client/src/shared/paginate/paginate.controller.js +++ b/awx/ui/client/src/shared/paginate/paginate.controller.js @@ -18,7 +18,7 @@ export default ['$scope', '$stateParams', '$state', '$filter', 'GetBasePath', 'Q return; } path = GetBasePath($scope.basePath) || $scope.basePath; - queryset = _.merge($stateParams[`${$scope.iterator}_search`], { page: page.toString() }); + queryset = _.merge($stateParams[`${$scope.iterator}_search`], { page: page }); $state.go('.', { [$scope.iterator + '_search']: queryset }); @@ -59,7 +59,7 @@ export default ['$scope', '$stateParams', '$state', '$filter', 'GetBasePath', 'Q return `1 - ${pageSize}`; } else { let floor = (($scope.current() - 1) * parseInt(pageSize)) + 1; - let ceil = floor + parseInt(pageSize); + let ceil = floor + parseInt(pageSize) < $scope.dataset.count ? floor + parseInt(pageSize) : $scope.dataset.count; return `${floor} - ${ceil}`; } }