Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
83aa3a85
authored
Aug 12, 2025
by
Archer
Committed by
GitHub
Aug 12, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redirect (#5440)
parent
3cbcb1e3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
24 deletions
+32
-24
packages/web/i18n/en/common.json
+0
-1
packages/web/i18n/zh-CN/common.json
+0
-1
packages/web/i18n/zh-Hant/common.json
+0
-1
projects/app/src/pageComponents/chat/ChatWindow/HomeChatWindow.tsx
+11
-2
projects/app/src/pageComponents/chat/SliderApps.tsx
+18
-16
projects/app/src/web/core/chat/context/useChatStore.ts
+3
-3
No files found.
packages/web/i18n/en/common.json
View file @
83aa3a85
...
@@ -363,7 +363,6 @@
...
@@ -363,7 +363,6 @@
"core.chat.Speaking"
:
"I'm Listening, Please Speak..."
,
"core.chat.Speaking"
:
"I'm Listening, Please Speak..."
,
"core.chat.Type a message"
:
"Enter a Question, Press [Enter] to Send / Press [Ctrl(Alt/Shift) + Enter] for New Line"
,
"core.chat.Type a message"
:
"Enter a Question, Press [Enter] to Send / Press [Ctrl(Alt/Shift) + Enter] for New Line"
,
"core.chat.Unpin"
:
"Unpin"
,
"core.chat.Unpin"
:
"Unpin"
,
"core.chat.You need to a chat app"
:
"You Do Not Have an Available App"
,
"core.chat.error.Chat error"
:
"Chat Error"
,
"core.chat.error.Chat error"
:
"Chat Error"
,
"core.chat.error.Messages empty"
:
"API Content is Empty, Possibly Due to Text Being Too Long"
,
"core.chat.error.Messages empty"
:
"API Content is Empty, Possibly Due to Text Being Too Long"
,
"core.chat.error.Select dataset empty"
:
"You Have Not Selected a Dataset"
,
"core.chat.error.Select dataset empty"
:
"You Have Not Selected a Dataset"
,
...
...
packages/web/i18n/zh-CN/common.json
View file @
83aa3a85
...
@@ -363,7 +363,6 @@
...
@@ -363,7 +363,6 @@
"core.chat.Speaking"
:
"我在听,请说..."
,
"core.chat.Speaking"
:
"我在听,请说..."
,
"core.chat.Type a message"
:
"输入问题,发送 [Enter]/换行 [Ctrl(Alt/Shift) + Enter]"
,
"core.chat.Type a message"
:
"输入问题,发送 [Enter]/换行 [Ctrl(Alt/Shift) + Enter]"
,
"core.chat.Unpin"
:
"取消置顶"
,
"core.chat.Unpin"
:
"取消置顶"
,
"core.chat.You need to a chat app"
:
"你没有可用的应用"
,
"core.chat.error.Chat error"
:
"对话出现异常"
,
"core.chat.error.Chat error"
:
"对话出现异常"
,
"core.chat.error.Messages empty"
:
"接口内容为空,可能文本超长了~"
,
"core.chat.error.Messages empty"
:
"接口内容为空,可能文本超长了~"
,
"core.chat.error.Select dataset empty"
:
"你没有选择知识库"
,
"core.chat.error.Select dataset empty"
:
"你没有选择知识库"
,
...
...
packages/web/i18n/zh-Hant/common.json
View file @
83aa3a85
...
@@ -363,7 +363,6 @@
...
@@ -363,7 +363,6 @@
"core.chat.Speaking"
:
"我在聽,請說..."
,
"core.chat.Speaking"
:
"我在聽,請說..."
,
"core.chat.Type a message"
:
"輸入問題,按 [Enter] 傳送 / 按 [Ctrl(Alt/Shift) + Enter] 換行"
,
"core.chat.Type a message"
:
"輸入問題,按 [Enter] 傳送 / 按 [Ctrl(Alt/Shift) + Enter] 換行"
,
"core.chat.Unpin"
:
"取消釘選"
,
"core.chat.Unpin"
:
"取消釘選"
,
"core.chat.You need to a chat app"
:
"您沒有可用的應用程式"
,
"core.chat.error.Chat error"
:
"對話發生錯誤"
,
"core.chat.error.Chat error"
:
"對話發生錯誤"
,
"core.chat.error.Messages empty"
:
"API 內容為空,可能是文字過長"
,
"core.chat.error.Messages empty"
:
"API 內容為空,可能是文字過長"
,
"core.chat.error.Select dataset empty"
:
"您尚未選擇知識庫"
,
"core.chat.error.Select dataset empty"
:
"您尚未選擇知識庫"
,
...
...
projects/app/src/pageComponents/chat/ChatWindow/HomeChatWindow.tsx
View file @
83aa3a85
...
@@ -25,7 +25,7 @@ import type { StartChatFnProps } from '@/components/core/chat/ChatContainer/type
...
@@ -25,7 +25,7 @@ import type { StartChatFnProps } from '@/components/core/chat/ChatContainer/type
import
{
streamFetch
}
from
'@/web/common/api/fetch'
;
import
{
streamFetch
}
from
'@/web/common/api/fetch'
;
import
{
getChatTitleFromChatMessage
}
from
'@fastgpt/global/core/chat/utils'
;
import
{
getChatTitleFromChatMessage
}
from
'@fastgpt/global/core/chat/utils'
;
import
{
GPTMessages2Chats
}
from
'@fastgpt/global/core/chat/adapt'
;
import
{
GPTMessages2Chats
}
from
'@fastgpt/global/core/chat/adapt'
;
import
{
useLocalStorageState
,
useMemoizedFn
}
from
'ahooks'
;
import
{
useLocalStorageState
,
useMemoizedFn
,
useMount
}
from
'ahooks'
;
import
{
useChatStore
}
from
'@/web/core/chat/context/useChatStore'
;
import
{
useChatStore
}
from
'@/web/core/chat/context/useChatStore'
;
import
{
useRequest2
}
from
'@fastgpt/web/hooks/useRequest'
;
import
{
useRequest2
}
from
'@fastgpt/web/hooks/useRequest'
;
import
{
getInitChatInfo
}
from
'@/web/core/chat/api'
;
import
{
getInitChatInfo
}
from
'@/web/core/chat/api'
;
...
@@ -51,6 +51,7 @@ import { ChatRecordContext } from '@/web/core/chat/context/chatRecordContext';
...
@@ -51,6 +51,7 @@ import { ChatRecordContext } from '@/web/core/chat/context/chatRecordContext';
import
{
HUGGING_FACE_ICON
}
from
'@fastgpt/global/common/system/constants'
;
import
{
HUGGING_FACE_ICON
}
from
'@fastgpt/global/common/system/constants'
;
import
{
getModelFromList
}
from
'@fastgpt/global/core/ai/model'
;
import
{
getModelFromList
}
from
'@fastgpt/global/core/ai/model'
;
import
MyPopover
from
'@fastgpt/web/components/common/MyPopover'
;
import
MyPopover
from
'@fastgpt/web/components/common/MyPopover'
;
import
{
ChatSidebarPaneEnum
}
from
'../constants'
;
type
Props
=
{
type
Props
=
{
myApps
:
AppListItemType
[];
myApps
:
AppListItemType
[];
...
@@ -73,9 +74,11 @@ const HomeChatWindow = ({ myApps }: Props) => {
...
@@ -73,9 +74,11 @@ const HomeChatWindow = ({ myApps }: Props) => {
const
{
isPc
}
=
useSystem
();
const
{
isPc
}
=
useSystem
();
const
{
userInfo
}
=
useUserStore
();
const
{
userInfo
}
=
useUserStore
();
const
{
llmModelList
,
defaultModels
}
=
useSystemStore
();
const
{
llmModelList
,
defaultModels
,
feConfigs
}
=
useSystemStore
();
const
{
chatId
,
appId
,
outLinkAuthData
}
=
useChatStore
();
const
{
chatId
,
appId
,
outLinkAuthData
}
=
useChatStore
();
const
onHomeClick
=
useContextSelector
(
ChatSettingContext
,
(
v
)
=>
v
.
handlePaneChange
);
const
isOpenSlider
=
useContextSelector
(
ChatContext
,
(
v
)
=>
v
.
isOpenSlider
);
const
isOpenSlider
=
useContextSelector
(
ChatContext
,
(
v
)
=>
v
.
isOpenSlider
);
const
forbidLoadChat
=
useContextSelector
(
ChatContext
,
(
v
)
=>
v
.
forbidLoadChat
);
const
forbidLoadChat
=
useContextSelector
(
ChatContext
,
(
v
)
=>
v
.
forbidLoadChat
);
const
onCloseSlider
=
useContextSelector
(
ChatContext
,
(
v
)
=>
v
.
onCloseSlider
);
const
onCloseSlider
=
useContextSelector
(
ChatContext
,
(
v
)
=>
v
.
onCloseSlider
);
...
@@ -168,6 +171,12 @@ const HomeChatWindow = ({ myApps }: Props) => {
...
@@ -168,6 +171,12 @@ const HomeChatWindow = ({ myApps }: Props) => {
}
}
);
);
useMount
(()
=>
{
if
(
!
feConfigs
?.
isPlus
)
{
onHomeClick
(
ChatSidebarPaneEnum
.
RECENTLY_USED_APPS
);
}
});
// 使用类似AppChatWindow的对话逻辑
// 使用类似AppChatWindow的对话逻辑
const
onStartChat
=
useMemoizedFn
(
const
onStartChat
=
useMemoizedFn
(
async
({
async
({
...
...
projects/app/src/pageComponents/chat/SliderApps.tsx
View file @
83aa3a85
import
React
,
{
useCallback
,
useState
}
from
'react'
;
import
React
,
{
useCallback
}
from
'react'
;
import
type
{
BoxProps
}
from
'@chakra-ui/react'
;
import
type
{
BoxProps
}
from
'@chakra-ui/react'
;
import
{
Flex
,
Box
,
HStack
,
Image
,
Skeleton
}
from
'@chakra-ui/react'
;
import
{
Flex
,
Box
,
HStack
,
Image
}
from
'@chakra-ui/react'
;
import
{
motion
,
AnimatePresence
}
from
'framer-motion'
;
import
{
motion
,
AnimatePresence
}
from
'framer-motion'
;
import
{
useRouter
}
from
'next/router'
;
import
{
useRouter
}
from
'next/router'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useTranslation
}
from
'next-i18next'
;
...
@@ -10,8 +10,6 @@ import MyDivider from '@fastgpt/web/components/common/MyDivider';
...
@@ -10,8 +10,6 @@ import MyDivider from '@fastgpt/web/components/common/MyDivider';
import
{
useUserStore
}
from
'@/web/support/user/useUserStore'
;
import
{
useUserStore
}
from
'@/web/support/user/useUserStore'
;
import
UserAvatarPopover
from
'@/pageComponents/chat/UserAvatarPopover'
;
import
UserAvatarPopover
from
'@/pageComponents/chat/UserAvatarPopover'
;
import
MyBox
from
'@fastgpt/web/components/common/MyBox'
;
import
MyBox
from
'@fastgpt/web/components/common/MyBox'
;
import
MyPopover
from
'@fastgpt/web/components/common/MyPopover'
;
import
SelectOneResource
from
'@/components/common/folder/SelectOneResource'
;
import
MyIcon
from
'@fastgpt/web/components/common/Icon'
;
import
MyIcon
from
'@fastgpt/web/components/common/Icon'
;
import
type
{
import
type
{
GetResourceFolderListProps
,
GetResourceFolderListProps
,
...
@@ -280,25 +278,15 @@ const NavigationSection = () => {
...
@@ -280,25 +278,15 @@ const NavigationSection = () => {
<
AnimatePresence
mode=
"wait"
>
<
AnimatePresence
mode=
"wait"
>
{
isCollapsed
?
(
{
isCollapsed
?
(
<
AnimatedSection
show=
{
true
}
>
<
AnimatedSection
show=
{
true
}
>
<
Flex
flexDir=
"column"
gap=
{
2
}
>
<
ActionButton
<
ActionButton
icon=
"core/chat/sidebar/home"
icon=
"core/chat/sidebar/home"
isCollapsed=
{
true
}
isCollapsed=
{
true
}
isActive=
{
isHomeActive
}
isActive=
{
isHomeActive
}
onClick=
{
()
=>
onHomeClick
(
ChatSidebarPaneEnum
.
HOME
)
}
onClick=
{
()
=>
onHomeClick
(
ChatSidebarPaneEnum
.
HOME
)
}
/>
/>
<
ActionButton
icon=
"common/app"
isCollapsed=
{
true
}
isActive=
{
isTeamAppsActive
}
onClick=
{
()
=>
onHomeClick
(
ChatSidebarPaneEnum
.
TEAM_APPS
)
}
/>
</
Flex
>
</
AnimatedSection
>
</
AnimatedSection
>
)
:
(
)
:
(
<
AnimatedSection
show=
{
true
}
>
<
AnimatedSection
show=
{
true
}
>
<
Flex
flexDir=
"column"
gap=
{
2
}
>
<
ActionButton
<
ActionButton
icon=
"core/chat/sidebar/home"
icon=
"core/chat/sidebar/home"
text=
{
t
(
'chat:sidebar.home'
)
}
text=
{
t
(
'chat:sidebar.home'
)
}
...
@@ -306,7 +294,23 @@ const NavigationSection = () => {
...
@@ -306,7 +294,23 @@ const NavigationSection = () => {
isActive=
{
isHomeActive
}
isActive=
{
isHomeActive
}
onClick=
{
()
=>
onHomeClick
(
ChatSidebarPaneEnum
.
HOME
)
}
onClick=
{
()
=>
onHomeClick
(
ChatSidebarPaneEnum
.
HOME
)
}
/>
/>
</
AnimatedSection
>
)
}
</
AnimatePresence
>
)
}
<
AnimatePresence
mode=
"wait"
>
{
isCollapsed
?
(
<
AnimatedSection
show=
{
true
}
>
<
ActionButton
icon=
"common/app"
isCollapsed=
{
true
}
isActive=
{
isTeamAppsActive
}
onClick=
{
()
=>
onHomeClick
(
ChatSidebarPaneEnum
.
TEAM_APPS
)
}
/>
</
AnimatedSection
>
)
:
(
<
AnimatedSection
show=
{
true
}
>
<
ActionButton
<
ActionButton
icon=
"common/app"
icon=
"common/app"
text=
{
t
(
'chat:sidebar.team_apps'
)
}
text=
{
t
(
'chat:sidebar.team_apps'
)
}
...
@@ -314,11 +318,9 @@ const NavigationSection = () => {
...
@@ -314,11 +318,9 @@ const NavigationSection = () => {
isActive=
{
isTeamAppsActive
}
isActive=
{
isTeamAppsActive
}
onClick=
{
()
=>
onHomeClick
(
ChatSidebarPaneEnum
.
TEAM_APPS
)
}
onClick=
{
()
=>
onHomeClick
(
ChatSidebarPaneEnum
.
TEAM_APPS
)
}
/>
/>
</
Flex
>
</
AnimatedSection
>
</
AnimatedSection
>
)
}
)
}
</
AnimatePresence
>
</
AnimatePresence
>
)
}
</
Flex
>
</
Flex
>
);
);
};
};
...
...
projects/app/src/web/core/chat/context/useChatStore.ts
View file @
83aa3a85
...
@@ -2,7 +2,7 @@ import { create, createJSONStorage, devtools, persist, immer } from '@fastgpt/we
...
@@ -2,7 +2,7 @@ import { create, createJSONStorage, devtools, persist, immer } from '@fastgpt/we
import
{
getNanoid
}
from
'@fastgpt/global/common/string/tools'
;
import
{
getNanoid
}
from
'@fastgpt/global/common/string/tools'
;
import
{
type
OutLinkChatAuthProps
}
from
'@fastgpt/global/support/permission/chat'
;
import
{
type
OutLinkChatAuthProps
}
from
'@fastgpt/global/support/permission/chat'
;
import
type
{
ChatSourceEnum
}
from
'@fastgpt/global/core/chat/constants'
;
import
type
{
ChatSourceEnum
}
from
'@fastgpt/global/core/chat/constants'
;
import
{
ChatSidebarPaneEnum
}
from
'@/pageComponents/chat/constants'
;
import
type
{
ChatSidebarPaneEnum
}
from
'@/pageComponents/chat/constants'
;
type
State
=
{
type
State
=
{
source
?:
`
${
ChatSourceEnum
}
`
;
source
?:
`
${
ChatSourceEnum
}
`
;
...
@@ -17,7 +17,7 @@ type State = {
...
@@ -17,7 +17,7 @@ type State = {
chatId
:
string
;
chatId
:
string
;
setChatId
:
(
e
?:
string
)
=>
any
;
setChatId
:
(
e
?:
string
)
=>
any
;
lastPane
:
ChatSidebarPaneEnum
;
lastPane
?
:
ChatSidebarPaneEnum
;
setLastPane
:
(
e
:
ChatSidebarPaneEnum
)
=>
any
;
setLastPane
:
(
e
:
ChatSidebarPaneEnum
)
=>
any
;
outLinkAuthData
:
OutLinkChatAuthProps
;
outLinkAuthData
:
OutLinkChatAuthProps
;
...
@@ -115,7 +115,7 @@ export const useChatStore = create<State>()(
...
@@ -115,7 +115,7 @@ export const useChatStore = create<State>()(
state
.
lastChatAppId
=
e
;
state
.
lastChatAppId
=
e
;
});
});
},
},
lastPane
:
ChatSidebarPaneEnum
.
HOME
,
lastPane
:
undefined
,
setLastPane
(
e
)
{
setLastPane
(
e
)
{
set
((
state
)
=>
{
set
((
state
)
=>
{
state
.
lastPane
=
e
;
state
.
lastPane
=
e
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment