balibabu
commited on
Commit
·
b941fd0
1
Parent(s):
cac848f
fix: display the current language directly at the top and do not disp… (#579)
Browse files…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)
web/src/layouts/components/right-toolbar/index.less
CHANGED
|
@@ -15,3 +15,7 @@
|
|
| 15 |
vertical-align: middle;
|
| 16 |
cursor: pointer;
|
| 17 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
vertical-align: middle;
|
| 16 |
cursor: pointer;
|
| 17 |
}
|
| 18 |
+
|
| 19 |
+
.language {
|
| 20 |
+
cursor: pointer;
|
| 21 |
+
}
|
web/src/layouts/components/right-toolbar/index.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
-
import { ReactComponent as TranslationIcon } from '@/assets/svg/translation.svg';
|
| 2 |
import { useTranslate } from '@/hooks/commonHooks';
|
| 3 |
-
import { GithubOutlined } from '@ant-design/icons';
|
| 4 |
import { Dropdown, MenuProps, Space } from 'antd';
|
| 5 |
import camelCase from 'lodash/camelCase';
|
| 6 |
import React from 'react';
|
|
@@ -8,6 +7,7 @@ import User from '../user';
|
|
| 8 |
|
| 9 |
import { LanguageList } from '@/constants/common';
|
| 10 |
import { useChangeLanguage } from '@/hooks/logicHooks';
|
|
|
|
| 11 |
import styled from './index.less';
|
| 12 |
|
| 13 |
const Circle = ({ children, ...restProps }: React.PropsWithChildren) => {
|
|
@@ -25,6 +25,7 @@ const handleGithubCLick = () => {
|
|
| 25 |
const RightToolBar = () => {
|
| 26 |
const { t } = useTranslate('common');
|
| 27 |
const changeLanguage = useChangeLanguage();
|
|
|
|
| 28 |
|
| 29 |
const handleItemClick: MenuProps['onClick'] = ({ key }) => {
|
| 30 |
changeLanguage(key);
|
|
@@ -40,14 +41,15 @@ const RightToolBar = () => {
|
|
| 40 |
return (
|
| 41 |
<div className={styled.toolbarWrapper}>
|
| 42 |
<Space wrap size={16}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
<Circle>
|
| 44 |
<GithubOutlined onClick={handleGithubCLick} />
|
| 45 |
</Circle>
|
| 46 |
-
<Dropdown menu={{ items, onClick: handleItemClick }} placement="bottom">
|
| 47 |
-
<Circle>
|
| 48 |
-
<TranslationIcon />
|
| 49 |
-
</Circle>
|
| 50 |
-
</Dropdown>
|
| 51 |
{/* <Circle>
|
| 52 |
<MonIcon />
|
| 53 |
</Circle> */}
|
|
|
|
|
|
|
| 1 |
import { useTranslate } from '@/hooks/commonHooks';
|
| 2 |
+
import { DownOutlined, GithubOutlined } from '@ant-design/icons';
|
| 3 |
import { Dropdown, MenuProps, Space } from 'antd';
|
| 4 |
import camelCase from 'lodash/camelCase';
|
| 5 |
import React from 'react';
|
|
|
|
| 7 |
|
| 8 |
import { LanguageList } from '@/constants/common';
|
| 9 |
import { useChangeLanguage } from '@/hooks/logicHooks';
|
| 10 |
+
import { useSelector } from 'umi';
|
| 11 |
import styled from './index.less';
|
| 12 |
|
| 13 |
const Circle = ({ children, ...restProps }: React.PropsWithChildren) => {
|
|
|
|
| 25 |
const RightToolBar = () => {
|
| 26 |
const { t } = useTranslate('common');
|
| 27 |
const changeLanguage = useChangeLanguage();
|
| 28 |
+
const { language = '' } = useSelector((state) => state.settingModel.userInfo);
|
| 29 |
|
| 30 |
const handleItemClick: MenuProps['onClick'] = ({ key }) => {
|
| 31 |
changeLanguage(key);
|
|
|
|
| 41 |
return (
|
| 42 |
<div className={styled.toolbarWrapper}>
|
| 43 |
<Space wrap size={16}>
|
| 44 |
+
<Dropdown menu={{ items, onClick: handleItemClick }} placement="bottom">
|
| 45 |
+
<Space className={styled.language}>
|
| 46 |
+
<b>{t(camelCase(language))}</b>
|
| 47 |
+
<DownOutlined />
|
| 48 |
+
</Space>
|
| 49 |
+
</Dropdown>
|
| 50 |
<Circle>
|
| 51 |
<GithubOutlined onClick={handleGithubCLick} />
|
| 52 |
</Circle>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
{/* <Circle>
|
| 54 |
<MonIcon />
|
| 55 |
</Circle> */}
|
web/src/pages/chat/shared-hooks.ts
CHANGED
|
@@ -129,6 +129,7 @@ export const useSendSharedMessage = (
|
|
| 129 |
async (message: string, id?: string) => {
|
| 130 |
const retcode = await completeConversation({
|
| 131 |
conversation_id: id ?? conversationId,
|
|
|
|
| 132 |
messages: [
|
| 133 |
...(conversation?.message ?? []).map((x: IMessage) => omit(x, 'id')),
|
| 134 |
{
|
|
|
|
| 129 |
async (message: string, id?: string) => {
|
| 130 |
const retcode = await completeConversation({
|
| 131 |
conversation_id: id ?? conversationId,
|
| 132 |
+
quote: false,
|
| 133 |
messages: [
|
| 134 |
...(conversation?.message ?? []).map((x: IMessage) => omit(x, 'id')),
|
| 135 |
{
|