Skip to content

Commit

Permalink
Merge pull request #257 from jtomasek/add-host-id
Browse files Browse the repository at this point in the history
MGMT-2423 Display cluster/host UUIDs
  • Loading branch information
mareklibra authored Oct 14, 2020
2 parents fa3583b + b2752e9 commit 42107d1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/components/clusterDetail/ClusterProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ const ClusterProperties: React.FC<ClusterPropertiesProps> = ({ cluster }) => (
<Text component="h2">Cluster Details</Text>
</TextContent>
</GridItem>
<GridItem md={6} lg={6} xl={6}>
<GridItem md={6}>
<DetailList>
<DetailItem title="OpenShift version" value={cluster.openshiftVersion} />
<DetailItem title="Base DNS domain" value={cluster.baseDnsDomain} />
<DetailItem title="API virtual IP" value={cluster.apiVip} />
<DetailItem title="Ingress virtual IP" value={cluster.ingressVip} />
</DetailList>
</GridItem>
<GridItem md={6} lg={6} xl={6}>
<GridItem md={6}>
<DetailList>
<DetailItem title="UUID" value={cluster.id} />
<DetailItem title="Cluster network CIDR" value={cluster.clusterNetworkCidr} />
<DetailItem title="Cluster network host prefix" value={cluster.clusterNetworkHostPrefix} />
<DetailItem title="Service network CIDR" value={cluster.serviceNetworkCidr} />
Expand Down
7 changes: 5 additions & 2 deletions src/components/hosts/HostRowDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import Humanize from 'humanize-plus';
import { TextContent, Text, TextVariants, Grid, GridItem } from '@patternfly/react-core';
import { Table, TableHeader, TableBody, TableVariant } from '@patternfly/react-table';
import { ExtraParamsType } from '@patternfly/react-table/dist/js/components/Table/base';
import { Inventory } from '../../api/types';
import { Host, Inventory } from '../../api/types';
import { getHostRowHardwareInfo } from './hardwareInfo';
import { DASH } from '../constants';
import { DetailList, DetailListProps, DetailItem } from '../ui/DetailList';

type HostDetailProps = {
inventory: Inventory;
host: Host;
};

type SectionTitleProps = {
Expand Down Expand Up @@ -122,7 +123,8 @@ const NicsTable: React.FC<NicsTableProps> = ({ interfaces = [] }) => {
);
};

export const HostDetail: React.FC<HostDetailProps> = ({ inventory }) => {
export const HostDetail: React.FC<HostDetailProps> = ({ inventory, host }) => {
const { id } = host;
const rowInfo = getHostRowHardwareInfo(inventory);

let bmcAddress = inventory.bmcAddress;
Expand All @@ -135,6 +137,7 @@ export const HostDetail: React.FC<HostDetailProps> = ({ inventory }) => {
<Grid hasGutter>
<SectionTitle title="Host Details" />
<SectionColumn>
<DetailItem title="UUID" value={id} />
<DetailItem title="Manufacturer" value={inventory.systemVendor?.manufacturer || DASH} />
<DetailItem title="Product" value={inventory.systemVendor?.productName || DASH} />
<DetailItem title="Serial number" value={rowInfo.serialNumber} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/hosts/HostsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const hostToHostTableRow = (openRows: OpenRows, cluster: Cluster) => (host: Host
// expandable detail
// parent will be set after sorting
fullWidth: true,
cells: [{ title: <HostDetail key={id} inventory={inventory} /> }],
cells: [{ title: <HostDetail key={id} inventory={inventory} host={host} /> }],
key: `${host.id}-detail`,
inventory,
},
Expand Down

0 comments on commit 42107d1

Please sign in to comment.