|
|
@@ -33,6 +33,7 @@ import type { Instance, InstanceScript } from '../../../@types/Instance'
|
|
|
import { TransferItemDetails } from '../../../@types/MainItem'
|
|
|
import { MinionPool } from '../../../@types/MinionPool'
|
|
|
import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from '../WizardOptions/WizardOptions'
|
|
|
+import { ProviderMigrationCloneDiskDisabledOption } from '../../../@types/Config'
|
|
|
|
|
|
const Wrapper = styled.div<any>`
|
|
|
display: flex;
|
|
|
@@ -83,6 +84,7 @@ type Props = {
|
|
|
minionPools: MinionPool[]
|
|
|
loadingInstances: boolean,
|
|
|
defaultSkipOsMorphing?: boolean | null,
|
|
|
+ disabledCloneDisk?: ProviderMigrationCloneDiskDisabledOption | null,
|
|
|
onCancelClick: () => void,
|
|
|
onMigrateClick: (
|
|
|
fields: Field[],
|
|
|
@@ -116,9 +118,20 @@ class ReplicaMigrationOptions extends React.Component<Props, State> {
|
|
|
const mappings = this.props.transferItem?.instance_osmorphing_minion_pool_mappings || {}
|
|
|
|
|
|
this.setState({
|
|
|
- fields: replicaMigrationFields.map(f => (f.name === 'skip_os_morphing' ? (
|
|
|
- { ...f, value: this.props.defaultSkipOsMorphing || null }
|
|
|
- ) : f)),
|
|
|
+ fields: replicaMigrationFields.map(f => {
|
|
|
+ if (f.name === 'skip_os_morphing') {
|
|
|
+ return { ...f, value: this.props.defaultSkipOsMorphing || null }
|
|
|
+ }
|
|
|
+ if (f.name === 'clone_disks' && this.props.disabledCloneDisk) {
|
|
|
+ return {
|
|
|
+ ...f,
|
|
|
+ disabled: true,
|
|
|
+ value: this.props.disabledCloneDisk.defaultValue,
|
|
|
+ description: this.props.disabledCloneDisk.description,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return f
|
|
|
+ }),
|
|
|
minionPoolMappings: { ...mappings },
|
|
|
})
|
|
|
}
|
|
|
@@ -200,7 +213,8 @@ class ReplicaMigrationOptions extends React.Component<Props, State> {
|
|
|
layout="page"
|
|
|
label={field.label || LabelDictionary.get(field.name)}
|
|
|
onChange={value => this.handleValueChange(field, value)}
|
|
|
- description={LabelDictionary.getDescription(field.name)}
|
|
|
+ description={field.description || LabelDictionary.getDescription(field.name)}
|
|
|
+ disabled={field.disabled}
|
|
|
/>
|
|
|
)
|
|
|
}
|