mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 17:51:06 -03:30
Added inventory type to org inventories
This commit is contained in:
@@ -7,12 +7,12 @@
|
|||||||
export default ['$scope', '$rootScope', '$location',
|
export default ['$scope', '$rootScope', '$location',
|
||||||
'$stateParams', '$compile', '$filter', 'Rest', 'InventoryList',
|
'$stateParams', '$compile', '$filter', 'Rest', 'InventoryList',
|
||||||
'OrgInventoryDataset', 'OrgInventoryList',
|
'OrgInventoryDataset', 'OrgInventoryList',
|
||||||
'ProcessErrors', 'GetBasePath', 'Wait', 'Find', 'Empty', '$state',
|
'ProcessErrors', 'GetBasePath', 'Wait', 'Find', 'Empty', '$state', 'i18n',
|
||||||
function($scope, $rootScope, $location,
|
function($scope, $rootScope, $location,
|
||||||
$stateParams, $compile, $filter, Rest, InventoryList,
|
$stateParams, $compile, $filter, Rest, InventoryList,
|
||||||
Dataset, OrgInventoryList,
|
Dataset, OrgInventoryList,
|
||||||
ProcessErrors, GetBasePath, Wait,
|
ProcessErrors, GetBasePath, Wait,
|
||||||
Find, Empty, $state) {
|
Find, Empty, $state, i18n) {
|
||||||
|
|
||||||
var list = OrgInventoryList,
|
var list = OrgInventoryList,
|
||||||
orgBase = GetBasePath('organizations');
|
orgBase = GetBasePath('organizations');
|
||||||
@@ -38,11 +38,11 @@ export default ['$scope', '$rootScope', '$location',
|
|||||||
});
|
});
|
||||||
|
|
||||||
$scope.$watch('inventories', ()=>{
|
$scope.$watch('inventories', ()=>{
|
||||||
_.forEach($scope.inventories, buildInventorySyncStatus);
|
_.forEach($scope.inventories, processInventoryRow);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildInventorySyncStatus(item) {
|
function processInventoryRow(item) {
|
||||||
if (item.has_inventory_sources) {
|
if (item.has_inventory_sources) {
|
||||||
if (item.inventory_sources_with_failures > 0) {
|
if (item.inventory_sources_with_failures > 0) {
|
||||||
item.syncStatus = 'error';
|
item.syncStatus = 'error';
|
||||||
@@ -66,6 +66,9 @@ export default ['$scope', '$rootScope', '$location',
|
|||||||
item.hostsStatus = 'none';
|
item.hostsStatus = 'none';
|
||||||
item.hostsTip = 'Inventory contains 0 hosts.';
|
item.hostsTip = 'Inventory contains 0 hosts.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item.kind_label = item.kind === '' ? 'Inventory' : (item.kind === 'smart' ? i18n._('Smart Inventory'): i18n._('Inventory'));
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user