diff --git a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx index 430fb12bc7..1f990c0740 100644 --- a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx +++ b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx @@ -29,7 +29,7 @@ function HostDetail({ host }) { variables, summary_fields: { inventory, - recent_jobs, + recent_jobs: recentJobs, created_by, modified_by, user_capabilities, @@ -66,17 +66,13 @@ function HostDetail({ host }) { ); } - const recentPlaybookJobs = recent_jobs.map(job => ({ ...job, type: 'job' })); return ( - {recentPlaybookJobs?.length > 0 && ( - } - /> + {recentJobs?.length > 0 && ( + } /> )} + {t`Name`} {t`Inventory`} {t`Actions`} diff --git a/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx b/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx index 34bbc518a6..631096f385 100644 --- a/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx +++ b/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx @@ -1,62 +1,97 @@ import 'styled-components/macro'; -import React from 'react'; +import React, { useState } from 'react'; import { string, bool, func } from 'prop-types'; import { t } from '@lingui/macro'; import { Button } from '@patternfly/react-core'; -import { Tr, Td } from '@patternfly/react-table'; +import { Tr, Td, ExpandableRowContent } from '@patternfly/react-table'; import { Link } from 'react-router-dom'; import { PencilAltIcon } from '@patternfly/react-icons'; import { ActionsTd, ActionItem } from '../../../components/PaginatedTable'; import { Host } from '../../../types'; import HostToggle from '../../../components/HostToggle'; +import { DetailList, Detail } from '../../../components/DetailList'; +import Sparkline from '../../../components/Sparkline'; function HostListItem({ host, isSelected, onSelect, detailUrl, rowIndex }) { const labelId = `check-action-${host.id}`; + const [isExpanded, setIsExpanded] = useState(false); + + const { + summary_fields: { recent_jobs: recentJobs = [] }, + } = host; return ( - - - - - {host.name} - - - - {host.summary_fields.inventory && ( - - {host.summary_fields.inventory.name} + <> + + setIsExpanded(!isExpanded), + }} + /> + + + + {host.name} - )} - - - - - - - - + + + + + + + + + + 0 ? ( + + ) : ( + t`No job data available` + ) + } + /> + + + + + ); }