mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-27 05:47:47 +00:00
Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: ‘yanzhiyonggit config --global user.email git config --global user.name ‘yanzhiyong <zhiyong.yan@clife.cn>
57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
import { ConfigurableParams } from '@/types/common';
|
|
import { DBOption, DBType } from '@/types/db';
|
|
import { Modal } from 'antd';
|
|
import { useTranslation } from 'react-i18next';
|
|
import DatabaseForm from './database-form';
|
|
|
|
interface NewFormDialogProps {
|
|
open: boolean;
|
|
onClose: () => void;
|
|
onSuccess: () => void;
|
|
dbTypeList: DBOption[];
|
|
editValue?: string;
|
|
choiceDBType?: DBType;
|
|
getFromRenderData?: ConfigurableParams[];
|
|
dbNames?: string[];
|
|
dbTypeData?: DBOption[];
|
|
description?: string;
|
|
}
|
|
|
|
function FormDialog({
|
|
open,
|
|
onClose,
|
|
onSuccess,
|
|
dbTypeList,
|
|
editValue,
|
|
choiceDBType,
|
|
getFromRenderData,
|
|
dbNames,
|
|
description,
|
|
}: NewFormDialogProps) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<Modal
|
|
title={t(editValue ? 'edit_database' : 'add_database')}
|
|
open={open}
|
|
onCancel={onClose}
|
|
footer={null}
|
|
width={800}
|
|
destroyOnClose
|
|
>
|
|
<DatabaseForm
|
|
onCancel={onClose}
|
|
onSuccess={onSuccess}
|
|
dbTypeList={dbTypeList}
|
|
editValue={editValue}
|
|
choiceDBType={choiceDBType}
|
|
getFromRenderData={getFromRenderData}
|
|
dbNames={dbNames}
|
|
description={description}
|
|
/>
|
|
</Modal>
|
|
);
|
|
}
|
|
|
|
export default FormDialog;
|