diff --git a/src/routes/backingImage/BackingImageList.js b/src/routes/backingImage/BackingImageList.js index f32c613d..89d29332 100644 --- a/src/routes/backingImage/BackingImageList.js +++ b/src/routes/backingImage/BackingImageList.js @@ -22,19 +22,6 @@ function list({ loading, dataSource, deleteBackingImage, showDiskStateMapDetail, ) } - if (Object.values(record.diskFileStatusMap).length > 0 - && Object.values(record.diskFileStatusMap).some((diskStatus) => ['starting', 'pending', 'in-progress', 'ready-for-transfer'].includes(diskStatus.state))) { - // some creating states - const state = Object.values(record.diskFileStatusMap)[0]?.state || '' - const percentage = Object.values(record.diskFileStatusMap)[0]?.progress?.toString() || '' - return ( - - - {percentage && {`${percentage} %`}} - - ) - } - return '' } diff --git a/src/routes/backingImage/CreateBackingImage.js b/src/routes/backingImage/CreateBackingImage.js index 4ed425ef..10f0a295 100644 --- a/src/routes/backingImage/CreateBackingImage.js +++ b/src/routes/backingImage/CreateBackingImage.js @@ -1,7 +1,8 @@ +/* eslint-disable react/jsx-props-no-spreading */ import React from 'react' import PropTypes from 'prop-types' import { Form, Input, Select, Upload, Button, Icon, InputNumber, Spin } from 'antd' -import { ModalBlur, AutoComplete } from '../../components' +import { ModalBlur } from '../../components' import { hasReadyBackingDisk } from '../../utils/status' const FormItem = Form.Item @@ -22,6 +23,9 @@ const genDataFromType = (type, getFieldValue) => { const payload = { name: getFieldValue('name'), sourceType: getFieldValue('sourceType'), + minNumberOfCopies: getFieldValue('minNumberOfCopies'), + diskSelector: getFieldValue('diskSelector'), + nodeSelector: getFieldValue('nodeSelector'), } switch (type) { @@ -110,16 +114,6 @@ const modal = ({ }, } - - const autoCompleteProps = { - options: volumeNameOptions, - autoCompleteChange: (value) => { - setFieldsValue({ - volumeName: value, - }) - }, - } - const creationType = getFieldValue('sourceType') const availBackingImages = backingImageOptions?.filter(image => hasReadyBackingDisk(image)) || [] @@ -149,8 +143,8 @@ const modal = ({ })()} {/* Display when select type = volume */} @@ -159,27 +153,15 @@ const modal = ({ {getFieldDecorator('volumeName', { initialValue: '', - valuePropName: 'value', rules: [ { required: creationType === 'volume', - message: 'Please input volume name', - }, - { - validator: (_rule, value, callback) => { - if (creationType === 'volume') { - if (volumeNameOptions && volumeNameOptions.includes(value)) { - callback() - } else { - callback('Please select an existing Longhorn volume.') - } - } else { - callback() - } - }, + message: 'Please select an existing volume', }, ], - })()} + })()} {getFieldDecorator('exportType', { diff --git a/src/routes/backingImage/DiskStateMapDetail.js b/src/routes/backingImage/DiskStateMapDetail.js index 56b8717e..b99e7113 100644 --- a/src/routes/backingImage/DiskStateMapDetail.js +++ b/src/routes/backingImage/DiskStateMapDetail.js @@ -160,6 +160,7 @@ const modal = ({ {currentData.sourceType === 'download' && 'Download from URL'} {currentData.sourceType === 'upload' && 'Upload'} {currentData.sourceType === 'export-from-volume' && 'Export from a Longhorn volume'} + {currentData.sourceType === 'clone' && 'Clone from existing backing image'}
Parameters During Creation
diff --git a/src/routes/backingImage/index.js b/src/routes/backingImage/index.js index b5438edc..b335ff86 100644 --- a/src/routes/backingImage/index.js +++ b/src/routes/backingImage/index.js @@ -187,11 +187,6 @@ class BackingImage extends React.Component { duration: 0, }) } - params.expectedChecksum = newBackingImage.expectedChecksum - params.diskSelector = newBackingImage.diskSelector - params.nodeSelector = newBackingImage.nodeSelector - params.minNumberOfCopies = newBackingImage.minNumberOfCopies - dispatch({ type: 'backingImage/create', payload, @@ -278,6 +273,7 @@ class BackingImage extends React.Component { { value: 'download', name: 'download' }, { value: 'upload', name: 'upload' }, { value: 'export-from-volume', name: 'export-from-volume' }, + { value: 'clone', name: 'clone' }, ], onSearch(filter) { const { field: filterField, value: filterValue, createdFromValue: createdFromPropValue } = filter