Skip to content

Commit

Permalink
Refs #38028 - update Registration Details card for load balanced smar…
Browse files Browse the repository at this point in the history
…t proxies
  • Loading branch information
jeremylenz authored and ianballou committed Dec 5, 2024
1 parent 02b8079 commit 7ba19bd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/views/katello/api/v2/content_facet/base.json.rabl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ node :lifecycle_environment do |content_facet|
end

child :content_source => :content_source do
attributes :id, :name, :url
attributes :id, :name, :url, :registration_host
node(:load_balanced) { |content_source| content_source.load_balanced? }
end

child :kickstart_repository => :kickstart_repository do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { translate as __ } from 'foremanReact/common/I18n';
import {
DescriptionList,
Expand Down Expand Up @@ -55,12 +56,14 @@ const RegistrationCard = ({ isExpandedGlobal, hostDetails }) => {
const subscriptionFacetAttributes
= propsToCamelCase(hostDetails?.subscription_facet_attributes || {});
const {
registeredAt, activationKeys, user,
registeredAt, registeredThrough, activationKeys, user,
}
= subscriptionFacetAttributes;
const contentFacetAttributes
= propsToCamelCase(hostDetails?.content_facet_attributes || {});
const { contentSourceName } = contentFacetAttributes;
const { contentSource } = propsToCamelCase(contentFacetAttributes || {});
const { loadBalanced, registrationHost } = propsToCamelCase(contentSource || {});
const login = user?.login;
if (!registeredAt) return null;
return (
Expand All @@ -79,9 +82,32 @@ const RegistrationCard = ({ isExpandedGlobal, hostDetails }) => {
<DescriptionListTerm>{__('Registered by')}</DescriptionListTerm>
<RegisteredBy user={login} activationKeys={activationKeys} />
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>{__('Registered to')}</DescriptionListTerm>
<DescriptionListDescription>{registeredThrough}</DescriptionListDescription>
</DescriptionListGroup>
{loadBalanced && (
<DescriptionListGroup>
<DescriptionListTerm>{__('Load balancer')}</DescriptionListTerm>
<DescriptionListDescription>{registrationHost}</DescriptionListDescription>
</DescriptionListGroup>
)}
<DescriptionListGroup>
<DescriptionListTerm>{__('Content source')}</DescriptionListTerm>
<DescriptionListDescription>{contentSourceName}</DescriptionListDescription>
{!loadBalanced && (
<DescriptionListDescription>{contentSourceName}</DescriptionListDescription>
)}
{loadBalanced && (
<DescriptionListDescription>
<FormattedMessage
id="load-balancer-content-source-text"
defaultMessage={__('Content may come from {contentSourceName} or any other Smart Proxy behind the load balancer.')}
values={{
contentSourceName: <strong>{contentSourceName}</strong>,
}}
/>
</DescriptionListDescription>
)}
</DescriptionListGroup>
</DescriptionList>
</CardTemplate>
Expand Down

0 comments on commit 7ba19bd

Please sign in to comment.