@openshift-assisted/ui-lib 2.9.13-cim → 2.9.15-cim
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/cim/components/Agent/AgentStatus.d.ts.map +1 -1
- package/build/@types/cim/components/Agent/AgentTable.d.ts.map +1 -1
- package/build/@types/cim/components/Agent/AgentsSelectionTable.d.ts.map +1 -1
- package/build/@types/cim/components/Agent/BMCForm.d.ts.map +1 -1
- package/build/@types/cim/components/Agent/tableUtils.d.ts +10 -5
- package/build/@types/cim/components/Agent/tableUtils.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsTable.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsNetworkTable.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsForm.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/types.d.ts +2 -0
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/types.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/utils/status.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/InfraEnvAgentTable.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/InfraEnvHostsTabAgentsWarning.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/InfraTableToolbar.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/agentStatus.d.ts +3 -2
- package/build/@types/cim/components/helpers/agentStatus.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/agents.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/status.d.ts +5 -2
- package/build/@types/cim/components/helpers/status.d.ts.map +1 -1
- package/build/@types/cim/components/modals/MassApproveAgentModal.d.ts.map +1 -1
- package/build/@types/cim/components/modals/MassDeleteAgentModal.d.ts.map +1 -1
- package/build/@types/common/components/hosts/HostRowDetail.d.ts.map +1 -1
- package/build/@types/common/components/hosts/HostStatus.d.ts.map +1 -1
- package/build/@types/common/components/hosts/status.d.ts +2 -1
- package/build/@types/common/components/hosts/status.d.ts.map +1 -1
- package/build/@types/common/components/hosts/tableUtils.d.ts +1 -1
- package/build/@types/common/components/hosts/tableUtils.d.ts.map +1 -1
- package/build/@types/common/components/storage/StorageDetail.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterDetail/HostInventoryExpandable.d.ts.map +1 -1
- package/build/@types/ocm/components/hosts/HardwareStatus.d.ts.map +1 -1
- package/build/@types/ocm/components/hosts/NetworkingStatus.d.ts.map +1 -1
- package/build/cjs/cim/components/Agent/AgentStatus.js +4 -3
- package/build/cjs/cim/components/Agent/AgentStatus.js.map +1 -1
- package/build/cjs/cim/components/Agent/AgentTable.js +4 -1
- package/build/cjs/cim/components/Agent/AgentTable.js.map +1 -1
- package/build/cjs/cim/components/Agent/AgentsSelectionTable.js +4 -0
- package/build/cjs/cim/components/Agent/AgentsSelectionTable.js.map +1 -1
- package/build/cjs/cim/components/Agent/BMCForm.js +21 -3
- package/build/cjs/cim/components/Agent/BMCForm.js.map +1 -1
- package/build/cjs/cim/components/Agent/tableUtils.js +36 -34
- package/build/cjs/cim/components/Agent/tableUtils.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsTable.js +4 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsTable.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.js +19 -2
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsNetworkTable.js +18 -3
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsNetworkTable.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsForm.js +10 -0
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsForm.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.js +2 -1
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/utils/status.js +3 -1
- package/build/cjs/cim/components/Hypershift/utils/status.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js +20 -7
- package/build/cjs/cim/components/InfraEnv/InfraEnvAgentTable.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/InfraEnvHostsTabAgentsWarning.js +5 -2
- package/build/cjs/cim/components/InfraEnv/InfraEnvHostsTabAgentsWarning.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/InfraTableToolbar.js +17 -10
- package/build/cjs/cim/components/InfraEnv/InfraTableToolbar.js.map +1 -1
- package/build/cjs/cim/components/helpers/agentStatus.js +17 -15
- package/build/cjs/cim/components/helpers/agentStatus.js.map +1 -1
- package/build/cjs/cim/components/helpers/agents.js +2 -2
- package/build/cjs/cim/components/helpers/agents.js.map +1 -1
- package/build/cjs/cim/components/helpers/status.js +40 -22
- package/build/cjs/cim/components/helpers/status.js.map +1 -1
- package/build/cjs/cim/components/helpers/toAssisted.js +2 -2
- package/build/cjs/cim/components/helpers/toAssisted.js.map +1 -1
- package/build/cjs/cim/components/modals/MassApproveAgentModal.js +8 -5
- package/build/cjs/cim/components/modals/MassApproveAgentModal.js.map +1 -1
- package/build/cjs/cim/components/modals/MassDeleteAgentModal.js +40 -33
- package/build/cjs/cim/components/modals/MassDeleteAgentModal.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.js +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.js.map +1 -1
- package/build/cjs/common/components/hosts/HostRowDetail.js +14 -14
- package/build/cjs/common/components/hosts/HostRowDetail.js.map +1 -1
- package/build/cjs/common/components/hosts/HostStatus.js +2 -1
- package/build/cjs/common/components/hosts/HostStatus.js.map +1 -1
- package/build/cjs/common/components/hosts/status.js +54 -53
- package/build/cjs/common/components/hosts/status.js.map +1 -1
- package/build/cjs/common/components/hosts/tableUtils.js +3 -3
- package/build/cjs/common/components/hosts/tableUtils.js.map +1 -1
- package/build/cjs/common/components/storage/DisksTable.js +8 -8
- package/build/cjs/common/components/storage/DisksTable.js.map +1 -1
- package/build/cjs/common/components/storage/StorageDetail.js +3 -1
- package/build/cjs/common/components/storage/StorageDetail.js.map +1 -1
- package/build/cjs/common/components/ui/formik/validationSchemas.js +1 -1
- package/build/cjs/common/components/ui/formik/validationSchemas.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationTableBase.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationTableBase.js.map +1 -1
- package/build/cjs/ocm/components/clusterDetail/HostInventoryExpandable.js +3 -1
- package/build/cjs/ocm/components/clusterDetail/HostInventoryExpandable.js.map +1 -1
- package/build/cjs/ocm/components/hosts/HardwareStatus.js +3 -1
- package/build/cjs/ocm/components/hosts/HardwareStatus.js.map +1 -1
- package/build/cjs/ocm/components/hosts/NetworkingStatus.js +3 -1
- package/build/cjs/ocm/components/hosts/NetworkingStatus.js.map +1 -1
- package/lib/cim/components/Agent/AgentStatus.tsx +4 -3
- package/lib/cim/components/Agent/AgentTable.tsx +4 -1
- package/lib/cim/components/Agent/AgentsSelectionTable.tsx +4 -0
- package/lib/cim/components/Agent/BMCForm.tsx +23 -3
- package/lib/cim/components/Agent/tableUtils.tsx +75 -33
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsTable.tsx +4 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.tsx +21 -2
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsNetworkTable.tsx +18 -3
- package/lib/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsForm.tsx +35 -2
- package/lib/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.tsx +2 -0
- package/lib/cim/components/Hypershift/HostedClusterWizard/HostsStep/types.ts +2 -0
- package/lib/cim/components/Hypershift/utils/status.tsx +3 -1
- package/lib/cim/components/InfraEnv/InfraEnvAgentTable.tsx +20 -7
- package/lib/cim/components/InfraEnv/InfraEnvHostsTabAgentsWarning.tsx +5 -2
- package/lib/cim/components/InfraEnv/InfraTableToolbar.tsx +21 -11
- package/lib/cim/components/helpers/agentStatus.tsx +17 -16
- package/lib/cim/components/helpers/agents.ts +3 -4
- package/lib/cim/components/helpers/status.ts +44 -24
- package/lib/cim/components/helpers/toAssisted.ts +3 -3
- package/lib/cim/components/modals/MassApproveAgentModal.tsx +13 -5
- package/lib/cim/components/modals/MassDeleteAgentModal.tsx +63 -56
- package/lib/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.tsx +3 -3
- package/lib/common/components/hosts/HostRowDetail.tsx +20 -17
- package/lib/common/components/hosts/HostStatus.tsx +3 -1
- package/lib/common/components/hosts/status.tsx +227 -212
- package/lib/common/components/hosts/tableUtils.tsx +3 -3
- package/lib/common/components/storage/DisksTable.tsx +8 -8
- package/lib/common/components/storage/StorageDetail.tsx +4 -1
- package/lib/common/components/ui/formik/validationSchemas.ts +1 -1
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationTableBase.tsx +1 -1
- package/lib/ocm/components/clusterDetail/HostInventoryExpandable.tsx +3 -1
- package/lib/ocm/components/hosts/HardwareStatus.tsx +3 -1
- package/lib/ocm/components/hosts/NetworkingStatus.tsx +3 -1
- package/package.json +3 -3
|
@@ -14,15 +14,16 @@ import {
|
|
|
14
14
|
} from '@patternfly/react-core';
|
|
15
15
|
import { FilterIcon } from '@patternfly/react-icons';
|
|
16
16
|
import * as React from 'react';
|
|
17
|
-
import { HostStatus } from '../../../common/components/hosts/types';
|
|
17
|
+
import { HostStatus, HostStatusDef } from '../../../common/components/hosts/types';
|
|
18
18
|
import { agentStatus } from '../helpers/agentStatus';
|
|
19
19
|
import { TableToolbar } from '../../../common';
|
|
20
20
|
import { usePagination } from '../../../common/components/hosts/usePagination';
|
|
21
21
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
22
22
|
import { StatusCount } from '../Agent/tableUtils';
|
|
23
23
|
import { Host } from '@openshift-assisted/types/assisted-installer-service';
|
|
24
|
+
import { TFunction } from 'i18next';
|
|
24
25
|
|
|
25
|
-
const
|
|
26
|
+
const getStatusesForFilter = (statuses: HostStatus<string>) => {
|
|
26
27
|
const filterStatuses: {
|
|
27
28
|
[category: string]: {
|
|
28
29
|
[label: string]: string[];
|
|
@@ -34,19 +35,19 @@ const getStatusesForFiler = (statuses: HostStatus<string>) => {
|
|
|
34
35
|
);
|
|
35
36
|
|
|
36
37
|
sortedStatuses.forEach((status) => {
|
|
37
|
-
const { category,
|
|
38
|
+
const { category, key } = statuses[status];
|
|
38
39
|
if (filterStatuses[category]) {
|
|
39
|
-
if (filterStatuses[category][
|
|
40
|
-
filterStatuses[category][
|
|
40
|
+
if (filterStatuses[category][key]) {
|
|
41
|
+
filterStatuses[category][key].push(status);
|
|
41
42
|
} else {
|
|
42
43
|
filterStatuses[category] = {
|
|
43
44
|
...filterStatuses[category],
|
|
44
|
-
[
|
|
45
|
+
[key]: [status],
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
48
|
} else {
|
|
48
49
|
filterStatuses[category] = {
|
|
49
|
-
[
|
|
50
|
+
[key]: [status],
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
});
|
|
@@ -54,6 +55,12 @@ const getStatusesForFiler = (statuses: HostStatus<string>) => {
|
|
|
54
55
|
return filterStatuses;
|
|
55
56
|
};
|
|
56
57
|
|
|
58
|
+
const getCategoryLabels = (t: TFunction): { [k in HostStatusDef['category']]: string } => ({
|
|
59
|
+
'Installation related': t('ai:Installation related'),
|
|
60
|
+
'Discovery related': t('ai:Discovery related'),
|
|
61
|
+
'Bare Metal Host related': t('ai:Bare Metal Host related'),
|
|
62
|
+
});
|
|
63
|
+
|
|
57
64
|
type InfraTableToolbarProps = ReturnType<typeof usePagination> & {
|
|
58
65
|
setSelectedHostIDs: (items: string[]) => void;
|
|
59
66
|
massActions: React.ReactNode[];
|
|
@@ -78,10 +85,13 @@ const InfraTableToolbar: React.FC<InfraTableToolbarProps> = ({
|
|
|
78
85
|
selectedHostIDs,
|
|
79
86
|
...paginationProps
|
|
80
87
|
}) => {
|
|
81
|
-
const [statusFilterOpen, setStatusFilterOpen] = React.useState(false);
|
|
82
|
-
const filterStatuses = React.useMemo(() => getStatusesForFiler(agentStatus), []);
|
|
83
88
|
const { t } = useTranslation();
|
|
89
|
+
const agentStatuses = agentStatus(t);
|
|
90
|
+
const [statusFilterOpen, setStatusFilterOpen] = React.useState(false);
|
|
84
91
|
const itemIDs = React.useMemo(() => hosts.map((h) => h.id), [hosts]);
|
|
92
|
+
const filterStatuses = React.useMemo(() => getStatusesForFilter(agentStatuses), [agentStatuses]);
|
|
93
|
+
const categoryLabels = getCategoryLabels(t);
|
|
94
|
+
|
|
85
95
|
return (
|
|
86
96
|
<TableToolbar
|
|
87
97
|
selectedIDs={selectedHostIDs || []}
|
|
@@ -104,7 +114,7 @@ const InfraTableToolbar: React.FC<InfraTableToolbarProps> = ({
|
|
|
104
114
|
<ToolbarItem>
|
|
105
115
|
<ToolbarFilter
|
|
106
116
|
chips={statusFilter}
|
|
107
|
-
deleteChip={(
|
|
117
|
+
deleteChip={(_, chip) => setStatusFilter(statusFilter?.filter((f) => f !== chip))}
|
|
108
118
|
deleteChipGroup={() => setStatusFilter([])}
|
|
109
119
|
categoryName="Status"
|
|
110
120
|
>
|
|
@@ -130,7 +140,7 @@ const InfraTableToolbar: React.FC<InfraTableToolbarProps> = ({
|
|
|
130
140
|
<Grid key="statuses" hasGutter className="table-toolbar__dropdown">
|
|
131
141
|
{Object.keys(filterStatuses).map((category) => (
|
|
132
142
|
<GridItem key={category} span={4}>
|
|
133
|
-
<SelectGroup label={category}>
|
|
143
|
+
<SelectGroup label={categoryLabels[category as HostStatusDef['category']]}>
|
|
134
144
|
{Object.keys(filterStatuses[category]).map((label) => (
|
|
135
145
|
<SelectOption
|
|
136
146
|
key={label}
|
|
@@ -3,60 +3,61 @@ import { ConnectedIcon, ExclamationCircleIcon } from '@patternfly/react-icons';
|
|
|
3
3
|
import { global_danger_color_100 as dangerColor } from '@patternfly/react-tokens';
|
|
4
4
|
import { hostStatus } from '../../../common';
|
|
5
5
|
import { HostStatus } from '../../../common/components/hosts/types';
|
|
6
|
+
import { TFunction } from 'i18next';
|
|
6
7
|
|
|
7
|
-
export const bmhStatus: HostStatus<string>
|
|
8
|
+
export const bmhStatus = (t: TFunction): HostStatus<string> => ({
|
|
8
9
|
'bmh-error': {
|
|
9
10
|
key: 'bmh-error',
|
|
10
|
-
title: 'Error',
|
|
11
|
+
title: t('ai:Error'),
|
|
11
12
|
category: 'Bare Metal Host related',
|
|
12
13
|
},
|
|
13
14
|
registering: {
|
|
14
15
|
key: 'registering',
|
|
15
|
-
title: 'Registering',
|
|
16
|
+
title: t('ai:Registering'),
|
|
16
17
|
category: 'Bare Metal Host related',
|
|
17
18
|
},
|
|
18
19
|
provisioning: {
|
|
19
20
|
key: 'provisioning',
|
|
20
|
-
title: 'Provisioning',
|
|
21
|
+
title: t('ai:Provisioning'),
|
|
21
22
|
category: 'Bare Metal Host related',
|
|
22
23
|
},
|
|
23
24
|
provisioned: {
|
|
24
25
|
key: 'provisioned',
|
|
25
|
-
title: 'Provisioned',
|
|
26
|
+
title: t('ai:Provisioned'),
|
|
26
27
|
category: 'Bare Metal Host related',
|
|
27
28
|
},
|
|
28
29
|
deprovisioning: {
|
|
29
30
|
key: 'deprovisioning',
|
|
30
|
-
title: 'Deprovisioning',
|
|
31
|
+
title: t('ai:Deprovisioning'),
|
|
31
32
|
category: 'Bare Metal Host related',
|
|
32
33
|
},
|
|
33
34
|
inspecting: {
|
|
34
35
|
key: 'inspecting',
|
|
35
|
-
title: 'Inspecting',
|
|
36
|
+
title: t('ai:Inspecting'),
|
|
36
37
|
category: 'Bare Metal Host related',
|
|
37
38
|
},
|
|
38
39
|
pending: {
|
|
39
40
|
key: 'pending',
|
|
40
|
-
title: 'Pending',
|
|
41
|
+
title: t('ai:Pending'),
|
|
41
42
|
category: 'Bare Metal Host related',
|
|
42
43
|
},
|
|
43
|
-
};
|
|
44
|
+
});
|
|
44
45
|
|
|
45
|
-
export const agentStatus: HostStatus<string>
|
|
46
|
-
...hostStatus,
|
|
46
|
+
export const agentStatus = (t: TFunction): HostStatus<string> => ({
|
|
47
|
+
...hostStatus(t),
|
|
47
48
|
discovered: {
|
|
48
49
|
key: 'discovered',
|
|
49
|
-
title: 'Discovered',
|
|
50
|
+
title: t('ai:Discovered'),
|
|
50
51
|
icon: <ConnectedIcon />,
|
|
51
52
|
noPopover: true,
|
|
52
53
|
category: 'Discovery related',
|
|
53
|
-
details: 'The host has been discovered and needs to be approved to before further use.',
|
|
54
|
+
details: t('ai:The host has been discovered and needs to be approved to before further use.'),
|
|
54
55
|
},
|
|
55
|
-
...bmhStatus,
|
|
56
|
+
...bmhStatus(t),
|
|
56
57
|
specSyncErr: {
|
|
57
58
|
key: 'spec-sync-err',
|
|
58
|
-
title: 'Sync error',
|
|
59
|
+
title: t('ai:Sync error'),
|
|
59
60
|
icon: <ExclamationCircleIcon color={dangerColor.value} />,
|
|
60
61
|
category: 'Discovery related',
|
|
61
62
|
},
|
|
62
|
-
};
|
|
63
|
+
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AgentStatus } from './status';
|
|
1
|
+
import { AgentStatus, getAgentStatusKey } from './status';
|
|
2
2
|
import { Host } from '@openshift-assisted/types/assisted-installer-service';
|
|
3
3
|
import { AgentK8sResource, BareMetalHostK8sResource } from '../../types';
|
|
4
|
-
import { getAgentStatus } from './status';
|
|
5
4
|
import { INFRAENV_AGENTINSTALL_LABEL_KEY } from '../common/constants';
|
|
6
5
|
|
|
7
6
|
const AGENT_FOR_SELECTION_STATUSES: AgentStatus[] = [
|
|
@@ -21,8 +20,8 @@ export const hostToAgent = (agents: AgentK8sResource[] = [], host: Host) =>
|
|
|
21
20
|
|
|
22
21
|
export const getAgentsForSelection = (agents: AgentK8sResource[]) =>
|
|
23
22
|
agents.filter((agent) => {
|
|
24
|
-
const
|
|
25
|
-
return AGENT_FOR_SELECTION_STATUSES.includes(
|
|
23
|
+
const key = getAgentStatusKey(agent);
|
|
24
|
+
return AGENT_FOR_SELECTION_STATUSES.includes(key as AgentStatus);
|
|
26
25
|
});
|
|
27
26
|
|
|
28
27
|
export const getAgentRole = (agent: AgentK8sResource) => agent.spec.role || agent.status?.role;
|
|
@@ -22,8 +22,9 @@ import {
|
|
|
22
22
|
wizardStepsValidationsMap,
|
|
23
23
|
} from '../ClusterDeployment/wizardTransition';
|
|
24
24
|
import { HostStatusDef } from '../../../common';
|
|
25
|
-
import { agentStatus
|
|
25
|
+
import { agentStatus } from './agentStatus';
|
|
26
26
|
import { TFunction } from 'i18next';
|
|
27
|
+
import { HostStatus } from '../../../common/components/hosts/types';
|
|
27
28
|
|
|
28
29
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
30
|
const conditionsByTypeReducer = <K>(
|
|
@@ -125,29 +126,40 @@ export type AgentStatus = Host['status'] | 'discovered';
|
|
|
125
126
|
const getInsufficientState = (agent: AgentK8sResource) =>
|
|
126
127
|
agent?.spec?.clusterDeploymentName?.name ? 'insufficient' : 'insufficient-unbound';
|
|
127
128
|
|
|
128
|
-
export const
|
|
129
|
-
agent: AgentK8sResource,
|
|
130
|
-
excludeDiscovered = false,
|
|
131
|
-
): { status: HostStatusDef; validationsInfo: ValidationsInfo; autoCSR?: boolean } => {
|
|
129
|
+
export const getAgentStatusKey = (agent: AgentK8sResource, excludeDiscovered = false) => {
|
|
132
130
|
const specSyncErr = agent.status?.conditions?.find(
|
|
133
131
|
(c) => c.type === 'SpecSynced' && c.status === 'False',
|
|
134
132
|
);
|
|
135
|
-
|
|
136
|
-
let status: HostStatusDef;
|
|
137
|
-
let validationsInfo: ValidationsInfo = {};
|
|
138
133
|
if (specSyncErr) {
|
|
139
|
-
|
|
134
|
+
return 'specSyncError';
|
|
140
135
|
} else {
|
|
141
|
-
status = agentStatus[agent.status?.debugInfo?.state || getInsufficientState(agent)];
|
|
142
|
-
validationsInfo = agent.status?.validationsInfo || {};
|
|
143
136
|
if (!excludeDiscovered && !agent.spec.approved) {
|
|
144
|
-
|
|
137
|
+
return 'discovered';
|
|
138
|
+
} else {
|
|
139
|
+
return agent.status?.debugInfo?.state || getInsufficientState(agent);
|
|
145
140
|
}
|
|
146
|
-
// TODO(jtomasek): Implement this
|
|
147
|
-
// const sublabel = areOnlyClusterSoftValidationsFailing(agentStatus.validationsInfo)
|
|
148
|
-
// ? 'Some validations failed'
|
|
149
|
-
// : undefined;
|
|
150
141
|
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const getAgentStatus = (
|
|
145
|
+
agent: AgentK8sResource,
|
|
146
|
+
agentStatuses: HostStatus<string>,
|
|
147
|
+
excludeDiscovered = false,
|
|
148
|
+
): { status: HostStatusDef; validationsInfo: ValidationsInfo; autoCSR?: boolean } => {
|
|
149
|
+
const key = getAgentStatusKey(agent, excludeDiscovered);
|
|
150
|
+
|
|
151
|
+
let validationsInfo: ValidationsInfo = {};
|
|
152
|
+
|
|
153
|
+
const status = agentStatuses[key];
|
|
154
|
+
if (key !== 'specSyncError') {
|
|
155
|
+
validationsInfo = agent.status?.validationsInfo || {};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// TODO(jtomasek): Implement this
|
|
159
|
+
// const sublabel = areOnlyClusterSoftValidationsFailing(agentStatus.validationsInfo)
|
|
160
|
+
// ? 'Some validations failed'
|
|
161
|
+
// : undefined;
|
|
162
|
+
|
|
151
163
|
return { status, validationsInfo };
|
|
152
164
|
};
|
|
153
165
|
|
|
@@ -157,13 +169,15 @@ export const getWizardStepAgentStatus = (
|
|
|
157
169
|
t: TFunction,
|
|
158
170
|
excludeDiscovered = false,
|
|
159
171
|
): { status: HostStatusDef; validationsInfo: ValidationsInfo } => {
|
|
160
|
-
const
|
|
161
|
-
|
|
172
|
+
const agentStatuses = agentStatus(t);
|
|
173
|
+
const aStatus = getAgentStatus(agent, agentStatuses, excludeDiscovered);
|
|
174
|
+
|
|
175
|
+
if ([agentStatuses.discovered, agentStatuses.specSyncErr].includes(aStatus.status)) {
|
|
162
176
|
return aStatus;
|
|
163
177
|
}
|
|
164
178
|
|
|
165
179
|
const status =
|
|
166
|
-
|
|
180
|
+
agentStatuses[
|
|
167
181
|
getWizardStepHostStatus(wizardStepId, wizardStepsValidationsMap, {
|
|
168
182
|
status: aStatus.status.key as Host['status'],
|
|
169
183
|
validationsInfo: aStatus.validationsInfo,
|
|
@@ -188,13 +202,19 @@ export const getWizardStepAgentStatus = (
|
|
|
188
202
|
};
|
|
189
203
|
};
|
|
190
204
|
|
|
191
|
-
export const
|
|
192
|
-
let bmhState = bmhStatus.pending;
|
|
193
|
-
|
|
205
|
+
export const getBMHStatusKey = (bmh: BareMetalHostK8sResource) => {
|
|
194
206
|
if (bmh.status?.errorType) {
|
|
195
|
-
|
|
207
|
+
return 'bmh-error';
|
|
196
208
|
} else if (bmh.status?.provisioning?.state) {
|
|
197
|
-
|
|
209
|
+
return bmh.status?.provisioning?.state;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const getBMHStatus = (bmh: BareMetalHostK8sResource, bmhStatuses: HostStatus<string>) => {
|
|
214
|
+
let bmhState = bmhStatuses.pending;
|
|
215
|
+
const statusKey = getBMHStatusKey(bmh);
|
|
216
|
+
if (statusKey) {
|
|
217
|
+
bmhState = bmhStatuses[statusKey] || bmhState;
|
|
198
218
|
}
|
|
199
219
|
|
|
200
220
|
return {
|
|
@@ -3,7 +3,7 @@ import { AgentK8sResource } from '../../types/k8s/agent';
|
|
|
3
3
|
import { Cluster, Host, Inventory } from '@openshift-assisted/types/assisted-installer-service';
|
|
4
4
|
import { ClusterDeploymentK8sResource } from '../../types/k8s/cluster-deployment';
|
|
5
5
|
import { AgentClusterInstallK8sResource } from '../../types/k8s/agent-cluster-install';
|
|
6
|
-
import {
|
|
6
|
+
import { getAgentStatusKey, getClusterStatus } from './status';
|
|
7
7
|
import { getHostNetworks } from './network';
|
|
8
8
|
import { BareMetalHostK8sResource, InfraEnvK8sResource } from '../../types';
|
|
9
9
|
import {
|
|
@@ -21,7 +21,7 @@ export const getAIHosts = (
|
|
|
21
21
|
) => {
|
|
22
22
|
const bmhAgents: string[] = [];
|
|
23
23
|
const hosts = agents.map((agent): Host => {
|
|
24
|
-
const
|
|
24
|
+
const statusKey = getAgentStatusKey(agent, true);
|
|
25
25
|
const statusInfo = agent.status?.debugInfo?.stateInfo || '';
|
|
26
26
|
// TODO(mlibra) Remove that workaround once https://issues.redhat.com/browse/MGMT-7052 is fixed
|
|
27
27
|
const inventory: Inventory = cloneDeep(agent.status?.inventory || {});
|
|
@@ -50,7 +50,7 @@ export const getAIHosts = (
|
|
|
50
50
|
kind: 'Host',
|
|
51
51
|
id: agent.metadata?.uid || '',
|
|
52
52
|
href: '',
|
|
53
|
-
status:
|
|
53
|
+
status: statusKey as Host['status'],
|
|
54
54
|
statusInfo,
|
|
55
55
|
role: getAgentRole(agent),
|
|
56
56
|
requestedHostname: agent.spec.hostname || inventory.hostname,
|
|
@@ -21,6 +21,7 @@ import { getErrorMessage } from '../../../common/utils';
|
|
|
21
21
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
22
22
|
import { TFunction } from 'i18next';
|
|
23
23
|
import { Host } from '@openshift-assisted/types/assisted-installer-service';
|
|
24
|
+
import { HostStatus } from '../../../common/components/hosts/types';
|
|
24
25
|
|
|
25
26
|
type ApproveTableRowProps = {
|
|
26
27
|
agent?: AgentK8sResource;
|
|
@@ -51,7 +52,11 @@ const hostnameColumn = (agents: AgentK8sResource[], t: TFunction): TableRow<Host
|
|
|
51
52
|
};
|
|
52
53
|
};
|
|
53
54
|
|
|
54
|
-
const statusColumn = (
|
|
55
|
+
const statusColumn = (
|
|
56
|
+
agents: AgentK8sResource[],
|
|
57
|
+
agentStatuses: HostStatus<string>,
|
|
58
|
+
t: TFunction,
|
|
59
|
+
): TableRow<Host> => {
|
|
55
60
|
return {
|
|
56
61
|
header: {
|
|
57
62
|
title: t('ai:Status'),
|
|
@@ -62,8 +67,10 @@ const statusColumn = (agents: AgentK8sResource[], t: TFunction): TableRow<Host>
|
|
|
62
67
|
},
|
|
63
68
|
cell: (host) => {
|
|
64
69
|
const agent = agents.find((a) => a.metadata?.uid === host.id);
|
|
65
|
-
const status = agent?.spec.approved
|
|
66
|
-
|
|
70
|
+
const status = agent?.spec.approved
|
|
71
|
+
? t('ai:Already approved')
|
|
72
|
+
: agentStatuses.discovered.title;
|
|
73
|
+
const icon = agentStatuses.discovered.icon;
|
|
67
74
|
return {
|
|
68
75
|
title: (
|
|
69
76
|
<ApproveTableRow agent={agent}>
|
|
@@ -99,6 +106,7 @@ const MassApproveAgentModal: React.FC<MassApproveAgentModalProps> = ({
|
|
|
99
106
|
const [progress, setProgress] = React.useState<number | null>(null);
|
|
100
107
|
const [error, setError] = React.useState<{ title: string; message: string }>();
|
|
101
108
|
const { t } = useTranslation();
|
|
109
|
+
const agentStatuses = agentStatus(t);
|
|
102
110
|
const onClick = async () => {
|
|
103
111
|
setError(undefined);
|
|
104
112
|
let i = 0;
|
|
@@ -122,10 +130,10 @@ const MassApproveAgentModal: React.FC<MassApproveAgentModalProps> = ({
|
|
|
122
130
|
};
|
|
123
131
|
const { content, hosts } = React.useMemo(
|
|
124
132
|
() => ({
|
|
125
|
-
content: [hostnameColumn(agents, t), statusColumn(agents, t)],
|
|
133
|
+
content: [hostnameColumn(agents, t), statusColumn(agents, agentStatuses, t)],
|
|
126
134
|
hosts: getAIHosts(agents),
|
|
127
135
|
}),
|
|
128
|
-
[agents, t],
|
|
136
|
+
[agentStatuses, agents, t],
|
|
129
137
|
);
|
|
130
138
|
|
|
131
139
|
const paginationProps = usePagination(hosts.length);
|
|
@@ -26,6 +26,7 @@ import { usePagination } from '../../../common/components/hosts/usePagination';
|
|
|
26
26
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
27
27
|
import { TFunction } from 'i18next';
|
|
28
28
|
import { Host } from '@openshift-assisted/types/assisted-installer-service';
|
|
29
|
+
import { agentStatus, bmhStatus } from '../helpers/agentStatus';
|
|
29
30
|
|
|
30
31
|
const hostnameColumn = (agents: AgentK8sResource[], t: TFunction): TableRow<Host> => {
|
|
31
32
|
return {
|
|
@@ -56,65 +57,71 @@ const statusColumn = (
|
|
|
56
57
|
agents: AgentK8sResource[],
|
|
57
58
|
bmhs: BareMetalHostK8sResource[],
|
|
58
59
|
t: TFunction,
|
|
59
|
-
): TableRow<Host> =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
): TableRow<Host> => {
|
|
61
|
+
const agentStatuses = agentStatus(t);
|
|
62
|
+
const bmhStatuses = bmhStatus(t);
|
|
63
|
+
return {
|
|
64
|
+
header: {
|
|
65
|
+
title: t('ai:Status'),
|
|
66
|
+
props: {
|
|
67
|
+
id: 'col-header-status',
|
|
68
|
+
},
|
|
69
|
+
transforms: [sortable],
|
|
64
70
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const clusterName = agent?.spec.clusterDeploymentName?.name;
|
|
70
|
-
const bmh = bmhs?.find((b) => b.metadata?.uid === host.id);
|
|
71
|
+
cell: (host) => {
|
|
72
|
+
const agent = agents.find((a) => a.metadata?.uid === host.id);
|
|
73
|
+
const clusterName = agent?.spec.clusterDeploymentName?.name;
|
|
74
|
+
const bmh = bmhs?.find((b) => b.metadata?.uid === host.id);
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
76
|
+
let bmhStatus;
|
|
77
|
+
let title: React.ReactNode = '--';
|
|
78
|
+
if (agent) {
|
|
79
|
+
title = clusterName ? (
|
|
80
|
+
<Flex>
|
|
81
|
+
<FlexItem>
|
|
82
|
+
<AgentStatus agent={agent} zIndex={7000} />
|
|
83
|
+
</FlexItem>
|
|
84
|
+
<FlexItem align={{ default: 'alignRight' }}>
|
|
85
|
+
<Popover
|
|
86
|
+
aria-label={t('ai:Cluster popover')}
|
|
87
|
+
headerContent={<div>{t('ai:Cannot be deleted')}</div>}
|
|
88
|
+
bodyContent={
|
|
89
|
+
<div>
|
|
90
|
+
{t(
|
|
91
|
+
'ai:Hosts that are bound to a cluster cannot be deleted. Remove the host from the cluster and try again.',
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
}
|
|
95
|
+
footerContent={
|
|
96
|
+
<Link to={`/multicloud/infrastructure/clusters/details/${clusterName}/`}>
|
|
97
|
+
{t('ai:Go to cluster {{clusterName}}', { clusterName })}
|
|
98
|
+
</Link>
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
<Button variant="link" icon={<InfoCircleIcon color={blueInfoColor.value} />}>
|
|
102
|
+
{t('ai:Cannot be deleted')}
|
|
103
|
+
</Button>
|
|
104
|
+
</Popover>
|
|
105
|
+
</FlexItem>
|
|
106
|
+
</Flex>
|
|
107
|
+
) : (
|
|
108
|
+
<AgentStatus agent={agent} />
|
|
109
|
+
);
|
|
110
|
+
} else if (bmh) {
|
|
111
|
+
bmhStatus = getBMHStatus(bmh, bmhStatuses);
|
|
112
|
+
title = <BMHStatus bmhStatus={bmhStatus} />;
|
|
113
|
+
}
|
|
110
114
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
115
|
+
return {
|
|
116
|
+
title,
|
|
117
|
+
props: { 'data-testid': 'host-status' },
|
|
118
|
+
sortableValue: agent
|
|
119
|
+
? getAgentStatus(agent, agentStatuses).status.title
|
|
120
|
+
: bmhStatus?.state.title || '',
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
};
|
|
118
125
|
|
|
119
126
|
const tableContent = (
|
|
120
127
|
agents: AgentK8sResource[],
|
package/lib/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.tsx
CHANGED
|
@@ -51,9 +51,9 @@ export const ManagedNetworkingControlGroup = ({
|
|
|
51
51
|
<>
|
|
52
52
|
<span>{t('ai:User-Managed Networking')}</span>{' '}
|
|
53
53
|
<PopoverIcon
|
|
54
|
-
bodyContent={
|
|
55
|
-
"With User-Managed Networking, you'll need to provide and configure a load balancer for the API and ingress endpoints."
|
|
56
|
-
}
|
|
54
|
+
bodyContent={t(
|
|
55
|
+
"ai:With User-Managed Networking, you'll need to provide and configure a load balancer for the API and ingress endpoints.",
|
|
56
|
+
)}
|
|
57
57
|
/>
|
|
58
58
|
</>
|
|
59
59
|
}
|
|
@@ -24,6 +24,7 @@ import SectionTitle from '../ui/SectionTitle';
|
|
|
24
24
|
import { OnDiskRoleType } from './DiskRole';
|
|
25
25
|
import StorageDetail from '../storage/StorageDetail';
|
|
26
26
|
import { stringToJSON } from '../../utils';
|
|
27
|
+
import { TFunction } from 'i18next';
|
|
27
28
|
|
|
28
29
|
type HostDetailProps = {
|
|
29
30
|
host: Host;
|
|
@@ -53,12 +54,12 @@ const SectionColumn: React.FC<SectionColumnProps> = ({ children }) => (
|
|
|
53
54
|
</GridItem>
|
|
54
55
|
);
|
|
55
56
|
|
|
56
|
-
const nicsColumns = [
|
|
57
|
-
{ title: 'Name' },
|
|
58
|
-
{ title: 'MAC address' },
|
|
59
|
-
{ title: 'IPv4 address' },
|
|
60
|
-
{ title: 'IPv6 address' },
|
|
61
|
-
{ title: 'Speed' },
|
|
57
|
+
const nicsColumns = (t: TFunction) => [
|
|
58
|
+
{ title: t('ai:Name') },
|
|
59
|
+
{ title: t('ai:MAC address') },
|
|
60
|
+
{ title: t('ai:IPv4 address') },
|
|
61
|
+
{ title: t('ai:IPv6 address') },
|
|
62
|
+
{ title: t('ai:Speed') },
|
|
62
63
|
// { title: 'Vendor' }, TODO(mlibra): search HW database for humanized values
|
|
63
64
|
// { title: 'Product' },
|
|
64
65
|
];
|
|
@@ -71,6 +72,7 @@ const NICsTableRowWrapper = (props: RowWrapperProps) => (
|
|
|
71
72
|
);
|
|
72
73
|
|
|
73
74
|
const NicsTable: React.FC<NicsTableProps & WithTestID> = ({ interfaces, testId }) => {
|
|
75
|
+
const { t } = useTranslation();
|
|
74
76
|
const rows: IRow[] = interfaces
|
|
75
77
|
.sort((nicA, nicB) => nicA.name?.localeCompare(nicB.name || '') || 0)
|
|
76
78
|
.map((nic) => ({
|
|
@@ -92,12 +94,12 @@ const NicsTable: React.FC<NicsTableProps & WithTestID> = ({ interfaces, testId }
|
|
|
92
94
|
],
|
|
93
95
|
key: nic.name,
|
|
94
96
|
}));
|
|
95
|
-
|
|
97
|
+
|
|
96
98
|
return (
|
|
97
99
|
<Table
|
|
98
100
|
data-testid={testId}
|
|
99
101
|
rows={rows}
|
|
100
|
-
cells={nicsColumns}
|
|
102
|
+
cells={nicsColumns(t)}
|
|
101
103
|
variant={TableVariant.compact}
|
|
102
104
|
aria-label={t("ai:Host's network interfaces table")}
|
|
103
105
|
borders={false}
|
|
@@ -148,9 +150,9 @@ export const HostDetail = ({
|
|
|
148
150
|
|
|
149
151
|
return (
|
|
150
152
|
<Grid hasGutter>
|
|
151
|
-
<SectionTitle testId={'host-details-section'} title=
|
|
153
|
+
<SectionTitle testId={'host-details-section'} title={t('ai:Host details')} />
|
|
152
154
|
<SectionColumn>
|
|
153
|
-
<DetailItem testId={'uuid'} title=
|
|
155
|
+
<DetailItem testId={'uuid'} title={t('ai:UUID')} value={id} />
|
|
154
156
|
<DetailItem
|
|
155
157
|
testId={'manufacturer'}
|
|
156
158
|
title={t('ai:Manufacturer')}
|
|
@@ -161,7 +163,11 @@ export const HostDetail = ({
|
|
|
161
163
|
title={t('ai:Product')}
|
|
162
164
|
value={inventory.systemVendor?.productName || DASH}
|
|
163
165
|
/>
|
|
164
|
-
<DetailItem
|
|
166
|
+
<DetailItem
|
|
167
|
+
testId={'serial-number'}
|
|
168
|
+
title={t('ai:Serial number')}
|
|
169
|
+
value={rowInfo.serialNumber}
|
|
170
|
+
/>
|
|
165
171
|
</SectionColumn>
|
|
166
172
|
<SectionColumn>
|
|
167
173
|
<DetailItem
|
|
@@ -186,8 +192,8 @@ export const HostDetail = ({
|
|
|
186
192
|
/>
|
|
187
193
|
</SectionColumn>
|
|
188
194
|
<SectionColumn>
|
|
189
|
-
<DetailItem testId={'hw-type'} title=
|
|
190
|
-
<DetailItem testId={'bmc-address'} title=
|
|
195
|
+
<DetailItem testId={'hw-type'} title={t('ai:Hardware type')} value={hardwareType} />
|
|
196
|
+
<DetailItem testId={'bmc-address'} title={t('ai:BMC address')} value={bmcAddress} />
|
|
191
197
|
<DetailItem
|
|
192
198
|
testId={'boot-mode'}
|
|
193
199
|
title={t('ai:Boot mode')}
|
|
@@ -215,10 +221,7 @@ export const HostDetail = ({
|
|
|
215
221
|
updateDiskSkipFormatting={updateDiskSkipFormatting}
|
|
216
222
|
/>
|
|
217
223
|
)}
|
|
218
|
-
<SectionTitle
|
|
219
|
-
testId={'nics-section'}
|
|
220
|
-
title={`${nics.length} NIC${nics.length === 1 ? '' : 's'}`}
|
|
221
|
-
/>
|
|
224
|
+
<SectionTitle testId={'nics-section'} title={t('ai:NIC', { count: nics.length })} />
|
|
222
225
|
<GridItem>
|
|
223
226
|
<NicsTable interfaces={nics} testId={'nics-table'} />
|
|
224
227
|
</GridItem>
|
|
@@ -230,6 +230,8 @@ const HostStatus: React.FC<HostStatusProps> = ({
|
|
|
230
230
|
onEditHostname?.();
|
|
231
231
|
}, [keepOnOutsideClick, onEditHostname]);
|
|
232
232
|
|
|
233
|
+
const { t } = useTranslation();
|
|
234
|
+
|
|
233
235
|
const { title, icon, sublabel, details, noPopover } = status;
|
|
234
236
|
const titleWithProgress = getTitleWithProgress(host, status);
|
|
235
237
|
const popoverProps: WithHostStatusPopoverProps = {
|
|
@@ -251,7 +253,7 @@ const HostStatus: React.FC<HostStatusProps> = ({
|
|
|
251
253
|
{
|
|
252
254
|
<FlexItem>
|
|
253
255
|
{(autoCSR && status.key === 'added-to-existing-cluster'
|
|
254
|
-
? hostStatus.installed.icon
|
|
256
|
+
? hostStatus(t).installed.icon
|
|
255
257
|
: icon) || <UnknownIcon />}
|
|
256
258
|
</FlexItem>
|
|
257
259
|
}
|