mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 16:47:45 -02:30
Merge pull request #11998 from mabashian/344-host-count
Adds total host count to inv and smart inv details views
This commit is contained in:
@@ -78,6 +78,7 @@ function InventoryDetail({ inventory }) {
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
<Detail label={t`Total hosts`} value={inventory.total_hosts} />
|
||||
{instanceGroups && instanceGroups.length > 0 && (
|
||||
<Detail
|
||||
fullWidth
|
||||
|
||||
@@ -85,6 +85,7 @@ describe('<InventoryDetail />', () => {
|
||||
expectDetailToMatch(wrapper, 'Name', mockInventory.name);
|
||||
expectDetailToMatch(wrapper, 'Description', mockInventory.description);
|
||||
expectDetailToMatch(wrapper, 'Type', 'Inventory');
|
||||
expectDetailToMatch(wrapper, 'Total hosts', mockInventory.total_hosts);
|
||||
const link = wrapper.find('Detail[label="Organization"]').find('Link');
|
||||
|
||||
const org = wrapper.find('Detail[label="Organization"]');
|
||||
|
||||
@@ -28,6 +28,7 @@ function SmartInventoryDetail({ inventory }) {
|
||||
id,
|
||||
modified,
|
||||
name,
|
||||
total_hosts,
|
||||
variables,
|
||||
summary_fields: {
|
||||
created_by,
|
||||
@@ -116,6 +117,7 @@ function SmartInventoryDetail({ inventory }) {
|
||||
label={t`Smart host filter`}
|
||||
value={<Label variant="outline">{host_filter}</Label>}
|
||||
/>
|
||||
<Detail label={t`Total hosts`} value={total_hosts} />
|
||||
{instanceGroups.length > 0 && (
|
||||
<Detail
|
||||
fullWidth
|
||||
|
||||
@@ -57,6 +57,7 @@ describe('<SmartInventoryDetail />', () => {
|
||||
assertDetail('Organization', 'Default');
|
||||
assertDetail('Smart host filter', 'name__icontains=local');
|
||||
assertDetail('Instance groups', 'mock instance group');
|
||||
assertDetail('Total hosts', '2');
|
||||
expect(wrapper.find(`Detail[label="Activity"] Sparkline`)).toHaveLength(
|
||||
1
|
||||
);
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
"host_filter": "name__icontains=local",
|
||||
"variables": "",
|
||||
"has_active_failures": false,
|
||||
"total_hosts": 1,
|
||||
"total_hosts": 2,
|
||||
"hosts_with_active_failures": 0,
|
||||
"total_groups": 0,
|
||||
"groups_with_active_failures": 0,
|
||||
|
||||
Reference in New Issue
Block a user