fix: Separate EPUB files into dedicated book file extension category

This commit is contained in:
bfdyanshe
2025-02-15 12:12:59 +08:00
committed by 亢奋猫
parent 7a7f51d5f3
commit 50cd93cf62
2 changed files with 5 additions and 4 deletions
@@ -18,7 +18,7 @@ import { useKnowledge } from '@renderer/hooks/useKnowledge'
import FileManager from '@renderer/services/FileManager'
import { getProviderName } from '@renderer/services/ProviderService'
import { FileType, FileTypes, KnowledgeBase } from '@renderer/types'
import { documentExts, textExts } from '@shared/config/constant'
import { bookExts, documentExts, textExts } from '@shared/config/constant'
import { Alert, Button, Card, Divider, message, Tag, Tooltip, Typography, Upload } from 'antd'
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
@@ -35,7 +35,7 @@ interface KnowledgeContentProps {
selectedBase: KnowledgeBase
}
const fileTypes = [...documentExts, ...textExts]
const fileTypes = [...bookExts, ...documentExts, ...textExts]
const KnowledgeContent: FC<KnowledgeContentProps> = ({ selectedBase }) => {
const { t } = useTranslation()
@@ -217,7 +217,7 @@ const KnowledgeContent: FC<KnowledgeContentProps> = ({ selectedBase }) => {
style={{ marginTop: 10, background: 'transparent' }}>
<p className="ant-upload-text">{t('knowledge.drag_file')}</p>
<p className="ant-upload-hint">
{t('knowledge.file_hint', { file_types: fileTypes.slice(0, 5).join(', ').replaceAll('.', '') })}
{t('knowledge.file_hint', { file_types: fileTypes.slice(0, 6).join(', ').replaceAll('.', '') })}
</p>
</Dragger>
</FileSection>