Skip to content

feat(): add tenant backup destType #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 19, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 59 additions & 1 deletion ui/src/pages/Tenant/Detail/NewBackup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ export default function NewBackup() {
const scheduleValue = Form.useWatch(['scheduleDates'], form);

const distType = [
{ label: 'OSS', value: 'OSS' },
{ label: 'NFS', value: 'NFS' },
{ label: 'OSS', value: 'OSS' },
{ label: 'COS', value: 'COS' },
{ label: 'S3', value: 'S3' },
{ label: 'S3-Compatible', value: 'S3-Compatible' },
];

const handleSubmit = async (values: API.NewBackupForm) => {
Expand Down Expand Up @@ -250,6 +253,61 @@ export default function NewBackup() {
/>
</Form.Item>
</Col>

<Form.Item noStyle dependencies={['destType']}>
{({ getFieldValue }) => {
if (getFieldValue(['destType']) === 'COS') {
return (
<Col span={8}>
<Form.Item
label="AppID"
name={['appID']}
rules={[
{
required: true,
message: '请输入AppID',
},
]}
>
<Password
placeholder={intl.formatMessage({
id: 'Dashboard.Detail.NewBackup.PleaseEnter',
defaultMessage: '请输入',
})}
/>
</Form.Item>
</Col>
);
}
}}
</Form.Item>
<Form.Item noStyle dependencies={['destType']}>
{({ getFieldValue }) => {
if (getFieldValue(['destType']) === 'S3') {
return (
<Col span={8}>
<Form.Item
label="Region"
name={['Region']}
rules={[
{
required: true,
message: '请输入 Region',
},
]}
>
<Password
placeholder={intl.formatMessage({
id: 'Dashboard.Detail.NewBackup.PleaseEnter',
defaultMessage: '请输入',
})}
/>
</Form.Item>
</Col>
);
}
}}
</Form.Item>
</Row>
</Col>
<Col span={12}>
Expand Down