Skip to content

Commit

Permalink
add backupMode in volume/bulkBackup payload
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <andy.lee@suse.com>
  • Loading branch information
a110605 authored and derekbit committed Jul 8, 2024
1 parent 546becd commit cb55d2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 10 additions & 2 deletions src/models/volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,15 @@ export default {
*bulkBackup({
payload,
}, { put }) {
yield payload.actions.map(item => put({ type: 'snapshotCreateThenBackup', payload: { snapshotCreateUrl: item.snapshotCreateUrl, snapshotBackupUrl: item.snapshotBackupUrl, labels: payload.labels } }))
yield payload.actions.map(item => put({
type: 'snapshotCreateThenBackup',
payload: {
snapshotCreateUrl: item.snapshotCreateUrl,
snapshotBackupUrl: item.snapshotBackupUrl,
labels: payload.labels,
backupMode: payload.backupMode,
},
}))
yield put({ type: 'query' })
},
*createPVAndPVC({
Expand Down Expand Up @@ -571,7 +579,7 @@ export default {
payload,
}, { call }) {
const snapshot = yield call(execAction, payload.snapshotCreateUrl, {})
yield call(execAction, payload.snapshotBackupUrl, { name: snapshot.name, labels: payload.labels })
yield call(execAction, payload.snapshotBackupUrl, { name: snapshot.name, labels: payload.labels, backupMode: payload.backupMode })
},
*createRecurringJob({
payload,
Expand Down
7 changes: 1 addition & 6 deletions src/routes/volume/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,6 @@ class Volume extends React.Component {
})
},
bulkBackup(actions) {
// bulkBackup(actions.map(item => { return { snapshotCreateUrl: item.actions.snapshotCreate, snapshotBackupUrl: item.actions.snapshotBackup } }))
// dispatch({
// type: 'volume/bulkBackup',
// payload: actions,
// })
me.setState({
...me.state,
createBackModalKey: Math.random(),
Expand Down Expand Up @@ -1189,7 +1184,7 @@ class Volume extends React.Component {
type: 'volume/bulkBackup',
payload: {
actions: me.state.selectedRows.map(item => { return { snapshotCreateUrl: item.actions.snapshotCreate, snapshotBackupUrl: item.actions.snapshotBackup } }),
labels: obj,
...obj,
},
})
me.setState({
Expand Down

0 comments on commit cb55d2b

Please sign in to comment.