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
cb56d1e5
authored
Dec 03, 2024
by
Archer
Committed by
GitHub
Dec 03, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ts (#3296)
parent
f28b7e41
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
1 deletions
+11
-1
projects/app/src/components/core/chat/ChatContainer/ChatBox/index.tsx
+5
-1
projects/app/src/pages/app/detail/components/Logs/DetailLogsModal.tsx
+1
-0
projects/app/src/pages/app/detail/components/useChatTest.tsx
+2
-0
projects/app/src/pages/chat/index.tsx
+1
-0
projects/app/src/pages/chat/share.tsx
+1
-0
projects/app/src/pages/chat/team.tsx
+1
-0
No files found.
projects/app/src/components/core/chat/ChatContainer/ChatBox/index.tsx
View file @
cb56d1e5
...
@@ -83,6 +83,7 @@ enum FeedbackTypeEnum {
...
@@ -83,6 +83,7 @@ enum FeedbackTypeEnum {
type
Props
=
OutLinkChatAuthProps
&
type
Props
=
OutLinkChatAuthProps
&
ChatProviderProps
&
{
ChatProviderProps
&
{
isReady
:
boolean
;
feedbackType
?:
`
${
FeedbackTypeEnum
}
`
;
feedbackType
?:
`
${
FeedbackTypeEnum
}
`
;
showMarkIcon
?:
boolean
;
// admin mark dataset
showMarkIcon
?:
boolean
;
// admin mark dataset
showVoiceIcon
?:
boolean
;
showVoiceIcon
?:
boolean
;
...
@@ -97,6 +98,7 @@ type Props = OutLinkChatAuthProps &
...
@@ -97,6 +98,7 @@ type Props = OutLinkChatAuthProps &
};
};
const
ChatBox
=
({
const
ChatBox
=
({
isReady
=
true
,
feedbackType
=
FeedbackTypeEnum
.
hidden
,
feedbackType
=
FeedbackTypeEnum
.
hidden
,
showMarkIcon
=
false
,
showMarkIcon
=
false
,
showVoiceIcon
=
true
,
showVoiceIcon
=
true
,
...
@@ -829,11 +831,12 @@ const ChatBox = ({
...
@@ -829,11 +831,12 @@ const ChatBox = ({
eventBus
.
off
(
EventNameEnum
.
sendQuestion
);
eventBus
.
off
(
EventNameEnum
.
sendQuestion
);
eventBus
.
off
(
EventNameEnum
.
editQuestion
);
eventBus
.
off
(
EventNameEnum
.
editQuestion
);
};
};
},
[
chatBoxData
,
resetInputVal
,
sendPrompt
]);
},
[
isReady
,
resetInputVal
,
sendPrompt
]);
// Auto send prompt
// Auto send prompt
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
if
(
isReady
&&
chatBoxData
?.
app
?.
chatConfig
?.
autoExecute
?.
open
&&
chatBoxData
?.
app
?.
chatConfig
?.
autoExecute
?.
open
&&
chatStarted
&&
chatStarted
&&
chatRecords
.
length
===
0
&&
chatRecords
.
length
===
0
&&
...
@@ -845,6 +848,7 @@ const ChatBox = ({
...
@@ -845,6 +848,7 @@ const ChatBox = ({
});
});
}
}
},
[
},
[
isReady
,
chatStarted
,
chatStarted
,
chatRecords
.
length
,
chatRecords
.
length
,
isChatRecordsLoaded
,
isChatRecordsLoaded
,
...
...
projects/app/src/pages/app/detail/components/Logs/DetailLogsModal.tsx
View file @
cb56d1e5
...
@@ -154,6 +154,7 @@ const DetailLogsModal = ({ appId, chatId, onClose }: Props) => {
...
@@ -154,6 +154,7 @@ const DetailLogsModal = ({ appId, chatId, onClose }: Props) => {
</
Box
>
</
Box
>
)
:
(
)
:
(
<
ChatBox
<
ChatBox
isReady
appId=
{
appId
}
appId=
{
appId
}
chatId=
{
chatId
}
chatId=
{
chatId
}
feedbackType=
{
'admin'
}
feedbackType=
{
'admin'
}
...
...
projects/app/src/pages/app/detail/components/useChatTest.tsx
View file @
cb56d1e5
...
@@ -82,6 +82,7 @@ export const useChatTest = ({
...
@@ -82,6 +82,7 @@ export const useChatTest = ({
useEffect
(()
=>
{
useEffect
(()
=>
{
setChatBoxData
({
setChatBoxData
({
userAvatar
:
userInfo
?.
avatar
,
userAvatar
:
userInfo
?.
avatar
,
appId
:
appId
,
app
:
{
app
:
{
chatConfig
,
chatConfig
,
name
:
appDetail
.
name
,
name
:
appDetail
.
name
,
...
@@ -94,6 +95,7 @@ export const useChatTest = ({
...
@@ -94,6 +95,7 @@ export const useChatTest = ({
appDetail
.
avatar
,
appDetail
.
avatar
,
appDetail
.
name
,
appDetail
.
name
,
appDetail
.
type
,
appDetail
.
type
,
appId
,
chatConfig
,
chatConfig
,
pluginInputs
,
pluginInputs
,
setChatBoxData
,
setChatBoxData
,
...
...
projects/app/src/pages/chat/index.tsx
View file @
cb56d1e5
...
@@ -209,6 +209,7 @@ const Chat = ({ myApps }: { myApps: AppListItemType[] }) => {
...
@@ -209,6 +209,7 @@ const Chat = ({ myApps }: { myApps: AppListItemType[] }) => {
chatType=
{
'chat'
}
chatType=
{
'chat'
}
showRawSource
showRawSource
showNodeStatus
showNodeStatus
isReady=
{
!
loading
}
/>
/>
)
}
)
}
</
Box
>
</
Box
>
...
...
projects/app/src/pages/chat/share.tsx
View file @
cb56d1e5
...
@@ -278,6 +278,7 @@ const OutLink = (props: Props) => {
...
@@ -278,6 +278,7 @@ const OutLink = (props: Props) => {
/>
/>
)
:
(
)
:
(
<
ChatBox
<
ChatBox
isReady=
{
!
loading
}
appId=
{
appId
}
appId=
{
appId
}
chatId=
{
chatId
}
chatId=
{
chatId
}
outLinkAuthData=
{
outLinkAuthData
}
outLinkAuthData=
{
outLinkAuthData
}
...
...
projects/app/src/pages/chat/team.tsx
View file @
cb56d1e5
...
@@ -218,6 +218,7 @@ const Chat = ({ myApps }: { myApps: AppListItemType[] }) => {
...
@@ -218,6 +218,7 @@ const Chat = ({ myApps }: { myApps: AppListItemType[] }) => {
/>
/>
)
:
(
)
:
(
<
ChatBox
<
ChatBox
isReady=
{
!
loading
}
appId=
{
appId
}
appId=
{
appId
}
chatId=
{
chatId
}
chatId=
{
chatId
}
outLinkAuthData=
{
outLinkAuthData
}
outLinkAuthData=
{
outLinkAuthData
}
...
...
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