Skip to content

Commit

Permalink
Fixes #38113 - Add link to REX job templates for bootc action (#11272)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfu authored Jan 9, 2025
1 parent f5f8f4f commit 25e9546
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/katello/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ def katello_template_setting_values(name)
RemoteExecutionFeature.register(:katello_module_stream_action, N_("Katello: Module Stream Actions"),
:description => N_("Perform a module stream action via Katello interface"),
:provided_inputs => ['action', 'module_spec', 'options'])
RemoteExecutionFeature.register(:katello_bootc_action, N_("Katello: Bootc Action"), :description => N_("Katello Bootc interface"))
RemoteExecutionFeature.register(:katello_bootc_upgrade, N_("Katello: Bootc Upgrade"), :description => N_("Bootc upgrade via Bootc interface"))
RemoteExecutionFeature.register(:katello_bootc_switch, N_("Katello: Bootc Switch"), :description => N_("Bootc switch via Bootc interface"))
RemoteExecutionFeature.register(:katello_bootc_rollback, N_("Katello: Bootc Rollback"), :description => N_("Bootc rollback via Bootc interface"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ import {
} from '@patternfly/react-core';
import CardTemplate from 'foremanReact/components/HostDetails/Templates/CardItem/CardTemplate';
import FontAwesomeImageModeIcon from '../../../../components/extensions/Hosts/FontAwesomeImageModeIcon';
import { createJob } from '../Tabs/customizedRexUrlHelpers';

const cardHeader = (
<>
<span style={{ marginRight: '0.5rem' }}>{__('Image mode details')}</span>
<FontAwesomeImageModeIcon />
</>
);
const actionUrl = hostname => createJob({
hostname,
feature: 'katello_bootc_action',
inputs: {},
});

const ImageModeCard = ({ isExpandedGlobal, hostDetails }) => {
const imageMode = hostDetails?.content_facet_attributes?.bootc_booted_image;
Expand All @@ -28,6 +34,7 @@ const ImageModeCard = ({ isExpandedGlobal, hostDetails }) => {
masonryLayout
isExpandedGlobal={isExpandedGlobal}
>
<a href={actionUrl(hostDetails.name)}>{__('Modify via remote execution')}</a>
<DescriptionList isHorizontal>
<DescriptionListGroup>
<Dt>{__('Running image')}</Dt>
Expand Down Expand Up @@ -58,6 +65,7 @@ const ImageModeCard = ({ isExpandedGlobal, hostDetails }) => {
ImageModeCard.propTypes = {
isExpandedGlobal: PropTypes.bool,
hostDetails: PropTypes.shape({
name: PropTypes.string,
content_facet_attributes: PropTypes.shape({
bootc_booted_image: PropTypes.string,
bootc_booted_digest: PropTypes.string,
Expand Down

0 comments on commit 25e9546

Please sign in to comment.