diff --git a/src/fireedge/src/client/components/Forms/Vm/AttachNicForm/Steps/AdvancedOptions/schema.js b/src/fireedge/src/client/components/Forms/Vm/AttachNicForm/Steps/AdvancedOptions/schema.js index 398eaed396..3fa7374ccf 100644 --- a/src/fireedge/src/client/components/Forms/Vm/AttachNicForm/Steps/AdvancedOptions/schema.js +++ b/src/fireedge/src/client/components/Forms/Vm/AttachNicForm/Steps/AdvancedOptions/schema.js @@ -66,9 +66,13 @@ const fillPCIAtributes = /** * @param {object} [data] - VM or VM Template data * @param {boolean} [data.isAlias] - If it's an alias + * @param {boolean} [data.disableNetworkAutoMode] - Disable the switch to enable network auto mode * @returns {Field[]} List of general fields */ -const GENERAL_FIELDS = ({ isAlias = false } = {}) => +const GENERAL_FIELDS = ({ + isAlias = false, + disableNetworkAutoMode = false, +} = {}) => [ isAlias && { name: 'EXTERNAL', @@ -78,26 +82,27 @@ const GENERAL_FIELDS = ({ isAlias = false } = {}) => validation: boolean().yesOrNo(), grid: { sm: 6 }, }, - !isAlias && { - name: 'NETWORK_MODE', - label: T.AutomaticNetworkMode, - tooltip: T.NetworkMoeConcept, - type: INPUT_TYPES.SWITCH, - validation: boolean() - .yesOrNo() - .afterSubmit((value) => (value ? 'auto' : '')), - grid: { sm: 6 }, - stepControl: [ - { - condition: (value) => value === true, - steps: ['network'], - }, - { - condition: (value) => value === false, - steps: ['network-auto'], - }, - ], - }, + !isAlias && + !disableNetworkAutoMode && { + name: 'NETWORK_MODE', + label: T.AutomaticNetworkMode, + tooltip: T.NetworkMoeConcept, + type: INPUT_TYPES.SWITCH, + validation: boolean() + .yesOrNo() + .afterSubmit((value) => (value ? 'auto' : '')), + grid: { sm: 6 }, + stepControl: [ + { + condition: (value) => value === true, + steps: ['network'], + }, + { + condition: (value) => value === false, + steps: ['network-auto'], + }, + ], + }, ].filter(Boolean) const GUACAMOLE_CONNECTIONS = [ @@ -640,6 +645,7 @@ const GUEST_FIELDS = [ * @param {boolean} [data.hasAlias] - If has an alias * @param {boolean} [data.isPci] - If it's a PCI * @param {boolean} [data.isAlias] - If it's an alias + * @param {boolean} [data.disableNetworkAutoMode] - Disable the switch to enable network auto mode * @returns {Section[]} Sections */ const SECTIONS = ({ @@ -652,6 +658,7 @@ const SECTIONS = ({ hasAlias, isPci, isAlias, + disableNetworkAutoMode, } = {}) => { const filters = { driver, hypervisor } @@ -663,7 +670,13 @@ const SECTIONS = ({ legend: T.General, fields: disableFields( filterByHypAndDriver( - GENERAL_FIELDS({ nics, hasAlias, isPci, isAlias }), + GENERAL_FIELDS({ + nics, + hasAlias, + isPci, + isAlias, + disableNetworkAutoMode, + }), filters ), 'NIC', diff --git a/src/fireedge/src/client/components/Tabs/Vm/Network/Actions.js b/src/fireedge/src/client/components/Tabs/Vm/Network/Actions.js index 2aa391a9f4..2d7e7616fd 100644 --- a/src/fireedge/src/client/components/Tabs/Vm/Network/Actions.js +++ b/src/fireedge/src/client/components/Tabs/Vm/Network/Actions.js @@ -51,6 +51,7 @@ const AttachAction = memo( hasAlias, isPci, isAlias, + disableNetworkAutoMode, }) => { const { setFieldPath } = useGeneralApi() const disableSteps = useDisableStep() @@ -99,6 +100,7 @@ const AttachAction = memo( isPci, isAlias, disableSteps, + disableNetworkAutoMode, }, initialValues: nic, }) @@ -388,6 +390,7 @@ const ActionPropTypes = { methods: PropTypes.object, index: PropTypes.number, indexNicAlias: PropTypes.number, + disableNetworkAutoMode: PropTypes.bool, } AttachAction.propTypes = ActionPropTypes diff --git a/src/fireedge/src/client/components/Tabs/Vm/Network/index.js b/src/fireedge/src/client/components/Tabs/Vm/Network/index.js index 5618b7be75..b7fb7ea706 100644 --- a/src/fireedge/src/client/components/Tabs/Vm/Network/index.js +++ b/src/fireedge/src/client/components/Tabs/Vm/Network/index.js @@ -157,6 +157,7 @@ const VmNetworkTab = ({ oneConfig={oneConfig} adminGroup={adminGroup} onSubmit={handleAttach} + disableNetworkAutoMode={true} /> )}