mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-04 11:24:00 +08:00
fix: display the current language directly at the top and do not disp… (#579)
…lay reference symbols for documents in external chat boxes #566 #577 ### What problem does this PR solve? fix: display the current language directly at the top and do not display reference symbols for documents in external chat boxes #566 #577 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
944776f207
commit
ae501c58fa
@ -15,3 +15,7 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.language {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { ReactComponent as TranslationIcon } from '@/assets/svg/translation.svg';
|
|
||||||
import { useTranslate } from '@/hooks/commonHooks';
|
import { useTranslate } from '@/hooks/commonHooks';
|
||||||
import { GithubOutlined } from '@ant-design/icons';
|
import { DownOutlined, GithubOutlined } from '@ant-design/icons';
|
||||||
import { Dropdown, MenuProps, Space } from 'antd';
|
import { Dropdown, MenuProps, Space } from 'antd';
|
||||||
import camelCase from 'lodash/camelCase';
|
import camelCase from 'lodash/camelCase';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@ -8,6 +7,7 @@ import User from '../user';
|
|||||||
|
|
||||||
import { LanguageList } from '@/constants/common';
|
import { LanguageList } from '@/constants/common';
|
||||||
import { useChangeLanguage } from '@/hooks/logicHooks';
|
import { useChangeLanguage } from '@/hooks/logicHooks';
|
||||||
|
import { useSelector } from 'umi';
|
||||||
import styled from './index.less';
|
import styled from './index.less';
|
||||||
|
|
||||||
const Circle = ({ children, ...restProps }: React.PropsWithChildren) => {
|
const Circle = ({ children, ...restProps }: React.PropsWithChildren) => {
|
||||||
@ -25,6 +25,7 @@ const handleGithubCLick = () => {
|
|||||||
const RightToolBar = () => {
|
const RightToolBar = () => {
|
||||||
const { t } = useTranslate('common');
|
const { t } = useTranslate('common');
|
||||||
const changeLanguage = useChangeLanguage();
|
const changeLanguage = useChangeLanguage();
|
||||||
|
const { language = '' } = useSelector((state) => state.settingModel.userInfo);
|
||||||
|
|
||||||
const handleItemClick: MenuProps['onClick'] = ({ key }) => {
|
const handleItemClick: MenuProps['onClick'] = ({ key }) => {
|
||||||
changeLanguage(key);
|
changeLanguage(key);
|
||||||
@ -40,14 +41,15 @@ const RightToolBar = () => {
|
|||||||
return (
|
return (
|
||||||
<div className={styled.toolbarWrapper}>
|
<div className={styled.toolbarWrapper}>
|
||||||
<Space wrap size={16}>
|
<Space wrap size={16}>
|
||||||
|
<Dropdown menu={{ items, onClick: handleItemClick }} placement="bottom">
|
||||||
|
<Space className={styled.language}>
|
||||||
|
<b>{t(camelCase(language))}</b>
|
||||||
|
<DownOutlined />
|
||||||
|
</Space>
|
||||||
|
</Dropdown>
|
||||||
<Circle>
|
<Circle>
|
||||||
<GithubOutlined onClick={handleGithubCLick} />
|
<GithubOutlined onClick={handleGithubCLick} />
|
||||||
</Circle>
|
</Circle>
|
||||||
<Dropdown menu={{ items, onClick: handleItemClick }} placement="bottom">
|
|
||||||
<Circle>
|
|
||||||
<TranslationIcon />
|
|
||||||
</Circle>
|
|
||||||
</Dropdown>
|
|
||||||
{/* <Circle>
|
{/* <Circle>
|
||||||
<MonIcon />
|
<MonIcon />
|
||||||
</Circle> */}
|
</Circle> */}
|
||||||
|
@ -129,6 +129,7 @@ export const useSendSharedMessage = (
|
|||||||
async (message: string, id?: string) => {
|
async (message: string, id?: string) => {
|
||||||
const retcode = await completeConversation({
|
const retcode = await completeConversation({
|
||||||
conversation_id: id ?? conversationId,
|
conversation_id: id ?? conversationId,
|
||||||
|
quote: false,
|
||||||
messages: [
|
messages: [
|
||||||
...(conversation?.message ?? []).map((x: IMessage) => omit(x, 'id')),
|
...(conversation?.message ?? []).map((x: IMessage) => omit(x, 'id')),
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user