-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { translate as __ } from 'foremanReact/common/I18n'; | ||
import { | ||
DescriptionList, | ||
DescriptionListGroup, | ||
DescriptionListDescription as Dd, | ||
DescriptionListTerm as Dt, | ||
} from '@patternfly/react-core'; | ||
import CardTemplate from 'foremanReact/components/HostDetails/Templates/CardItem/CardTemplate'; | ||
|
||
const ImageModeCard = ({ isExpandedGlobal, hostDetails }) => { | ||
const imageMode = hostDetails?.content_facet_attributes?.bootc_booted_image; | ||
Check failure on line 13 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 14
|
||
if (!imageMode) return null; | ||
return ( | ||
<CardTemplate | ||
header={__('Image information')} | ||
expandable | ||
masonryLayout | ||
isExpandedGlobal={isExpandedGlobal} | ||
> | ||
<DescriptionList isHorizontal> | ||
<DescriptionListGroup> | ||
<Dt>{__('Running image')}</Dt> | ||
<Dd>{hostDetails.content_facet_attributes.bootc_booted_image}</Dd> | ||
Check failure on line 25 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 14
|
||
<Dt>{__('Running image digest')}</Dt> | ||
<Dd>{hostDetails.content_facet_attributes.bootc_booted_digest}</Dd> | ||
Check failure on line 27 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 14
|
||
<Dt>{__('Staged image')}</Dt> | ||
<Dd>{hostDetails.content_facet_attributes.bootc_staged_image}</Dd> | ||
Check failure on line 29 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 14
|
||
<Dt>{__('Staged image digest')}</Dt> | ||
<Dd>{hostDetails.content_facet_attributes.bootc_staged_digest}</Dd> | ||
Check failure on line 31 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 14
|
||
<Dt>{__('Available image')}</Dt> | ||
<Dd>{hostDetails.content_facet_attributes.bootc_available_image}</Dd> | ||
Check failure on line 33 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 14
Check failure on line 33 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 18
|
||
<Dt>{__('Available image digest')}</Dt> | ||
<Dd>{hostDetails.content_facet_attributes.bootc_available_digest}</Dd> | ||
Check failure on line 35 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 14
Check failure on line 35 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 18
|
||
<Dt>{__('Rollback image')}</Dt> | ||
<Dd>{hostDetails.content_facet_attributes.bootc_rollback_image}</Dd> | ||
Check failure on line 37 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 14
|
||
<Dt>{__('Rollback image digest')}</Dt> | ||
<Dd>{hostDetails.content_facet_attributes.bootc_rollback_digest}</Dd> | ||
Check failure on line 39 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 14
Check failure on line 39 in webpack/components/extensions/HostDetails/DetailsTabCards/ImageModeCard.js GitHub Actions / react-tests / Foreman develop Ruby 2.7 and Node 18
|
||
</DescriptionListGroup> | ||
</DescriptionList> | ||
</CardTemplate> | ||
); | ||
}; | ||
|
||
ImageModeCard.propTypes = { | ||
isExpandedGlobal: PropTypes.bool, | ||
hostDetails: PropTypes.shape({ | ||
content_facet_attributes: PropTypes.shape({ | ||
content_source_name: PropTypes.string, | ||
}), | ||
}), | ||
}; | ||
|
||
ImageModeCard.defaultProps = { | ||
isExpandedGlobal: false, | ||
hostDetails: {}, | ||
}; | ||
|
||
export default ImageModeCard; |