Skip to content

Commit

Permalink
filter out volume in restoring or not ready status when bulk clone vo…
Browse files Browse the repository at this point in the history
…lume

Signed-off-by: andy.lee <andy.lee@suse.com>
  • Loading branch information
a110605 committed Jul 23, 2024
1 parent 1a660be commit fad0011
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/routes/volume/VolumeBulkActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
4 changes: 2 additions & 2 deletions src/routes/volume/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit fad0011

Please sign in to comment.