From fad00114d035409fedfe724db5b0f9deb12b01ab Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Tue, 23 Jul 2024 10:36:55 +0800 Subject: [PATCH] filter out volume in restoring or not ready status when bulk clone volume Signed-off-by: andy.lee --- src/routes/volume/VolumeBulkActions.js | 3 ++- src/routes/volume/index.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/routes/volume/VolumeBulkActions.js b/src/routes/volume/VolumeBulkActions.js index d2fdc72e..1864d988 100644 --- a/src/routes/volume/VolumeBulkActions.js +++ b/src/routes/volume/VolumeBulkActions.js @@ -193,7 +193,8 @@ function bulkActions({ { key: 'attach', name: 'Attach', disabled() { return selectedRows.length === 0 || selectedRows.some((item) => !attachable(item)) } }, { key: 'detach', name: 'Detach', disabled() { return selectedRows.length === 0 || selectedRows.some((item) => !detachable(item)) } }, { key: 'backup', name: 'Create Backup', disabled() { return selectedRows.length === 0 || isSnapshotDisabled() || hasDoingState() || isHasStandy() || hasVolumeRestoring() || !backupTargetAvailable }, toolTip: backupTargetMessage }, - { key: 'bulkCloneVolume', name: 'Clone Volume', disabled() { return selectedRows.length === 0 } }, + { key: 'bulkCloneVolume', name: 'Clone Volume', disabled() { return selectedRows.length === 0 || selectedRows.every(item => item.standby || isRestoring(item)) } }, + ] const allDropDownActions = [ diff --git a/src/routes/volume/index.js b/src/routes/volume/index.js index e7c894af..ae80672f 100644 --- a/src/routes/volume/index.js +++ b/src/routes/volume/index.js @@ -39,6 +39,7 @@ import UpdateReplicaAutoBalanceModal from './UpdateReplicaAutoBalanceModal' import UpdateBulkDataLocality from './UpdateBulkDataLocality' import Salvage from './Salvage' import { Filter, ExpansionErrorDetail } from '../../components/index' +import { isRestoring } from './helper' import VolumeBulkActions from './VolumeBulkActions' import { getAttachHostModalProps, @@ -912,9 +913,8 @@ class Volume extends React.Component { }) }, } - const bulkCloneVolumeModalProps = { - selectedRows, + selectedRows: selectedRows.filter(item => !item.standby && !isRestoring(item)), // filter out standby and restoring volumes visible: bulkCloneVolumeVisible, diskTags, nodeTags,