Skip to content

Commit

Permalink
Fix a bug in 'assistant-setting.tsx' that causes the upload button to… (
Browse files Browse the repository at this point in the history
infiniflow#796)

… incorrectly appear on the model settings page.

### What problem does this PR solve?

This is an issue with the Upload component on the assistant-setting
page. I use the show variable to explicitly control the button component
within it.

see:

![20240516000417](https://github.com/infiniflow/ragflow/assets/37476944/de88f911-6dbd-412d-a981-86cf60aa2257)


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] Other (please describe): Add the local models that DeepDoc depends
on to the gitignore file in dev mode.

Signed-off-by: liuchao <[email protected]>
  • Loading branch information
achilou authored May 16, 2024
1 parent 2d0cd64 commit 77cfc3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ Cargo.lock
docker/ragflow-logs/
/flask_session
/logs
rag/res/deepdoc
16 changes: 10 additions & 6 deletions web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ const AssistantSetting = ({ show }: ISegmentedContentProps) => {
return e?.fileList;
};

const uploadButtion = (
<button style={{ border: 0, background: 'none' }} type="button">
<PlusOutlined />
<div style={{ marginTop: 8 }}>
{t('upload', { keyPrefix: 'common' })}
</div>
</button>
)

return (
<section
className={classNames({
Expand All @@ -46,12 +55,7 @@ const AssistantSetting = ({ show }: ISegmentedContentProps) => {
maxCount={1}
showUploadList={{ showPreviewIcon: false, showRemoveIcon: false }}
>
<button style={{ border: 0, background: 'none' }} type="button">
<PlusOutlined />
<div style={{ marginTop: 8 }}>
{t('upload', { keyPrefix: 'common' })}
</div>
</button>
{show ? uploadButtion : null}
</Upload>
</Form.Item>
<Form.Item
Expand Down

0 comments on commit 77cfc3e

Please sign in to comment.