1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 06:51:10 +03:00

adding host resolve for nested groups route

This commit is contained in:
Jared Tabor 2017-05-01 16:14:08 -04:00
parent 4820a3dca3
commit 6de87b910b

View File

@ -66,8 +66,15 @@ export default ['$stateExtender', 'templateUrl', '$injector',
return qs.search(path, $stateParams[`${list.iterator}_search`]);
}
],
host: ['$stateParams', 'HostManageService', function($stateParams, HostManageService) {
if($stateParams.host_id){
return HostManageService.get({ id: $stateParams.host_id }).then(function(res) {
return res.data.results[0];
});
}
}],
inventoryData: ['InventoryManageService', '$stateParams', 'host', function(InventoryManageService, $stateParams, host) {
var id = ($stateParams.inventory_id) ? $stateParams.inventory_id : host.data.summary_fields.inventory.id;
var id = ($stateParams.inventory_id) ? $stateParams.inventory_id : host.summary_fields.inventory.id;
return InventoryManageService.getInventory(id).then(res => res.data);
}]
}