Skip to content

Commit

Permalink
remove encrypted option in restore and create DR volume modals
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <andy.lee@suse.com>
  • Loading branch information
a110605 committed Jun 4, 2024
1 parent f7b95d3 commit 02650da
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 62 deletions.
25 changes: 1 addition & 24 deletions src/routes/backup/BulkCreateStandbyVolumeModal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import { Form, InputNumber, Select, Spin, Tabs, Button, Input, Checkbox } from 'antd'
import { Form, InputNumber, Select, Spin, Tabs, Button, Input } from 'antd'
import { ModalBlur } from '../../components'
import { formatMib } from '../../utils/formatter'

Expand Down Expand Up @@ -44,7 +44,6 @@ const modal = ({
dataEngine: 'v1',
accessMode: i.accessMode || null,
backingImage: i.backingImage,
encrypted: false,
nodeSelector: [],
diskSelector: [],
}))
Expand Down Expand Up @@ -91,7 +90,6 @@ const modal = ({
dataEngine: nextConfig.dataEngine,
accessMode: nextConfig.accessMode,
backingImage: nextConfig.backingImage,
encrypted: nextConfig.encrypted,
nodeSelector: nextConfig.nodeSelector,
diskSelector: nextConfig.diskSelector,
})
Expand All @@ -112,26 +110,11 @@ const modal = ({
dataEngine: prevConfig.dataEngine,
accessMode: prevConfig.accessMode,
backingImage: prevConfig.backingImage,
encrypted: prevConfig.encrypted,
nodeSelector: prevConfig.nodeSelector,
diskSelector: prevConfig.diskSelector,
})
}

const handleEncryptedCheck = (e) => {
const isChecked = e.target.checked
setDrVolumeConfigs(prev => {
const newConfigs = [...prev]
const data = {
...getFieldsValue(),
encrypted: isChecked,
name: getFieldValue('name')?.trimLeftAndRight() || '',
}
newConfigs.splice(currentTab, 1, data)
return newConfigs
})
}

const handleFieldChange = () => {
setDrVolumeConfigs(prev => {
const newConfigs = [...prev]
Expand Down Expand Up @@ -244,12 +227,6 @@ const modal = ({
{ backingImages.map(backingImage => <Option key={backingImage.name} value={backingImage.name}>{backingImage.name}</Option>) }
</Select>)}
</FormItem>
<FormItem label="Encrypted" {...formItemLayout}>
{getFieldDecorator('encrypted', {
valuePropName: 'checked',
initialValue: item.encrypted || false,
})(<Checkbox onChange={handleEncryptedCheck} />)}
</FormItem>
<Spin spinning={tagsLoading}>
<FormItem label="Node Tag" hasFeedback {...formItemLayout}>
{getFieldDecorator('nodeSelector', {
Expand Down
26 changes: 1 addition & 25 deletions src/routes/backup/BulkRestoreBackupModal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import { Form, Input, InputNumber, Checkbox, Spin, Select, Popover, Alert, Tabs, Button } from 'antd'
import { Form, Input, InputNumber, Spin, Select, Popover, Alert, Tabs, Button } from 'antd'
import { ModalBlur } from '../../components'

const TabPane = Tabs.TabPane
Expand Down Expand Up @@ -43,7 +43,6 @@ const modal = ({
accessMode: i.accessMode || null,
latestBackup: i.backupName,
backingImage: i.backingImage,
encrypted: false,
restoreVolumeRecurringJob: 'ignored',
nodeSelector: [],
diskSelector: [],
Expand Down Expand Up @@ -85,7 +84,6 @@ const modal = ({
accessMode: nextConfig.accessMode,
latestBackup: nextConfig.latestBackup,
backingImage: nextConfig.backingImage,
encrypted: nextConfig.encrypted,
restoreVolumeRecurringJob: nextConfig.restoreVolumeRecurringJob,
nodeSelector: nextConfig.nodeSelector,
diskSelector: nextConfig.diskSelector,
Expand All @@ -96,21 +94,6 @@ const modal = ({
})
}

const handleEncryptedCheck = (e) => {
const isChecked = e.target.checked
setRestoreBackupConfigs(prev => {
const newConfigs = [...prev]
const data = {
...getFieldsValue(),
encrypted: isChecked,
name: getFieldValue('name')?.trimLeftAndRight() || '',
fromBackup: items[currentTab]?.fromBackup || '',
}
newConfigs.splice(currentTab, 1, data)
return newConfigs
})
}

const handleFieldChange = () => {
setRestoreBackupConfigs(prev => {
const newConfigs = [...prev]
Expand All @@ -135,7 +118,6 @@ const modal = ({
accessMode: prevConfig.accessMode,
latestBackup: prevConfig.latestBackup,
backingImage: prevConfig.backingImage,
encrypted: prevConfig.encrypted,
restoreVolumeRecurringJob: prevConfig.restoreVolumeRecurringJob,
nodeSelector: prevConfig.nodeSelector,
diskSelector: prevConfig.diskSelector,
Expand Down Expand Up @@ -249,12 +231,6 @@ const modal = ({
{ backingImages.map(backingImage => <Option key={backingImage.name} value={backingImage.name}>{backingImage.name}</Option>) }
</Select>)}
</FormItem>
<FormItem label="Encrypted" {...formItemLayout}>
{getFieldDecorator('encrypted', {
valuePropName: 'checked',
initialValue: item.encrypted || false,
})(<Checkbox onChange={handleEncryptedCheck} />)}
</FormItem>
<FormItem label="Restore Volume Recurring Job" hasFeedback {...formItemLayout}>
{getFieldDecorator('restoreVolumeRecurringJob', {
initialValue: 'ignored',
Expand Down
8 changes: 1 addition & 7 deletions src/routes/backup/CreateStandbyVolumeModal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Form, Input, InputNumber, Select, Spin, Checkbox, Alert, Popover } from 'antd'
import { Form, Input, InputNumber, Select, Spin, Alert, Popover } from 'antd'
import { ModalBlur } from '../../components'
import { formatMib } from '../../utils/formatter'

Expand Down Expand Up @@ -167,12 +167,6 @@ const modal = ({
{ backingImages.map(backingImage => <Option key={backingImage.name} value={backingImage.name}>{backingImage.name}</Option>) }
</Select>)}
</FormItem>
<FormItem label="Encrypted" {...formItemLayout}>
{getFieldDecorator('encrypted', {
valuePropName: 'encrypted',
initialValue: false,
})(<Checkbox />)}
</FormItem>
<Spin spinning={tagsLoading}>
<FormItem label="Node Tag" hasFeedback {...formItemLayout}>
{getFieldDecorator('nodeSelector', {
Expand Down
6 changes: 0 additions & 6 deletions src/routes/backup/RestoreBackupModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ const modal = ({
{ backingImages.map(backingImage => <Option key={backingImage.name} value={backingImage.name}>{backingImage.name}</Option>) }
</Select>)}
</FormItem>
<FormItem label="Encrypted" {...formItemLayout}>
{getFieldDecorator('encrypted', {
valuePropName: 'encrypted',
initialValue: false,
})(<Checkbox></Checkbox>)}
</FormItem>
<FormItem label="Restore Volume Recurring Job" hasFeedback {...formItemLayout}>
{getFieldDecorator('restoreVolumeRecurringJob', {
initialValue: 'ignored',
Expand Down

0 comments on commit 02650da

Please sign in to comment.