mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-03 02:43:59 +08:00
### What problem does this PR solve? fix: thumbnails are too large in the chat box #818 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
c3bc72dfd9
commit
4ca176bd41
@ -15,7 +15,6 @@ import {
|
|||||||
Modal,
|
Modal,
|
||||||
Select,
|
Select,
|
||||||
Space,
|
Space,
|
||||||
Switch,
|
|
||||||
Tooltip,
|
Tooltip,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import omit from 'lodash/omit';
|
import omit from 'lodash/omit';
|
||||||
@ -23,6 +22,7 @@ import React, { useEffect, useMemo } from 'react';
|
|||||||
import { useFetchParserListOnMount } from './hooks';
|
import { useFetchParserListOnMount } from './hooks';
|
||||||
|
|
||||||
import { useTranslate } from '@/hooks/commonHooks';
|
import { useTranslate } from '@/hooks/commonHooks';
|
||||||
|
import LayoutRecognize from '../layout-recognize';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
interface IProps extends Omit<IModalManagerChildrenProps, 'showModal'> {
|
interface IProps extends Omit<IModalManagerChildrenProps, 'showModal'> {
|
||||||
@ -228,17 +228,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
|||||||
</Form.List>
|
</Form.List>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{showOne && (
|
{showOne && <LayoutRecognize></LayoutRecognize>}
|
||||||
<Form.Item
|
|
||||||
name={['parser_config', 'layout_recognize']}
|
|
||||||
label={t('layoutRecognize')}
|
|
||||||
initialValue={true}
|
|
||||||
valuePropName="checked"
|
|
||||||
tooltip={t('layoutRecognizeTip')}
|
|
||||||
>
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
)}
|
|
||||||
{showPages && (
|
{showPages && (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
noStyle
|
noStyle
|
||||||
|
19
web/src/components/layout-recognize.tsx
Normal file
19
web/src/components/layout-recognize.tsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { useTranslate } from '@/hooks/commonHooks';
|
||||||
|
import { Form, Switch } from 'antd';
|
||||||
|
|
||||||
|
const LayoutRecognize = () => {
|
||||||
|
const { t } = useTranslate('knowledgeDetails');
|
||||||
|
return (
|
||||||
|
<Form.Item
|
||||||
|
name={['parser_config', 'layout_recognize']}
|
||||||
|
label={t('layoutRecognize')}
|
||||||
|
initialValue={true}
|
||||||
|
valuePropName="checked"
|
||||||
|
tooltip={t('layoutRecognizeTip')}
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LayoutRecognize;
|
@ -6,6 +6,7 @@ import {
|
|||||||
useSubmitKnowledgeConfiguration,
|
useSubmitKnowledgeConfiguration,
|
||||||
} from './hooks';
|
} from './hooks';
|
||||||
|
|
||||||
|
import LayoutRecognize from '@/components/layout-recognize';
|
||||||
import MaxTokenNumber from '@/components/max-token-number';
|
import MaxTokenNumber from '@/components/max-token-number';
|
||||||
import { useTranslate } from '@/hooks/commonHooks';
|
import { useTranslate } from '@/hooks/commonHooks';
|
||||||
import { FormInstance } from 'antd/lib';
|
import { FormInstance } from 'antd/lib';
|
||||||
@ -99,11 +100,17 @@ const ConfigurationForm = ({ form }: { form: FormInstance }) => {
|
|||||||
const parserId = getFieldValue('parser_id');
|
const parserId = getFieldValue('parser_id');
|
||||||
|
|
||||||
if (parserId === 'naive') {
|
if (parserId === 'naive') {
|
||||||
return <MaxTokenNumber></MaxTokenNumber>;
|
return (
|
||||||
|
<>
|
||||||
|
<MaxTokenNumber></MaxTokenNumber>
|
||||||
|
<LayoutRecognize></LayoutRecognize>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
<div className={styles.buttonWrapper}>
|
<div className={styles.buttonWrapper}>
|
||||||
<Space>
|
<Space>
|
||||||
|
@ -36,6 +36,9 @@
|
|||||||
// .referenceIcon {
|
// .referenceIcon {
|
||||||
// padding: 0 6px;
|
// padding: 0 6px;
|
||||||
// }
|
// }
|
||||||
|
.thumbnailImg {
|
||||||
|
max-width: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.messageItemLeft {
|
.messageItemLeft {
|
||||||
|
@ -105,7 +105,10 @@ const MessageItem = ({
|
|||||||
<List.Item>
|
<List.Item>
|
||||||
<Flex gap={'small'} align="center">
|
<Flex gap={'small'} align="center">
|
||||||
{fileThumbnail ? (
|
{fileThumbnail ? (
|
||||||
<img src={fileThumbnail}></img>
|
<img
|
||||||
|
src={fileThumbnail}
|
||||||
|
className={styles.thumbnailImg}
|
||||||
|
></img>
|
||||||
) : (
|
) : (
|
||||||
<SvgIcon
|
<SvgIcon
|
||||||
name={`file-icon/${fileExtension}`}
|
name={`file-icon/${fileExtension}`}
|
||||||
|
@ -39,6 +39,9 @@
|
|||||||
.messageEmpty {
|
.messageEmpty {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
.thumbnailImg {
|
||||||
|
max-width: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.messageItemLeft {
|
.messageItemLeft {
|
||||||
|
@ -94,7 +94,10 @@ const MessageItem = ({
|
|||||||
<List.Item>
|
<List.Item>
|
||||||
<Flex gap={'small'} align="center">
|
<Flex gap={'small'} align="center">
|
||||||
{fileThumbnail ? (
|
{fileThumbnail ? (
|
||||||
<img src={fileThumbnail}></img>
|
<img
|
||||||
|
src={fileThumbnail}
|
||||||
|
className={styles.thumbnailImg}
|
||||||
|
></img>
|
||||||
) : (
|
) : (
|
||||||
<SvgIcon
|
<SvgIcon
|
||||||
name={`file-icon/${fileExtension}`}
|
name={`file-icon/${fileExtension}`}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user