mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Merge pull request #8319 from asohh/devel
Added Groups/Hosts/Sources count to inventory list rows #7674 Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
defb65d3d5
@ -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,15 @@ const DataListAction = styled(_DataListAction)`
|
||||
grid-template-columns: repeat(2, 40px);
|
||||
`;
|
||||
|
||||
const Badge = styled(PFBadge)`
|
||||
margin-left: 8px;
|
||||
`;
|
||||
|
||||
const ListGroup = styled.div`
|
||||
margin-left: 8px;
|
||||
display: inline-block;
|
||||
`;
|
||||
|
||||
function InventoryListItem({
|
||||
inventory,
|
||||
isSelected,
|
||||
@ -102,6 +112,20 @@ function InventoryListItem({
|
||||
? i18n._(t`Smart Inventory`)
|
||||
: i18n._(t`Inventory`)}
|
||||
</DataListCell>,
|
||||
<DataListCell key="groups-hosts-sources-counts">
|
||||
<ListGroup>
|
||||
{i18n._(t`Groups`)}
|
||||
<Badge isRead>{inventory.total_groups}</Badge>
|
||||
</ListGroup>
|
||||
<ListGroup>
|
||||
{i18n._(t`Hosts`)}
|
||||
<Badge isRead>{inventory.total_hosts}</Badge>
|
||||
</ListGroup>
|
||||
<ListGroup>
|
||||
{i18n._(t`Sources`)}
|
||||
<Badge isRead>{inventory.total_inventory_sources}</Badge>
|
||||
</ListGroup>
|
||||
</DataListCell>,
|
||||
inventory.pending_deletion && (
|
||||
<DataListCell alignRight isFilled={false} key="pending-delete">
|
||||
<Label color="red">{i18n._(t`Pending delete`)}</Label>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user