mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
feat: remove loading from document table and fixed the issue where gif images could not be uploaded on the configuration page (#122)
* feat: fixed the issue where gif images could not be uploaded on the configuration page * feat: remove loading from document table
This commit is contained in:
@ -227,14 +227,6 @@ const KnowledgeFile = () => {
|
|||||||
return parserList.find((x) => x.value === text)?.label;
|
return parserList.find((x) => x.value === text)?.label;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: 'Parsing Status',
|
|
||||||
dataIndex: 'run',
|
|
||||||
key: 'run',
|
|
||||||
render: (text, record) => {
|
|
||||||
return <ParsingStatusCell record={record}></ParsingStatusCell>;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'Enabled',
|
title: 'Enabled',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
@ -250,6 +242,14 @@ const KnowledgeFile = () => {
|
|||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Parsing Status',
|
||||||
|
dataIndex: 'run',
|
||||||
|
key: 'run',
|
||||||
|
render: (text, record) => {
|
||||||
|
return <ParsingStatusCell record={record}></ParsingStatusCell>;
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Action',
|
title: 'Action',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
@ -301,7 +301,7 @@ const KnowledgeFile = () => {
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
columns={finalColumns}
|
columns={finalColumns}
|
||||||
dataSource={data}
|
dataSource={data}
|
||||||
loading={loading}
|
// loading={loading}
|
||||||
pagination={pagination}
|
pagination={pagination}
|
||||||
scroll={{ scrollToFirstRowOnChange: true, x: 1300, y: 'fill' }}
|
scroll={{ scrollToFirstRowOnChange: true, x: 1300, y: 'fill' }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -55,7 +55,7 @@ const Configuration = () => {
|
|||||||
const embeddingModelOptions = useSelectLlmOptions();
|
const embeddingModelOptions = useSelectLlmOptions();
|
||||||
|
|
||||||
const onFinish = async (values: any) => {
|
const onFinish = async (values: any) => {
|
||||||
const avatar = getBase64FromUploadFileList(values.avatar);
|
const avatar = await getBase64FromUploadFileList(values.avatar);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'kSModel/updateKb',
|
type: 'kSModel/updateKb',
|
||||||
payload: {
|
payload: {
|
||||||
@ -123,6 +123,7 @@ const Configuration = () => {
|
|||||||
<Upload
|
<Upload
|
||||||
listType="picture-card"
|
listType="picture-card"
|
||||||
maxCount={1}
|
maxCount={1}
|
||||||
|
beforeUpload={() => false}
|
||||||
showUploadList={{ showPreviewIcon: false, showRemoveIcon: false }}
|
showUploadList={{ showPreviewIcon: false, showRemoveIcon: false }}
|
||||||
>
|
>
|
||||||
<button style={{ border: 0, background: 'none' }} type="button">
|
<button style={{ border: 0, background: 'none' }} type="button">
|
||||||
@ -184,7 +185,7 @@ const Configuration = () => {
|
|||||||
{({ getFieldValue }) => {
|
{({ getFieldValue }) => {
|
||||||
const parserId = getFieldValue('parser_id');
|
const parserId = getFieldValue('parser_id');
|
||||||
|
|
||||||
if (parserId === 'general') {
|
if (parserId === 'naive') {
|
||||||
return (
|
return (
|
||||||
<Form.Item label="Chunk token number" tooltip="xxx">
|
<Form.Item label="Chunk token number" tooltip="xxx">
|
||||||
<Flex gap={20} align="center">
|
<Flex gap={20} align="center">
|
||||||
|
|||||||
@ -18,18 +18,12 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
|
|||||||
value: x,
|
value: x,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const parameters: ModelVariableType = Form.useWatch('parameters', form);
|
|
||||||
|
|
||||||
const modelOptions = useSelectLlmOptions();
|
const modelOptions = useSelectLlmOptions();
|
||||||
|
|
||||||
const handleParametersChange = (value: ModelVariableType) => {
|
const handleParametersChange = (value: ModelVariableType) => {
|
||||||
console.info(value);
|
const variable = settledModelVariableMap[value];
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const variable = settledModelVariableMap[parameters];
|
|
||||||
form.setFieldsValue({ llm_setting: variable });
|
form.setFieldsValue({ llm_setting: variable });
|
||||||
}, [parameters, form]);
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const values = Object.keys(variableEnabledFieldMap).reduce<
|
const values = Object.keys(variableEnabledFieldMap).reduce<
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
.messageText {
|
.messageText {
|
||||||
padding: 0 14px;
|
padding: 0 14px;
|
||||||
background-color: rgba(249, 250, 251, 1);
|
background-color: rgba(249, 250, 251, 1);
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
.messageEmpty {
|
.messageEmpty {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
|
|||||||
@ -45,8 +45,8 @@ const UserSettingProfile = () => {
|
|||||||
const loading = useGetUserInfoLoading();
|
const loading = useGetUserInfoLoading();
|
||||||
const { form, submittable } = useValidateSubmittable();
|
const { form, submittable } = useValidateSubmittable();
|
||||||
|
|
||||||
const onFinish = (values: any) => {
|
const onFinish = async (values: any) => {
|
||||||
const avatar = getBase64FromUploadFileList(values.avatar);
|
const avatar = await getBase64FromUploadFileList(values.avatar);
|
||||||
saveSetting({ ...values, avatar });
|
saveSetting({ ...values, avatar });
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -112,6 +112,10 @@ const UserSettingProfile = () => {
|
|||||||
<Upload
|
<Upload
|
||||||
listType="picture-card"
|
listType="picture-card"
|
||||||
maxCount={1}
|
maxCount={1}
|
||||||
|
accept="image/*"
|
||||||
|
beforeUpload={() => {
|
||||||
|
return false;
|
||||||
|
}}
|
||||||
showUploadList={{ showPreviewIcon: false, showRemoveIcon: false }}
|
showUploadList={{ showPreviewIcon: false, showRemoveIcon: false }}
|
||||||
>
|
>
|
||||||
<button style={{ border: 0, background: 'none' }} type="button">
|
<button style={{ border: 0, background: 'none' }} type="button">
|
||||||
|
|||||||
@ -46,9 +46,11 @@ export const getUploadFileListFromBase64 = (avatar: string) => {
|
|||||||
return fileList;
|
return fileList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getBase64FromUploadFileList = (fileList?: UploadFile[]) => {
|
export const getBase64FromUploadFileList = async (fileList?: UploadFile[]) => {
|
||||||
if (Array.isArray(fileList) && fileList.length > 0) {
|
if (Array.isArray(fileList) && fileList.length > 0) {
|
||||||
return fileList[0].thumbUrl;
|
const base64 = await transformFile2Base64(fileList[0].originFileObj);
|
||||||
|
return base64;
|
||||||
|
// return fileList[0].thumbUrl; TODO: Even JPG files will be converted to base64 parameters in png format
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
Reference in New Issue
Block a user