Skip to content

Commit 35a2a55

Browse files
authored
Merge pull request #1252 from yaacov/grey-default-network
🐞 Make host default network label gray
2 parents 49bf592 + 8e858ad commit 35a2a55

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

packages/forklift-console-plugin/locales/en/plugin__forklift-console-plugin.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
"Dates are compared in UTC. End of the interval is included.": "Dates are compared in UTC. End of the interval is included.",
114114
"Dedicated CPU": "Dedicated CPU",
115115
"Default": "Default",
116+
"Default network": "Default network",
116117
"Default Transfer Network": "Default Transfer Network",
117118
"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.",
118119
"Delete": "Delete",

packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/Hosts/components/NetworkCellRenderer.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react';
22
import { TableCell } from 'src/modules/Providers/utils';
3+
import { useForkliftTranslation } from 'src/utils';
34

4-
import { Button, Popover } from '@patternfly/react-core';
5+
import { Button, HelperText, HelperTextItem, Popover } from '@patternfly/react-core';
56
import {
67
CheckCircleIcon,
78
ExclamationCircleIcon,
@@ -21,6 +22,8 @@ const statusIcons = {
2122

2223
// Define cell renderer for 'network'
2324
export const NetworkCellRenderer: React.FC<HostCellProps> = (props) => {
25+
const { t } = useForkliftTranslation();
26+
2427
const host = props?.data?.host;
2528
const name = props?.data?.networkAdapter?.name;
2629
const ip = props?.data?.networkAdapter?.ipAddress;
@@ -30,9 +33,16 @@ export const NetworkCellRenderer: React.FC<HostCellProps> = (props) => {
3033

3134
const hostStatus = determineHostStatus(host);
3235
const statusIcon = statusIcons[hostStatus.status.toLowerCase()];
36+
37+
const defaultNetworkLabel = (
38+
<HelperText>
39+
<HelperTextItem variant="indeterminate">{t('Default network')}</HelperTextItem>
40+
</HelperText>
41+
);
42+
3343
let cellContent = (
3444
<>
35-
{statusIcon} {name ? `${name} - ${cidr}` : '(default)'}
45+
{statusIcon} {name ? `${name} - ${cidr}` : defaultNetworkLabel}
3646
</>
3747
);
3848

0 commit comments

Comments
 (0)