balibabu
commited on
Commit
·
4ea925e
1
Parent(s):
71a733e
feat: Added md.svg #345 (#2289)
Browse files### What problem does this PR solve?
feat: Added md.svg #345
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
web/src/assets/svg/file-icon/md.svg
ADDED
|
|
web/src/hooks/logic-hooks.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { IClientConversation, IMessage } from '@/pages/chat/interface';
|
|
| 10 |
import api from '@/utils/api';
|
| 11 |
import { getAuthorization } from '@/utils/authorization-util';
|
| 12 |
import { buildMessageUuid, getMessagePureId } from '@/utils/chat';
|
| 13 |
-
import { PaginationProps } from 'antd';
|
| 14 |
import { FormInstance } from 'antd/lib';
|
| 15 |
import axios from 'axios';
|
| 16 |
import { EventSourceParserStream } from 'eventsource-parser/stream';
|
|
@@ -280,8 +280,8 @@ export const useSendMessageWithSse = (
|
|
| 280 |
|
| 281 |
export const useSpeechWithSse = (url: string = api.tts) => {
|
| 282 |
const read = useCallback(
|
| 283 |
-
(body: any) => {
|
| 284 |
-
const response = fetch(url, {
|
| 285 |
method: 'POST',
|
| 286 |
headers: {
|
| 287 |
[Authorization]: getAuthorization(),
|
|
@@ -289,6 +289,14 @@ export const useSpeechWithSse = (url: string = api.tts) => {
|
|
| 289 |
},
|
| 290 |
body: JSON.stringify(body),
|
| 291 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
return response;
|
| 293 |
},
|
| 294 |
[url],
|
|
|
|
| 10 |
import api from '@/utils/api';
|
| 11 |
import { getAuthorization } from '@/utils/authorization-util';
|
| 12 |
import { buildMessageUuid, getMessagePureId } from '@/utils/chat';
|
| 13 |
+
import { PaginationProps, message } from 'antd';
|
| 14 |
import { FormInstance } from 'antd/lib';
|
| 15 |
import axios from 'axios';
|
| 16 |
import { EventSourceParserStream } from 'eventsource-parser/stream';
|
|
|
|
| 280 |
|
| 281 |
export const useSpeechWithSse = (url: string = api.tts) => {
|
| 282 |
const read = useCallback(
|
| 283 |
+
async (body: any) => {
|
| 284 |
+
const response = await fetch(url, {
|
| 285 |
method: 'POST',
|
| 286 |
headers: {
|
| 287 |
[Authorization]: getAuthorization(),
|
|
|
|
| 289 |
},
|
| 290 |
body: JSON.stringify(body),
|
| 291 |
});
|
| 292 |
+
try {
|
| 293 |
+
const res = await response.clone().json();
|
| 294 |
+
if (res?.retcode !== 0) {
|
| 295 |
+
message.error(res?.retmsg);
|
| 296 |
+
}
|
| 297 |
+
} catch (error) {
|
| 298 |
+
console.warn('🚀 ~ error:', error);
|
| 299 |
+
}
|
| 300 |
return response;
|
| 301 |
},
|
| 302 |
[url],
|
web/src/layouts/components/header/index.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import { useLocation } from 'umi';
|
|
| 9 |
import Toolbar from '../right-toolbar';
|
| 10 |
|
| 11 |
import { useFetchAppConf } from '@/hooks/logic-hooks';
|
| 12 |
-
import { MessageOutlined
|
| 13 |
import styles from './index.less';
|
| 14 |
|
| 15 |
const { Header } = Layout;
|
|
@@ -27,7 +27,7 @@ const RagHeader = () => {
|
|
| 27 |
() => [
|
| 28 |
{ path: '/knowledge', name: t('knowledgeBase'), icon: KnowledgeBaseIcon },
|
| 29 |
{ path: '/chat', name: t('chat'), icon: MessageOutlined },
|
| 30 |
-
{ path: '/search', name: t('search'), icon: SearchOutlined },
|
| 31 |
{ path: '/flow', name: t('flow'), icon: GraphIcon },
|
| 32 |
{ path: '/file', name: t('fileManager'), icon: FileIcon },
|
| 33 |
],
|
|
|
|
| 9 |
import Toolbar from '../right-toolbar';
|
| 10 |
|
| 11 |
import { useFetchAppConf } from '@/hooks/logic-hooks';
|
| 12 |
+
import { MessageOutlined } from '@ant-design/icons';
|
| 13 |
import styles from './index.less';
|
| 14 |
|
| 15 |
const { Header } = Layout;
|
|
|
|
| 27 |
() => [
|
| 28 |
{ path: '/knowledge', name: t('knowledgeBase'), icon: KnowledgeBaseIcon },
|
| 29 |
{ path: '/chat', name: t('chat'), icon: MessageOutlined },
|
| 30 |
+
// { path: '/search', name: t('search'), icon: SearchOutlined },
|
| 31 |
{ path: '/flow', name: t('flow'), icon: GraphIcon },
|
| 32 |
{ path: '/file', name: t('fileManager'), icon: FileIcon },
|
| 33 |
],
|