|
@@ -8,7 +8,7 @@ import React, {
|
|
|
Fragment,
|
|
Fragment,
|
|
|
RefObject,
|
|
RefObject,
|
|
|
} from "react";
|
|
} from "react";
|
|
|
-import { HomeOutlined, MenuOutlined } from '@ant-design/icons';
|
|
|
|
|
|
|
+import { HomeOutlined, MenuOutlined,FormOutlined } from '@ant-design/icons';
|
|
|
import SendWhiteIcon from "../icons/send-white.svg";
|
|
import SendWhiteIcon from "../icons/send-white.svg";
|
|
|
import BrainIcon from "../icons/brain.svg";
|
|
import BrainIcon from "../icons/brain.svg";
|
|
|
import RenameIcon from "../icons/rename.svg";
|
|
import RenameIcon from "../icons/rename.svg";
|
|
@@ -1152,7 +1152,7 @@ function _Chat() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const init = async (chatMode?: string) => {
|
|
const init = async (chatMode?: string) => {
|
|
|
- await fetchApplicationList(chatMode);
|
|
|
|
|
|
|
+ // await fetchApplicationList(chatMode);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -1167,11 +1167,13 @@ function _Chat() {
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
const search = location.search;
|
|
const search = location.search;
|
|
|
const params = new URLSearchParams(search);
|
|
const params = new URLSearchParams(search);
|
|
|
- const chatMode = params.get('chatMode');
|
|
|
|
|
|
|
+ // const chatMode = params.get('chatMode');
|
|
|
|
|
+ const chatMode = 'LOCAL';
|
|
|
|
|
|
|
|
if (chatMode) {
|
|
if (chatMode) {
|
|
|
setSelectedFruit(chatMode as "ONLINE" | "LOCAL");
|
|
setSelectedFruit(chatMode as "ONLINE" | "LOCAL");
|
|
|
- const appId = params.get('appId');
|
|
|
|
|
|
|
+ // const appId = params.get('appId');
|
|
|
|
|
+ const appId = '2924812721300312064';
|
|
|
if (appId) {
|
|
if (appId) {
|
|
|
setAppValue(appId);
|
|
setAppValue(appId);
|
|
|
globalStore.setSelectedAppId(appId);
|
|
globalStore.setSelectedAppId(appId);
|
|
@@ -1869,6 +1871,7 @@ function _Chat() {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
}
|
|
}
|
|
|
|
|
+ {/* 获取应用列表头部展示在页面最上面 */}
|
|
|
{
|
|
{
|
|
|
false &&
|
|
false &&
|
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
@@ -1921,31 +1924,12 @@ function _Chat() {
|
|
|
}
|
|
}
|
|
|
</div>
|
|
</div>
|
|
|
<div className="window-actions">
|
|
<div className="window-actions">
|
|
|
- <div className="window-action-button">
|
|
|
|
|
- <Popover
|
|
|
|
|
- trigger="click"
|
|
|
|
|
- title="分享该应用"
|
|
|
|
|
- content={() => {
|
|
|
|
|
- const url = `${window.location.origin}/#/knowledgeChat?showMenu=false&chatMode=${selectedFruit}&appId=${appValue}`
|
|
|
|
|
- return <div>
|
|
|
|
|
- <div style={{ marginBottom: 10 }}>
|
|
|
|
|
- {url}
|
|
|
|
|
- </div>
|
|
|
|
|
- <Button onClick={() => {
|
|
|
|
|
- navigator.clipboard.writeText(url);
|
|
|
|
|
- message.success('分享链接已复制到剪贴板');
|
|
|
|
|
- }}>
|
|
|
|
|
- 复制
|
|
|
|
|
- </Button>
|
|
|
|
|
- </div>
|
|
|
|
|
- }
|
|
|
|
|
- }>
|
|
|
|
|
- <IconButton
|
|
|
|
|
- icon={<ExportIcon />}
|
|
|
|
|
- bordered
|
|
|
|
|
- title='分享该应用'
|
|
|
|
|
- />
|
|
|
|
|
- </Popover>
|
|
|
|
|
|
|
+ <div className="window-action-button" onClick={()=>{
|
|
|
|
|
+ localStorage.clear();
|
|
|
|
|
+ window.location.reload();
|
|
|
|
|
+ }}>
|
|
|
|
|
+ <IconButton text='新聊天' icon={<FormOutlined />} />
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
{/* {showMaxIcon && (
|
|
{/* {showMaxIcon && (
|
|
|
<div className="window-action-button">
|
|
<div className="window-action-button">
|
|
@@ -2157,7 +2141,6 @@ function _Chat() {
|
|
|
</div>
|
|
</div>
|
|
|
}
|
|
}
|
|
|
<div className={styles["chat-message-item"]}>
|
|
<div className={styles["chat-message-item"]}>
|
|
|
- {JSON.stringify(message)}
|
|
|
|
|
<Markdown
|
|
<Markdown
|
|
|
key={message.streaming ? "loading" : "done"}
|
|
key={message.streaming ? "loading" : "done"}
|
|
|
content={getMessageTextContent(message)}
|
|
content={getMessageTextContent(message)}
|