fix: #209 after saving the knowledge base configuration, jump to the dataset page (#212)

### What problem does this PR solve?
fix: #209 after saving the knowledge base configuration, jump to the
dataset page
feat: translate ConfigurationForm
feat: translate KnowledgeTesting
feat: translate document list page
feat: translate knowledge list page

Issue link: #209

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-04-03 11:21:54 +08:00
committed by GitHub
parent 392e515c3f
commit 9b9b6d5408
19 changed files with 299 additions and 196 deletions

View File

@ -1,5 +1,6 @@
import { ReactComponent as RefreshIcon } from '@/assets/svg/refresh.svg';
import { ReactComponent as RunIcon } from '@/assets/svg/run.svg';
import { useTranslate } from '@/hooks/commonHooks';
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
import { CloseCircleOutlined } from '@ant-design/icons';
import { Badge, DescriptionsProps, Flex, Popover, Space, Tag } from 'antd';
@ -22,6 +23,8 @@ interface IProps {
}
const PopoverContent = ({ record }: IProps) => {
const { t } = useTranslate('knowledgeDetails');
const replaceText = (text: string) => {
// Remove duplicate \n
const nextText = text.replace(/(\n)\1+/g, '$1');
@ -44,17 +47,17 @@ const PopoverContent = ({ record }: IProps) => {
const items: DescriptionsProps['items'] = [
{
key: 'process_begin_at',
label: 'Process Begin At',
label: t('processBeginAt'),
children: record.process_begin_at,
},
{
key: 'process_duation',
label: 'Process Duration',
label: t('processDuration'),
children: record.process_duation,
},
{
key: 'progress_msg',
label: 'Progress Msg',
label: t('progressMsg'),
children: replaceText(record.progress_msg.trim()),
},
];