mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 20:51:21 -03:30
Generate the correct base path for groups and hosts so that paginate works properly
This commit is contained in:
parent
696d00320f
commit
4d66c6dd0a
@ -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);
|
||||
|
||||
@ -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}`;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user