mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix: omit long file names (#608)
### What problem does this PR solve? #607 fix: omit long file names fix: change the parsing method from tag to select fix: replace icon for new chat fix: change the OK button text of the Chat Bot API modal to close ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -28,7 +28,7 @@
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.tochunks {
|
||||
.toChunks {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@ -42,3 +42,7 @@
|
||||
cursor: help;
|
||||
writing-mode: horizontal-tb;
|
||||
}
|
||||
|
||||
.nameText {
|
||||
color: #1677ff;
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import { useSetSelectedRecord } from '@/hooks/logicHooks';
|
||||
import { useSelectParserList } from '@/hooks/userSettingHook';
|
||||
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
|
||||
import { getExtension } from '@/utils/documentUtils';
|
||||
import { Divider, Flex, Switch, Table } from 'antd';
|
||||
import { Divider, Flex, Switch, Table, Typography } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import CreateFileModal from './create-file-modal';
|
||||
@ -31,6 +31,8 @@ import FileUploadModal from '@/components/file-upload-modal';
|
||||
import { formatDate } from '@/utils/date';
|
||||
import styles from './index.less';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
const KnowledgeFile = () => {
|
||||
const data = useSelectDocumentList();
|
||||
const { fetchDocumentList } = useFetchDocumentListOnMount();
|
||||
@ -80,7 +82,7 @@ const KnowledgeFile = () => {
|
||||
key: 'name',
|
||||
fixed: 'left',
|
||||
render: (text: any, { id, thumbnail, name }) => (
|
||||
<div className={styles.tochunks} onClick={() => toChunk(id)}>
|
||||
<div className={styles.toChunks} onClick={() => toChunk(id)}>
|
||||
<Flex gap={10} align="center">
|
||||
{thumbnail ? (
|
||||
<img className={styles.img} src={thumbnail} alt="" />
|
||||
@ -90,7 +92,9 @@ const KnowledgeFile = () => {
|
||||
width={24}
|
||||
></SvgIcon>
|
||||
)}
|
||||
{text}
|
||||
<Text ellipsis={{ tooltip: text }} className={styles.nameText}>
|
||||
{text}
|
||||
</Text>
|
||||
</Flex>
|
||||
</div>
|
||||
),
|
||||
|
||||
@ -218,7 +218,13 @@ const model: DvaModel<KFModelState> = {
|
||||
});
|
||||
|
||||
const { data } = yield call(kbService.document_upload, formData);
|
||||
if (data.retcode === 0 || data.retcode === 500) {
|
||||
|
||||
const succeed = data.retcode === 0;
|
||||
|
||||
if (succeed) {
|
||||
message.success(i18n.t('message.uploaded'));
|
||||
}
|
||||
if (succeed || data.retcode === 500) {
|
||||
yield put({
|
||||
type: 'getKfList',
|
||||
payload: { kb_id: payload.kb_id },
|
||||
|
||||
@ -93,22 +93,26 @@ const ParsingActionCell = ({
|
||||
<EditOutlined size={20} />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Button
|
||||
type="text"
|
||||
disabled={isRunning}
|
||||
onClick={onRmDocument}
|
||||
className={styles.iconButton}
|
||||
>
|
||||
<DeleteOutlined size={20} />
|
||||
</Button>
|
||||
<Button
|
||||
type="text"
|
||||
disabled={isRunning}
|
||||
onClick={onDownloadDocument}
|
||||
className={styles.iconButton}
|
||||
>
|
||||
<DownloadOutlined size={20} />
|
||||
</Button>
|
||||
<Tooltip title={t('delete', { keyPrefix: 'common' })}>
|
||||
<Button
|
||||
type="text"
|
||||
disabled={isRunning}
|
||||
onClick={onRmDocument}
|
||||
className={styles.iconButton}
|
||||
>
|
||||
<DeleteOutlined size={20} />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title={t('download', { keyPrefix: 'common' })}>
|
||||
<Button
|
||||
type="text"
|
||||
disabled={isRunning}
|
||||
onClick={onDownloadDocument}
|
||||
className={styles.iconButton}
|
||||
>
|
||||
<DownloadOutlined size={20} />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Space>
|
||||
);
|
||||
};
|
||||
|
||||
@ -73,6 +73,7 @@ const ChatOverviewModal = ({
|
||||
cancelButtonProps={{ style: { display: 'none' } }}
|
||||
onOk={hideModal}
|
||||
width={'100vw'}
|
||||
okText={t('close', { keyPrefix: 'common' })}
|
||||
>
|
||||
<Flex vertical gap={'middle'}>
|
||||
<Card title={t('backendServiceApi')}>
|
||||
|
||||
@ -4,7 +4,7 @@ import {
|
||||
CloudOutlined,
|
||||
DeleteOutlined,
|
||||
EditOutlined,
|
||||
FormOutlined,
|
||||
PlusOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import {
|
||||
Avatar,
|
||||
@ -157,7 +157,7 @@ const Chat = () => {
|
||||
onClick: handleCreateTemporaryConversation,
|
||||
label: (
|
||||
<Space>
|
||||
<EditOutlined />
|
||||
<PlusOutlined />
|
||||
{t('newChat')}
|
||||
</Space>
|
||||
),
|
||||
@ -293,7 +293,8 @@ const Chat = () => {
|
||||
<Tag>{conversationList.length}</Tag>
|
||||
</Space>
|
||||
<Dropdown menu={{ items }}>
|
||||
<FormOutlined />
|
||||
{/* <FormOutlined /> */}
|
||||
<PlusOutlined />
|
||||
</Dropdown>
|
||||
</Flex>
|
||||
<Divider></Divider>
|
||||
|
||||
Reference in New Issue
Block a user