Skip to content

Commit

Permalink
feat: Added md.svg infiniflow#345 (infiniflow#2289)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

feat: Added md.svg infiniflow#345

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
  • Loading branch information
cike8899 authored Sep 6, 2024
1 parent f546a07 commit 798737e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
10 changes: 10 additions & 0 deletions web/src/assets/svg/file-icon/md.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions web/src/hooks/logic-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IClientConversation, IMessage } from '@/pages/chat/interface';
import api from '@/utils/api';
import { getAuthorization } from '@/utils/authorization-util';
import { buildMessageUuid, getMessagePureId } from '@/utils/chat';
import { PaginationProps } from 'antd';
import { PaginationProps, message } from 'antd';
import { FormInstance } from 'antd/lib';
import axios from 'axios';
import { EventSourceParserStream } from 'eventsource-parser/stream';
Expand Down Expand Up @@ -280,15 +280,23 @@ export const useSendMessageWithSse = (

export const useSpeechWithSse = (url: string = api.tts) => {
const read = useCallback(
(body: any) => {
const response = fetch(url, {
async (body: any) => {
const response = await fetch(url, {
method: 'POST',
headers: {
[Authorization]: getAuthorization(),
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
try {
const res = await response.clone().json();
if (res?.retcode !== 0) {
message.error(res?.retmsg);
}
} catch (error) {
console.warn('🚀 ~ error:', error);
}
return response;
},
[url],
Expand Down
4 changes: 2 additions & 2 deletions web/src/layouts/components/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useLocation } from 'umi';
import Toolbar from '../right-toolbar';

import { useFetchAppConf } from '@/hooks/logic-hooks';
import { MessageOutlined, SearchOutlined } from '@ant-design/icons';
import { MessageOutlined } from '@ant-design/icons';
import styles from './index.less';

const { Header } = Layout;
Expand All @@ -27,7 +27,7 @@ const RagHeader = () => {
() => [
{ path: '/knowledge', name: t('knowledgeBase'), icon: KnowledgeBaseIcon },
{ path: '/chat', name: t('chat'), icon: MessageOutlined },
{ path: '/search', name: t('search'), icon: SearchOutlined },
// { path: '/search', name: t('search'), icon: SearchOutlined },
{ path: '/flow', name: t('flow'), icon: GraphIcon },
{ path: '/file', name: t('fileManager'), icon: FileIcon },
],
Expand Down

0 comments on commit 798737e

Please sign in to comment.