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
cc01aa4a
authored
Apr 28, 2025
by
heheer
Committed by
GitHub
Apr 28, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix share link chat quote number (#4690)
* fix share link chat quote number * fix ts * usememo
parent
d6fed3d2
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
39 additions
and
8 deletions
+39
-8
projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ChatItem.tsx
+3
-1
projects/app/src/components/core/chat/components/AIResponseBox.tsx
+12
-2
projects/app/src/pageComponents/app/detail/Logs/DetailLogsModal.tsx
+1
-0
projects/app/src/pageComponents/app/detail/MCPTools/ChatTest.tsx
+1
-0
projects/app/src/pageComponents/app/detail/SimpleApp/ChatTest.tsx
+1
-0
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/ChatTest.tsx
+1
-0
projects/app/src/pages/api/core/app/httpPlugin/create.ts
+6
-3
projects/app/src/pages/api/core/app/mcpTools/create.ts
+4
-1
projects/app/src/pages/chat/index.tsx
+1
-0
projects/app/src/pages/chat/share.tsx
+4
-1
projects/app/src/pages/chat/team.tsx
+1
-0
projects/app/src/web/core/chat/context/chatItemContext.tsx
+4
-0
No files found.
projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ChatItem.tsx
View file @
cc01aa4a
...
...
@@ -251,6 +251,7 @@ const ChatItem = (props: Props) => {
chatId
:
chatId
,
chatItemDataId
:
chat
.
dataId
,
collectionId
:
collectionId
,
collectionIdList
,
sourceId
:
sourceId
||
''
,
sourceName
:
sourceName
||
''
,
datasetId
:
datasetId
||
''
,
...
...
@@ -272,11 +273,12 @@ const ChatItem = (props: Props) => {
);
useEffect
(()
=>
{
if
(
chat
.
obj
!==
ChatRoleEnum
.
AI
)
return
;
eventBus
.
on
(
EventNameEnum
.
openQuoteReader
,
handleOpenQuoteReader
);
return
()
=>
{
eventBus
.
off
(
EventNameEnum
.
openQuoteReader
);
};
},
[
handleOpenQuoteReader
]);
},
[
chat
.
obj
,
handleOpenQuoteReader
]);
return
(
<
Box
...
...
projects/app/src/components/core/chat/components/AIResponseBox.tsx
View file @
cc01aa4a
...
...
@@ -29,6 +29,8 @@ import { useTranslation } from 'next-i18next';
import
{
eventBus
,
EventNameEnum
}
from
'@/web/common/utils/eventbus'
;
import
{
SelectOptionsComponent
,
FormInputComponent
}
from
'./Interactive/InteractiveComponents'
;
import
{
extractDeepestInteractive
}
from
'@fastgpt/global/core/workflow/runtime/utils'
;
import
{
useContextSelector
}
from
'use-context-selector'
;
import
{
ChatItemContext
}
from
'@/web/core/chat/context/chatItemContext'
;
const
accordionButtonStyle
=
{
w
:
'auto'
,
...
...
@@ -88,9 +90,17 @@ const RenderText = React.memo(function RenderText({
text
}:
{
showAnimation
:
boolean
;
text
?
:
string
;
text
:
string
;
})
{
let
source
=
text
||
''
;
const
isResponseDetail
=
useContextSelector
(
ChatItemContext
,
(
v
)
=>
v
.
isResponseDetail
);
const
source
=
useMemo
(()
=>
{
if
(
!
text
)
return
''
;
// Remove quote references if not showing response detail
return
isResponseDetail
?
text
:
text
.
replace
(
/
\[[
a-f0-9
]{24}\]\(
QUOTE
\)
/g
,
''
);
},
[
text
,
isResponseDetail
]);
// First empty line
// if (!source && !isLastChild) return null;
...
...
projects/app/src/pageComponents/app/detail/Logs/DetailLogsModal.tsx
View file @
cc01aa4a
...
...
@@ -213,6 +213,7 @@ const Render = (props: Props) => {
showRouteToAppDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
showNodeStatus
>
...
...
projects/app/src/pageComponents/app/detail/MCPTools/ChatTest.tsx
View file @
cc01aa4a
...
...
@@ -152,6 +152,7 @@ const Render = ({ currentTool, url }: { currentTool: ToolType | null; url: strin
showRouteToAppDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
showNodeStatus
>
...
...
projects/app/src/pageComponents/app/detail/SimpleApp/ChatTest.tsx
View file @
cc01aa4a
...
...
@@ -119,6 +119,7 @@ const Render = ({ appForm, setRenderEdit }: Props) => {
showRouteToAppDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
showNodeStatus
>
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/ChatTest.tsx
View file @
cc01aa4a
...
...
@@ -195,6 +195,7 @@ const Render = (Props: Props) => {
showRouteToAppDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
showNodeStatus
>
...
...
projects/app/src/pages/api/core/app/httpPlugin/create.ts
View file @
cc01aa4a
...
...
@@ -35,9 +35,9 @@ async function handler(
?
await
authApp
({
req
,
appId
:
parentId
,
per
:
TeamAppCreatePermissionVal
,
authToken
:
true
})
:
await
authUserPer
({
req
,
authToken
:
true
,
per
:
TeamAppCreatePermissionVal
});
await
mongoSessionRun
(
async
(
session
)
=>
{
const
httpPluginId
=
await
mongoSessionRun
(
async
(
session
)
=>
{
// create http plugin folder
const
httpPluginI
i
d
=
await
onCreateApp
({
const
httpPluginId
=
await
onCreateApp
({
parentId
,
name
,
avatar
,
...
...
@@ -51,7 +51,7 @@ async function handler(
// compute children plugins
const
childrenPlugins
=
await
httpApiSchema2Plugins
({
parentId
:
httpPluginI
i
d
,
parentId
:
httpPluginId
,
apiSchemaStr
:
pluginData
.
apiSchemaStr
,
customHeader
:
pluginData
.
customHeaders
});
...
...
@@ -65,10 +65,13 @@ async function handler(
session
});
}
return
httpPluginId
;
});
pushTrack
.
createApp
({
type
:
AppTypeEnum
.
httpPlugin
,
appId
:
httpPluginId
,
uid
:
userId
,
teamId
,
tmbId
...
...
projects/app/src/pages/api/core/app/mcpTools/create.ts
View file @
cc01aa4a
...
...
@@ -35,7 +35,7 @@ async function handler(
?
await
authApp
({
req
,
appId
:
parentId
,
per
:
TeamAppCreatePermissionVal
,
authToken
:
true
})
:
await
authUserPer
({
req
,
authToken
:
true
,
per
:
TeamAppCreatePermissionVal
});
await
mongoSessionRun
(
async
(
session
)
=>
{
const
mcpToolsId
=
await
mongoSessionRun
(
async
(
session
)
=>
{
const
mcpToolsId
=
await
onCreateApp
({
name
,
avatar
,
...
...
@@ -60,10 +60,13 @@ async function handler(
session
});
}
return
mcpToolsId
;
});
pushTrack
.
createApp
({
type
:
AppTypeEnum
.
toolSet
,
appId
:
mcpToolsId
,
uid
:
userId
,
teamId
,
tmbId
...
...
projects/app/src/pages/chat/index.tsx
View file @
cc01aa4a
...
...
@@ -294,6 +294,7 @@ const Render = (props: { appId: string; isStandalone?: string }) => {
showRouteToAppDetail=
{
isStandalone
!==
'1'
}
showRouteToDatasetDetail=
{
isStandalone
!==
'1'
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
showNodeStatus
>
...
...
projects/app/src/pages/chat/share.tsx
View file @
cc01aa4a
...
...
@@ -50,6 +50,7 @@ type Props = {
authToken
:
string
;
customUid
:
string
;
showRawSource
:
boolean
;
responseDetail
:
boolean
;
// showFullText: boolean;
showNodeStatus
:
boolean
;
};
...
...
@@ -369,6 +370,7 @@ const Render = (props: Props) => {
showRouteToAppDetail=
{
false
}
showRouteToDatasetDetail=
{
false
}
isShowReadRawSource=
{
props
.
showRawSource
}
isResponseDetail=
{
props
.
responseDetail
}
// isShowFullText={props.showFullText}
showNodeStatus=
{
props
.
showNodeStatus
}
>
...
...
@@ -395,7 +397,7 @@ export async function getServerSideProps(context: any) {
{
shareId
},
'appId showRawSource showNodeStatus'
'appId showRawSource showNodeStatus
responseDetail
'
)
.
populate
<
{
associatedApp
:
AppSchema
}
>
(
'associatedApp'
,
'name avatar intro'
)
.
lean
();
...
...
@@ -412,6 +414,7 @@ export async function getServerSideProps(context: any) {
appAvatar
:
app
?.
associatedApp
?.
avatar
??
''
,
appIntro
:
app
?.
associatedApp
?.
intro
??
'AI'
,
showRawSource
:
app
?.
showRawSource
??
false
,
responseDetail
:
app
?.
responseDetail
??
false
,
// showFullText: app?.showFullText ?? false,
showNodeStatus
:
app
?.
showNodeStatus
??
false
,
shareId
:
shareId
??
''
,
...
...
projects/app/src/pages/chat/team.tsx
View file @
cc01aa4a
...
...
@@ -314,6 +314,7 @@ const Render = (props: Props) => {
showRouteToAppDetail=
{
false
}
showRouteToDatasetDetail=
{
false
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
showNodeStatus
>
...
...
projects/app/src/web/core/chat/context/chatItemContext.tsx
View file @
cc01aa4a
...
...
@@ -15,6 +15,7 @@ type ContextProps = {
showRouteToAppDetail
:
boolean
;
showRouteToDatasetDetail
:
boolean
;
isShowReadRawSource
:
boolean
;
isResponseDetail
:
boolean
;
// isShowFullText: boolean;
showNodeStatus
:
boolean
;
};
...
...
@@ -115,6 +116,7 @@ const ChatItemContextProvider = ({
showRouteToAppDetail
,
showRouteToDatasetDetail
,
isShowReadRawSource
,
isResponseDetail
,
// isShowFullText,
showNodeStatus
}:
{
...
...
@@ -177,6 +179,7 @@ const ChatItemContextProvider = ({
showRouteToAppDetail
,
showRouteToDatasetDetail
,
isShowReadRawSource
,
isResponseDetail
,
// isShowFullText,
showNodeStatus
,
...
...
@@ -195,6 +198,7 @@ const ChatItemContextProvider = ({
showRouteToAppDetail
,
showRouteToDatasetDetail
,
isShowReadRawSource
,
isResponseDetail
,
// isShowFullText,
showNodeStatus
,
quoteData
,
...
...
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