From 70141f3d771031861bc6b098afe593a9593897b6 Mon Sep 17 00:00:00 2001 From: Adrian Sorge Date: Sun, 4 Oct 2020 15:17:25 +0100 Subject: [PATCH] Added Groups/Hosts/Sources count to inventory list rows #7674 --- .../InventoryList/InventoryListItem.jsx | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx index 1974827032..5c6add4b21 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx @@ -10,6 +10,7 @@ import { DataListItemRow, Label, Tooltip, + Badge as PFBadge, } from '@patternfly/react-core'; import { PencilAltIcon } from '@patternfly/react-icons'; import { t } from '@lingui/macro'; @@ -29,6 +30,18 @@ const DataListAction = styled(_DataListAction)` grid-template-columns: repeat(2, 40px); `; +const Badge = styled(PFBadge)` + margin-left: 8px; +`; + +const ListGroup = styled.span` + margin-left: 24px; + + &:first-of-type { + margin-left: 0; + } +`; + function InventoryListItem({ inventory, isSelected, @@ -97,11 +110,33 @@ function InventoryListItem({ )} , + {inventory.kind === 'smart' ? i18n._(t`Smart Inventory`) : i18n._(t`Inventory`)} , + + + {i18n._(t`Groups`)} + + {inventory.total_groups} + + + + {i18n._(t`Hosts`)} + + {inventory.total_hosts} + + + + {i18n._(t`Sources`)} + + {inventory.total_inventory_sources} + + + , + inventory.pending_deletion && (