diff --git a/src/models/volume.js b/src/models/volume.js
index c1fc82d3..eba125af 100755
--- a/src/models/volume.js
+++ b/src/models/volume.js
@@ -59,6 +59,8 @@ export default {
bulkUnmapMarkSnapChainRemovedModalVisible: false,
updateSnapshotDataIntegrityModalVisible: false,
updateBulkSnapshotDataIntegrityModalVisible: false,
+ updateFreezeFilesystemForSnapshotModalVisible: false,
+ updateBulkFreezeFilesystemForSnapshotModalVisible: false,
isDetachBulk: false,
changeVolumeActivate: '',
defaultPvOrPvcName: '',
@@ -102,6 +104,8 @@ export default {
updateSnapshotDataIntegrityModalKey: Math.random(),
updateBulkSnapshotDataIntegrityModalKey: Math.random(),
updateReplicaSoftAntiAffinityModalKey: Math.random(),
+ updateFreezeFilesystemForSnapshotModalKey: Math.random(),
+ updateBulkFreezeFilesystemForSnapshotModalKey: Math.random(),
socketStatus: 'closed',
sorter: getSorter('volumeList.sorter'),
customColumnList: window.__column__, // eslint-disable-line no-underscore-dangle
@@ -322,6 +326,24 @@ export default {
yield call(execAction, payload.url, payload.params)
yield put({ type: 'query' })
},
+ *updateFreezeFilesystemForSnapshot({
+ payload,
+ }, { call, put }) {
+ yield put({ type: 'hideUpdateFreezeFilesystemForSnapshotModal' })
+ yield call(execAction, payload.url, payload.params)
+ yield put({ type: 'query' })
+ },
+ *updateBulkFreezeFilesystemForSnapshot({
+ payload,
+ }, { call, put }) {
+ yield put({ type: 'hideUpdateBulkFreezeFilesystemForSnapshotModal' })
+ if (payload?.urls?.length > 0) {
+ for (let i = 0; i < payload.urls.length; i++) {
+ yield call(execAction, payload.urls[i], payload.params)
+ }
+ }
+ yield put({ type: 'query' })
+ },
*accessModeUpdate({
payload,
}, { call, put }) {
@@ -802,6 +824,18 @@ export default {
showUpdateBulkSnapshotDataIntegrityModal(state, action) {
return { ...state, ...action.payload, updateBulkSnapshotDataIntegrityModalVisible: true, updateBulkSnapshotDataIntegrityModalKey: Math.random() }
},
+ showUpdateFreezeFilesystemForSnapshotModal(state, action) {
+ return { ...state, ...action.payload, updateFreezeFilesystemForSnapshotModalVisible: true, updateFreezeFilesystemForSnapshotModalKey: Math.random() }
+ },
+ hideUpdateFreezeFilesystemForSnapshotModal(state, action) {
+ return { ...state, ...action.payload, updateFreezeFilesystemForSnapshotModalVisible: false, updateFreezeFilesystemForSnapshotModalKey: Math.random() }
+ },
+ showUpdateBulkFreezeFilesystemForSnapshotModal(state, action) {
+ return { ...state, ...action.payload, updateBulkFreezeFilesystemForSnapshotModalVisible: true, updateBulkFreezeFilesystemForSnapshotModalKey: Math.random() }
+ },
+ hideUpdateBulkFreezeFilesystemForSnapshotModal(state, action) {
+ return { ...state, ...action.payload, updateBulkFreezeFilesystemForSnapshotModalVisible: false, updateBulkFreezeFilesystemForSnapshotModalKey: Math.random() }
+ },
showUpdateAccessMode(state, action) {
return { ...state, ...action.payload, updateAccessModeModalVisible: true, updateAccessModeModalKey: Math.random() }
},
diff --git a/src/routes/volume/CreateVolume.js b/src/routes/volume/CreateVolume.js
index c5cd6f6a..cbd60705 100644
--- a/src/routes/volume/CreateVolume.js
+++ b/src/routes/volume/CreateVolume.js
@@ -389,6 +389,15 @@ const modal = ({
)}
}
+
+ {getFieldDecorator('freezeFilesystemForSnapshot', {
+ initialValue: 'ignored',
+ })()}
+
{getFieldDecorator('revisionCounterDisabled', {
valuePropName: 'checked',
diff --git a/src/routes/volume/UpdateBulkFreezeFilesystemForSnapshotModal.js b/src/routes/volume/UpdateBulkFreezeFilesystemForSnapshotModal.js
new file mode 100644
index 00000000..2f657025
--- /dev/null
+++ b/src/routes/volume/UpdateBulkFreezeFilesystemForSnapshotModal.js
@@ -0,0 +1,82 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+import { Form, Select, Alert } from 'antd'
+import { ModalBlur } from '../../components'
+const FormItem = Form.Item
+const { Option } = Select
+
+const formItemLayout = {
+ labelCol: {
+ span: 24,
+ },
+ wrapperCol: {
+ span: 24,
+ },
+}
+
+const modal = ({
+ items,
+ option,
+ visible,
+ onCancel,
+ onOk,
+ form: {
+ getFieldDecorator,
+ validateFields,
+ getFieldsValue,
+ },
+}) => {
+ function handleOk() {
+ validateFields((errors) => {
+ if (errors) {
+ return
+ }
+ const data = {
+ ...getFieldsValue(),
+ }
+ const urls = items.map((item) => item?.actions?.updateFreezeFilesystemForSnapshot)
+
+ onOk(data, urls)
+ })
+ }
+
+ const modalOpts = {
+ title: 'Update Freeze Filesystem For Snapshot',
+ visible,
+ onCancel,
+ width: 600,
+ onOk: handleOk,
+ }
+ if (!items || items?.length === 0) {
+ return null
+ }
+ return (
+
+
+
+ )
+}
+
+modal.propTypes = {
+ form: PropTypes.object.isRequired,
+ visible: PropTypes.bool,
+ option: PropTypes.array,
+ onCancel: PropTypes.func,
+ items: PropTypes.array,
+ onOk: PropTypes.func,
+}
+
+export default Form.create()(modal)
diff --git a/src/routes/volume/UpdateBulkSnapshotDataIntegrityModal.js b/src/routes/volume/UpdateBulkSnapshotDataIntegrityModal.js
index eb226ed7..70cb900c 100644
--- a/src/routes/volume/UpdateBulkSnapshotDataIntegrityModal.js
+++ b/src/routes/volume/UpdateBulkSnapshotDataIntegrityModal.js
@@ -67,7 +67,7 @@ const modal = ({
)}
diff --git a/src/routes/volume/UpdateBulkUnmapMarkSnapChainRemovedModal.js b/src/routes/volume/UpdateBulkUnmapMarkSnapChainRemovedModal.js
index 0fdba121..90a9977d 100644
--- a/src/routes/volume/UpdateBulkUnmapMarkSnapChainRemovedModal.js
+++ b/src/routes/volume/UpdateBulkUnmapMarkSnapChainRemovedModal.js
@@ -61,7 +61,7 @@ const modal = ({
)}
diff --git a/src/routes/volume/UpdateFreezeFilesystemForSnapshotModal.js b/src/routes/volume/UpdateFreezeFilesystemForSnapshotModal.js
new file mode 100644
index 00000000..196a68e8
--- /dev/null
+++ b/src/routes/volume/UpdateFreezeFilesystemForSnapshotModal.js
@@ -0,0 +1,82 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+import { Form, Select, Alert } from 'antd'
+import { ModalBlur } from '../../components'
+const FormItem = Form.Item
+const { Option } = Select
+
+const formItemLayout = {
+ labelCol: {
+ span: 24,
+ },
+ wrapperCol: {
+ span: 24,
+ },
+}
+
+const modal = ({
+ item,
+ option,
+ visible,
+ onCancel,
+ onOk,
+ form: {
+ getFieldDecorator,
+ validateFields,
+ getFieldsValue,
+ },
+}) => {
+ function handleOk() {
+ validateFields((errors) => {
+ if (errors) {
+ return
+ }
+ const data = {
+ ...getFieldsValue(),
+ }
+ let url = item?.actions?.updateFreezeFilesystemForSnapshot
+
+ onOk(data, url)
+ })
+ }
+
+ const modalOpts = {
+ title: 'Update Freeze Filesystem For Snapshot',
+ visible,
+ onCancel,
+ width: 600,
+ onOk: handleOk,
+ }
+ if (!item) {
+ return null
+ }
+ return (
+
+
+
+ )
+}
+
+modal.propTypes = {
+ form: PropTypes.object.isRequired,
+ visible: PropTypes.bool,
+ option: PropTypes.array,
+ onCancel: PropTypes.func,
+ item: PropTypes.object,
+ onOk: PropTypes.func,
+}
+
+export default Form.create()(modal)
diff --git a/src/routes/volume/UpdateSnapshotDataIntegrityModal.js b/src/routes/volume/UpdateSnapshotDataIntegrityModal.js
index 0b5c4734..8c03bd24 100644
--- a/src/routes/volume/UpdateSnapshotDataIntegrityModal.js
+++ b/src/routes/volume/UpdateSnapshotDataIntegrityModal.js
@@ -60,7 +60,7 @@ const modal = ({
)}
diff --git a/src/routes/volume/UpdateUnmapMarkSnapChainRemovedModal.js b/src/routes/volume/UpdateUnmapMarkSnapChainRemovedModal.js
index 7b4b7ff0..0041c8cd 100644
--- a/src/routes/volume/UpdateUnmapMarkSnapChainRemovedModal.js
+++ b/src/routes/volume/UpdateUnmapMarkSnapChainRemovedModal.js
@@ -61,7 +61,7 @@ const modal = ({
)}
diff --git a/src/routes/volume/VolumeActions.js b/src/routes/volume/VolumeActions.js
index 6a276aa5..66e91c66 100644
--- a/src/routes/volume/VolumeActions.js
+++ b/src/routes/volume/VolumeActions.js
@@ -33,6 +33,7 @@ function actions({
showUpdateReplicaZoneSoftAntiAffinityModal,
showUpdateReplicaDiskSoftAntiAffinityModal,
showOfflineReplicaRebuildingModal,
+ showUpdateFreezeFilesystemForSnapshotModal,
commandKeyDown,
}) {
const deleteWranElement = (record) => {
@@ -152,6 +153,9 @@ function actions({
case 'updateOfflineReplicaRebuilding':
showOfflineReplicaRebuildingModal(record)
break
+ case 'updateFreezeFilesystemForSnapshot':
+ showUpdateFreezeFilesystemForSnapshotModal(record)
+ break
case 'trimFilesystem':
confirm({
title: 'Are you sure you want to trim the filesystem?',
@@ -225,6 +229,7 @@ function actions({
{ key: 'updateSnapshotMaxSize', name: 'Update Snapshot Max Size', disabled: false },
{ key: 'updateReplicaDiskSoftAntiAffinity', name: 'Update Replica Disk Soft Anti Affinity', disabled: false },
{ key: 'updateOfflineReplicaRebuilding', name: 'Update Offline Replica Rebuilding', disabled: false || selected.dataEngine !== 'v2' },
+ { key: 'updateFreezeFilesystemForSnapshot', name: 'Update Freeze Filesystem For Snapshot', disabled: false },
]
const availableActions = [{ key: 'backups', name: 'Backups', disabled: selected.standby || isRestoring(selected) }, { key: 'delete', name: 'Delete' }]
@@ -281,6 +286,7 @@ actions.propTypes = {
trimFilesystem: PropTypes.func,
showUpdateSnapshotDataIntegrityModal: PropTypes.func,
engineUpgradePerNodeLimit: PropTypes.object,
+ showUpdateFreezeFilesystemForSnapshotModal: PropTypes.func,
}
export default actions
diff --git a/src/routes/volume/VolumeBulkActions.js b/src/routes/volume/VolumeBulkActions.js
index 0a6a2d3e..02491311 100644
--- a/src/routes/volume/VolumeBulkActions.js
+++ b/src/routes/volume/VolumeBulkActions.js
@@ -32,6 +32,7 @@ function bulkActions({
showUpdateReplicaZoneSoftAntiAffinityModal,
showUpdateReplicaDiskSoftAntiAffinityModal,
showOfflineReplicaRebuildingModal,
+ showUpdateBulkFreezeFilesystemForSnapshotModal,
}) {
const deleteWranElement = (rows) => {
let workloadResources = []
@@ -136,6 +137,9 @@ function bulkActions({
case 'updateOfflineReplicaRebuilding':
showOfflineReplicaRebuildingModal(selectedRows)
break
+ case 'updateFreezeFilesystemForSnapshot':
+ showUpdateBulkFreezeFilesystemForSnapshotModal(selectedRows)
+ break
case 'trimFilesystem':
confirm({
title: `Are you sure you want to trim (${selectedRows.map(item => item.name).join(', ')}) Filesystem ?`,
@@ -203,6 +207,7 @@ function bulkActions({
{ key: 'updateReplicaDiskSoftAntiAffinity', name: 'Update Replica Disk Soft Anti Affinity', disabled() { return selectedRows.length === 0 } },
{ key: 'updateOfflineReplicaRebuilding', name: 'Update Offline Replica Rebuilding', disabled() { return selectedRows.length === 0 || selectedRows.some((item) => item.dataEngine !== 'v2') } },
{ key: 'trimFilesystem', name: 'Trim Filesystem', disabled() { return selectedRows.length === 0 || notAttached() } },
+ { key: 'updateFreezeFilesystemForSnapshot', name: 'Update Freeze Filesystem For Snapshot', disabled() { return selectedRows.length === 0 } },
]
const menu = (