Skip to content

Commit

Permalink
Merge pull request #1252 from yaacov/grey-default-network
Browse files Browse the repository at this point in the history
🐞 Make host default network label gray
  • Loading branch information
yaacov authored Jun 30, 2024
2 parents 49bf592 + 8e858ad commit 35a2a55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"Dates are compared in UTC. End of the interval is included.": "Dates are compared in UTC. End of the interval is included.",
"Dedicated CPU": "Dedicated CPU",
"Default": "Default",
"Default network": "Default network",
"Default Transfer Network": "Default Transfer Network",
"Defines the CPU limits allocated to the main container in the controller pod. The default value is 500 milliCPU.": "Defines the CPU limits allocated to the main container in the controller pod. The default value is 500 milliCPU.",
"Delete": "Delete",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import { TableCell } from 'src/modules/Providers/utils';
import { useForkliftTranslation } from 'src/utils';

import { Button, Popover } from '@patternfly/react-core';
import { Button, HelperText, HelperTextItem, Popover } from '@patternfly/react-core';
import {
CheckCircleIcon,
ExclamationCircleIcon,
Expand All @@ -21,6 +22,8 @@ const statusIcons = {

// Define cell renderer for 'network'
export const NetworkCellRenderer: React.FC<HostCellProps> = (props) => {
const { t } = useForkliftTranslation();

const host = props?.data?.host;
const name = props?.data?.networkAdapter?.name;
const ip = props?.data?.networkAdapter?.ipAddress;
Expand All @@ -30,9 +33,16 @@ export const NetworkCellRenderer: React.FC<HostCellProps> = (props) => {

const hostStatus = determineHostStatus(host);
const statusIcon = statusIcons[hostStatus.status.toLowerCase()];

const defaultNetworkLabel = (
<HelperText>
<HelperTextItem variant="indeterminate">{t('Default network')}</HelperTextItem>
</HelperText>
);

let cellContent = (
<>
{statusIcon} {name ? `${name} - ${cidr}` : '(default)'}
{statusIcon} {name ? `${name} - ${cidr}` : defaultNetworkLabel}
</>
);

Expand Down

0 comments on commit 35a2a55

Please sign in to comment.