-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MGMT-19152: Add network bonding configuration in the UI (#2683)
* Add network bonding configuration in the UI * Add networking bonding configuration in the UI * Adjusting code * mend * Change bonds help text * Adjusting form view validations * Adjusting code from review comments * Validate across all MAC addresses and not differentiate between primary and secondary ones * When 'Use bond' is check we shouldn't have the extra mac-address field * Changes in getHostValidationSchema * Change collapsed view host in networking configuration
- Loading branch information
Showing
13 changed files
with
371 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ponents/clusterConfiguration/staticIp/components/FormViewHosts/BondsConfirmationModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import * as React from 'react'; | ||
import { | ||
Button, | ||
ButtonVariant, | ||
Modal, | ||
ModalBoxBody, | ||
ModalBoxFooter, | ||
Stack, | ||
StackItem, | ||
} from '@patternfly/react-core'; | ||
|
||
import { useTranslation } from '../../../../../../common/hooks/use-translation-wrapper'; | ||
|
||
type BondDeleteModalModalProps = { | ||
isOpen: boolean; | ||
onConfirm: VoidFunction; | ||
onCancel: VoidFunction; | ||
}; | ||
|
||
const BondDeleteModalModal = ({ isOpen, onConfirm, onCancel }: BondDeleteModalModalProps) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Modal | ||
aria-label={t('ai:Remove bond dialog')} | ||
title={t('ai:Remove bond?')} | ||
isOpen={isOpen} | ||
onClose={onCancel} | ||
hasNoBodyWrapper | ||
id="remove-bond-modal" | ||
variant="medium" | ||
titleIconVariant="warning" | ||
> | ||
<ModalBoxBody> | ||
<Stack hasGutter> | ||
<StackItem>{t('ai:The bond associated with the host will be removed.')}</StackItem> | ||
</Stack> | ||
</ModalBoxBody> | ||
<ModalBoxFooter> | ||
<Button onClick={onConfirm} variant={ButtonVariant.danger}> | ||
{t('ai:Remove bond')} | ||
</Button> | ||
<Button onClick={onCancel} variant={ButtonVariant.secondary}> | ||
{t('ai:Cancel')} | ||
</Button> | ||
</ModalBoxFooter> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default BondDeleteModalModal; |
35 changes: 35 additions & 0 deletions
35
...lib/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/BondsSelect.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { SelectFieldProps } from '../../../../../../common/components/ui/formik/types'; | ||
import { SelectField } from '../../../../../../common'; | ||
|
||
type BondsSelectProps = { | ||
onChange?: SelectFieldProps['onChange']; | ||
name: string; | ||
}; | ||
|
||
const bondsList = [ | ||
{ value: 'balance-rr', label: 'Balance-rr (0)', default: false }, | ||
{ value: 'active-backup', label: 'Active-Backup (1)', default: true }, | ||
{ value: 'balance-xor', label: 'Balance-xor (2)', default: false }, | ||
{ value: 'broadcast', label: 'Broadcast (3)', default: false }, | ||
{ value: '802.3ad', label: '802.3ad (4)', default: false }, | ||
{ value: 'balance-tlb', label: 'Balance-tlb (5)', default: false }, | ||
{ value: 'balance-alb', label: 'Balance-alb (6)', default: false }, | ||
]; | ||
const BondsSelect: React.FC<BondsSelectProps> = ({ onChange, name }) => { | ||
const selectOptions = bondsList.map((version) => ({ | ||
label: version.label, | ||
value: version.value, | ||
})); | ||
return ( | ||
<SelectField | ||
name={name} | ||
label="Bond type" | ||
options={selectOptions} | ||
isRequired | ||
onChange={onChange} | ||
/> | ||
); | ||
}; | ||
|
||
export default BondsSelect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.