diff --git a/web/locales/zh/common.ts b/web/locales/zh/common.ts index 50743647d..083f129f8 100644 --- a/web/locales/zh/common.ts +++ b/web/locales/zh/common.ts @@ -95,7 +95,7 @@ export const CommonZh: Resources["translation"] = { Password: "密码", Remark: "备注", Edit: "编辑", - Database: "数据库", + Database: "数据源", Data_Source: "数据中心", Close_Sidebar: "收起", Show_Sidebar: "展开", diff --git a/web/pages/construct/database.tsx b/web/pages/construct/database.tsx index 6e7cfe609..f400d50ea 100644 --- a/web/pages/construct/database.tsx +++ b/web/pages/construct/database.tsx @@ -3,12 +3,13 @@ import ConstructLayout from '@/new-components/layout/Construct'; import { ChatContext } from '@/app/chat-context'; import { apiInterceptors, getDbList, getDbSupportType, newDialogue, postDbDelete } from '@/client/api'; import MuiLoading from '@/components/common/loading'; +import GPTCard from '@/components/common/gpt-card'; import FormDialog from '@/components/database/form-dialog'; import { DBOption, DBType, DbListResponse, DbSupportTypeResponse, IChatDbSchema } from '@/types/db'; import { dbMapper } from '@/utils'; import { DeleteFilled, EditFilled, PlusOutlined } from '@ant-design/icons'; import { useAsyncEffect } from 'ahooks'; -import { Button, Card, Drawer, Empty, Modal, Tag, message } from 'antd'; +import { Button, Card, Drawer, Empty, Modal, Badge, message } from 'antd'; import { useRouter } from 'next/router'; import { useContext, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -152,56 +153,68 @@ function Database() { -
- {dbList.map((item) => { - let targetDBType = dbTypeList.find((i) => i?.value?.toLowerCase() === item.db_type); +
+ {dbTypeList.map((item) => { return ( - { - onDelete(item); - }} - > - {t('Delete_Btn')} - - ), - }, - ], - }} - /> - } - rightTopHover={false} - Tags={ -
- {item.db_type} -
- } - RightBottom={ - { - handleChat(item); - }} - /> - } - onClick={() => { - // if (targetDBType?.disabled) return; - // handleDbTypeClick(targetDBType); - onModify(item); - }} - /> + + { + if (item.disabled) return; + handleDbTypeClick(item); + }} + /> + + // { + // onDelete(item); + // }} + // > + // {t('Delete_Btn')} + // + // ), + // }, + // ], + // }} + // /> + // } + // rightTopHover={false} + // Tags={ + //
+ // {item.db_type} + //
+ // } + // RightBottom={ + // { + // handleChat(item); + // }} + // /> + // } + // onClick={() => { + // // if (targetDBType?.disabled) return; + // // handleDbTypeClick(targetDBType); + // onModify(item); + // }} + // /> ); })}