From 8e858adc7fe6fea9a9cb369ac78fd67c80f8b397 Mon Sep 17 00:00:00 2001 From: yaacov Date: Sun, 30 Jun 2024 13:42:53 +0300 Subject: [PATCH] Make host default network label gray Signed-off-by: yaacov --- .../en/plugin__forklift-console-plugin.json | 1 + .../tabs/Hosts/components/NetworkCellRenderer.tsx | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/forklift-console-plugin/locales/en/plugin__forklift-console-plugin.json b/packages/forklift-console-plugin/locales/en/plugin__forklift-console-plugin.json index c90956d6b..effa2036a 100644 --- a/packages/forklift-console-plugin/locales/en/plugin__forklift-console-plugin.json +++ b/packages/forklift-console-plugin/locales/en/plugin__forklift-console-plugin.json @@ -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", diff --git a/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/Hosts/components/NetworkCellRenderer.tsx b/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/Hosts/components/NetworkCellRenderer.tsx index 332dc561a..71ac9872d 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/Hosts/components/NetworkCellRenderer.tsx +++ b/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/Hosts/components/NetworkCellRenderer.tsx @@ -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, @@ -21,6 +22,8 @@ const statusIcons = { // Define cell renderer for 'network' export const NetworkCellRenderer: React.FC = (props) => { + const { t } = useForkliftTranslation(); + const host = props?.data?.host; const name = props?.data?.networkAdapter?.name; const ip = props?.data?.networkAdapter?.ipAddress; @@ -30,9 +33,16 @@ export const NetworkCellRenderer: React.FC = (props) => { const hostStatus = determineHostStatus(host); const statusIcon = statusIcons[hostStatus.status.toLowerCase()]; + + const defaultNetworkLabel = ( + + {t('Default network')} + + ); + let cellContent = ( <> - {statusIcon} {name ? `${name} - ${cidr}` : '(default)'} + {statusIcon} {name ? `${name} - ${cidr}` : defaultNetworkLabel} );