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) => {
...
@@ -251,6 +251,7 @@ const ChatItem = (props: Props) => {
chatId
:
chatId
,
chatId
:
chatId
,
chatItemDataId
:
chat
.
dataId
,
chatItemDataId
:
chat
.
dataId
,
collectionId
:
collectionId
,
collectionId
:
collectionId
,
collectionIdList
,
sourceId
:
sourceId
||
''
,
sourceId
:
sourceId
||
''
,
sourceName
:
sourceName
||
''
,
sourceName
:
sourceName
||
''
,
datasetId
:
datasetId
||
''
,
datasetId
:
datasetId
||
''
,
...
@@ -272,11 +273,12 @@ const ChatItem = (props: Props) => {
...
@@ -272,11 +273,12 @@ const ChatItem = (props: Props) => {
);
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
chat
.
obj
!==
ChatRoleEnum
.
AI
)
return
;
eventBus
.
on
(
EventNameEnum
.
openQuoteReader
,
handleOpenQuoteReader
);
eventBus
.
on
(
EventNameEnum
.
openQuoteReader
,
handleOpenQuoteReader
);
return
()
=>
{
return
()
=>
{
eventBus
.
off
(
EventNameEnum
.
openQuoteReader
);
eventBus
.
off
(
EventNameEnum
.
openQuoteReader
);
};
};
},
[
handleOpenQuoteReader
]);
},
[
chat
.
obj
,
handleOpenQuoteReader
]);
return
(
return
(
<
Box
<
Box
...
...
projects/app/src/components/core/chat/components/AIResponseBox.tsx
View file @
cc01aa4a
...
@@ -29,6 +29,8 @@ import { useTranslation } from 'next-i18next';
...
@@ -29,6 +29,8 @@ import { useTranslation } from 'next-i18next';
import
{
eventBus
,
EventNameEnum
}
from
'@/web/common/utils/eventbus'
;
import
{
eventBus
,
EventNameEnum
}
from
'@/web/common/utils/eventbus'
;
import
{
SelectOptionsComponent
,
FormInputComponent
}
from
'./Interactive/InteractiveComponents'
;
import
{
SelectOptionsComponent
,
FormInputComponent
}
from
'./Interactive/InteractiveComponents'
;
import
{
extractDeepestInteractive
}
from
'@fastgpt/global/core/workflow/runtime/utils'
;
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
=
{
const
accordionButtonStyle
=
{
w
:
'auto'
,
w
:
'auto'
,
...
@@ -88,9 +90,17 @@ const RenderText = React.memo(function RenderText({
...
@@ -88,9 +90,17 @@ const RenderText = React.memo(function RenderText({
text
text
}:
{
}:
{
showAnimation
:
boolean
;
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
// First empty line
// if (!source && !isLastChild) return null;
// 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) => {
...
@@ -213,6 +213,7 @@ const Render = (props: Props) => {
showRouteToAppDetail=
{
true
}
showRouteToAppDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
isShowReadRawSource=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
// isShowFullText={true}
showNodeStatus
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
...
@@ -152,6 +152,7 @@ const Render = ({ currentTool, url }: { currentTool: ToolType | null; url: strin
showRouteToAppDetail=
{
true
}
showRouteToAppDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
isShowReadRawSource=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
// isShowFullText={true}
showNodeStatus
showNodeStatus
>
>
...
...
projects/app/src/pageComponents/app/detail/SimpleApp/ChatTest.tsx
View file @
cc01aa4a
...
@@ -119,6 +119,7 @@ const Render = ({ appForm, setRenderEdit }: Props) => {
...
@@ -119,6 +119,7 @@ const Render = ({ appForm, setRenderEdit }: Props) => {
showRouteToAppDetail=
{
true
}
showRouteToAppDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
isShowReadRawSource=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
// isShowFullText={true}
showNodeStatus
showNodeStatus
>
>
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/ChatTest.tsx
View file @
cc01aa4a
...
@@ -195,6 +195,7 @@ const Render = (Props: Props) => {
...
@@ -195,6 +195,7 @@ const Render = (Props: Props) => {
showRouteToAppDetail=
{
true
}
showRouteToAppDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
showRouteToDatasetDetail=
{
true
}
isShowReadRawSource=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
// isShowFullText={true}
showNodeStatus
showNodeStatus
>
>
...
...
projects/app/src/pages/api/core/app/httpPlugin/create.ts
View file @
cc01aa4a
...
@@ -35,9 +35,9 @@ async function handler(
...
@@ -35,9 +35,9 @@ async function handler(
?
await
authApp
({
req
,
appId
:
parentId
,
per
:
TeamAppCreatePermissionVal
,
authToken
:
true
})
?
await
authApp
({
req
,
appId
:
parentId
,
per
:
TeamAppCreatePermissionVal
,
authToken
:
true
})
:
await
authUserPer
({
req
,
authToken
:
true
,
per
:
TeamAppCreatePermissionVal
});
:
await
authUserPer
({
req
,
authToken
:
true
,
per
:
TeamAppCreatePermissionVal
});
await
mongoSessionRun
(
async
(
session
)
=>
{
const
httpPluginId
=
await
mongoSessionRun
(
async
(
session
)
=>
{
// create http plugin folder
// create http plugin folder
const
httpPluginI
i
d
=
await
onCreateApp
({
const
httpPluginId
=
await
onCreateApp
({
parentId
,
parentId
,
name
,
name
,
avatar
,
avatar
,
...
@@ -51,7 +51,7 @@ async function handler(
...
@@ -51,7 +51,7 @@ async function handler(
// compute children plugins
// compute children plugins
const
childrenPlugins
=
await
httpApiSchema2Plugins
({
const
childrenPlugins
=
await
httpApiSchema2Plugins
({
parentId
:
httpPluginI
i
d
,
parentId
:
httpPluginId
,
apiSchemaStr
:
pluginData
.
apiSchemaStr
,
apiSchemaStr
:
pluginData
.
apiSchemaStr
,
customHeader
:
pluginData
.
customHeaders
customHeader
:
pluginData
.
customHeaders
});
});
...
@@ -65,10 +65,13 @@ async function handler(
...
@@ -65,10 +65,13 @@ async function handler(
session
session
});
});
}
}
return
httpPluginId
;
});
});
pushTrack
.
createApp
({
pushTrack
.
createApp
({
type
:
AppTypeEnum
.
httpPlugin
,
type
:
AppTypeEnum
.
httpPlugin
,
appId
:
httpPluginId
,
uid
:
userId
,
uid
:
userId
,
teamId
,
teamId
,
tmbId
tmbId
...
...
projects/app/src/pages/api/core/app/mcpTools/create.ts
View file @
cc01aa4a
...
@@ -35,7 +35,7 @@ async function handler(
...
@@ -35,7 +35,7 @@ async function handler(
?
await
authApp
({
req
,
appId
:
parentId
,
per
:
TeamAppCreatePermissionVal
,
authToken
:
true
})
?
await
authApp
({
req
,
appId
:
parentId
,
per
:
TeamAppCreatePermissionVal
,
authToken
:
true
})
:
await
authUserPer
({
req
,
authToken
:
true
,
per
:
TeamAppCreatePermissionVal
});
:
await
authUserPer
({
req
,
authToken
:
true
,
per
:
TeamAppCreatePermissionVal
});
await
mongoSessionRun
(
async
(
session
)
=>
{
const
mcpToolsId
=
await
mongoSessionRun
(
async
(
session
)
=>
{
const
mcpToolsId
=
await
onCreateApp
({
const
mcpToolsId
=
await
onCreateApp
({
name
,
name
,
avatar
,
avatar
,
...
@@ -60,10 +60,13 @@ async function handler(
...
@@ -60,10 +60,13 @@ async function handler(
session
session
});
});
}
}
return
mcpToolsId
;
});
});
pushTrack
.
createApp
({
pushTrack
.
createApp
({
type
:
AppTypeEnum
.
toolSet
,
type
:
AppTypeEnum
.
toolSet
,
appId
:
mcpToolsId
,
uid
:
userId
,
uid
:
userId
,
teamId
,
teamId
,
tmbId
tmbId
...
...
projects/app/src/pages/chat/index.tsx
View file @
cc01aa4a
...
@@ -294,6 +294,7 @@ const Render = (props: { appId: string; isStandalone?: string }) => {
...
@@ -294,6 +294,7 @@ const Render = (props: { appId: string; isStandalone?: string }) => {
showRouteToAppDetail=
{
isStandalone
!==
'1'
}
showRouteToAppDetail=
{
isStandalone
!==
'1'
}
showRouteToDatasetDetail=
{
isStandalone
!==
'1'
}
showRouteToDatasetDetail=
{
isStandalone
!==
'1'
}
isShowReadRawSource=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
// isShowFullText={true}
showNodeStatus
showNodeStatus
>
>
...
...
projects/app/src/pages/chat/share.tsx
View file @
cc01aa4a
...
@@ -50,6 +50,7 @@ type Props = {
...
@@ -50,6 +50,7 @@ type Props = {
authToken
:
string
;
authToken
:
string
;
customUid
:
string
;
customUid
:
string
;
showRawSource
:
boolean
;
showRawSource
:
boolean
;
responseDetail
:
boolean
;
// showFullText: boolean;
// showFullText: boolean;
showNodeStatus
:
boolean
;
showNodeStatus
:
boolean
;
};
};
...
@@ -369,6 +370,7 @@ const Render = (props: Props) => {
...
@@ -369,6 +370,7 @@ const Render = (props: Props) => {
showRouteToAppDetail=
{
false
}
showRouteToAppDetail=
{
false
}
showRouteToDatasetDetail=
{
false
}
showRouteToDatasetDetail=
{
false
}
isShowReadRawSource=
{
props
.
showRawSource
}
isShowReadRawSource=
{
props
.
showRawSource
}
isResponseDetail=
{
props
.
responseDetail
}
// isShowFullText={props.showFullText}
// isShowFullText={props.showFullText}
showNodeStatus=
{
props
.
showNodeStatus
}
showNodeStatus=
{
props
.
showNodeStatus
}
>
>
...
@@ -395,7 +397,7 @@ export async function getServerSideProps(context: any) {
...
@@ -395,7 +397,7 @@ export async function getServerSideProps(context: any) {
{
{
shareId
shareId
},
},
'appId showRawSource showNodeStatus'
'appId showRawSource showNodeStatus
responseDetail
'
)
)
.
populate
<
{
associatedApp
:
AppSchema
}
>
(
'associatedApp'
,
'name avatar intro'
)
.
populate
<
{
associatedApp
:
AppSchema
}
>
(
'associatedApp'
,
'name avatar intro'
)
.
lean
();
.
lean
();
...
@@ -412,6 +414,7 @@ export async function getServerSideProps(context: any) {
...
@@ -412,6 +414,7 @@ export async function getServerSideProps(context: any) {
appAvatar
:
app
?.
associatedApp
?.
avatar
??
''
,
appAvatar
:
app
?.
associatedApp
?.
avatar
??
''
,
appIntro
:
app
?.
associatedApp
?.
intro
??
'AI'
,
appIntro
:
app
?.
associatedApp
?.
intro
??
'AI'
,
showRawSource
:
app
?.
showRawSource
??
false
,
showRawSource
:
app
?.
showRawSource
??
false
,
responseDetail
:
app
?.
responseDetail
??
false
,
// showFullText: app?.showFullText ?? false,
// showFullText: app?.showFullText ?? false,
showNodeStatus
:
app
?.
showNodeStatus
??
false
,
showNodeStatus
:
app
?.
showNodeStatus
??
false
,
shareId
:
shareId
??
''
,
shareId
:
shareId
??
''
,
...
...
projects/app/src/pages/chat/team.tsx
View file @
cc01aa4a
...
@@ -314,6 +314,7 @@ const Render = (props: Props) => {
...
@@ -314,6 +314,7 @@ const Render = (props: Props) => {
showRouteToAppDetail=
{
false
}
showRouteToAppDetail=
{
false
}
showRouteToDatasetDetail=
{
false
}
showRouteToDatasetDetail=
{
false
}
isShowReadRawSource=
{
true
}
isShowReadRawSource=
{
true
}
isResponseDetail=
{
true
}
// isShowFullText={true}
// isShowFullText={true}
showNodeStatus
showNodeStatus
>
>
...
...
projects/app/src/web/core/chat/context/chatItemContext.tsx
View file @
cc01aa4a
...
@@ -15,6 +15,7 @@ type ContextProps = {
...
@@ -15,6 +15,7 @@ type ContextProps = {
showRouteToAppDetail
:
boolean
;
showRouteToAppDetail
:
boolean
;
showRouteToDatasetDetail
:
boolean
;
showRouteToDatasetDetail
:
boolean
;
isShowReadRawSource
:
boolean
;
isShowReadRawSource
:
boolean
;
isResponseDetail
:
boolean
;
// isShowFullText: boolean;
// isShowFullText: boolean;
showNodeStatus
:
boolean
;
showNodeStatus
:
boolean
;
};
};
...
@@ -115,6 +116,7 @@ const ChatItemContextProvider = ({
...
@@ -115,6 +116,7 @@ const ChatItemContextProvider = ({
showRouteToAppDetail
,
showRouteToAppDetail
,
showRouteToDatasetDetail
,
showRouteToDatasetDetail
,
isShowReadRawSource
,
isShowReadRawSource
,
isResponseDetail
,
// isShowFullText,
// isShowFullText,
showNodeStatus
showNodeStatus
}:
{
}:
{
...
@@ -177,6 +179,7 @@ const ChatItemContextProvider = ({
...
@@ -177,6 +179,7 @@ const ChatItemContextProvider = ({
showRouteToAppDetail
,
showRouteToAppDetail
,
showRouteToDatasetDetail
,
showRouteToDatasetDetail
,
isShowReadRawSource
,
isShowReadRawSource
,
isResponseDetail
,
// isShowFullText,
// isShowFullText,
showNodeStatus
,
showNodeStatus
,
...
@@ -195,6 +198,7 @@ const ChatItemContextProvider = ({
...
@@ -195,6 +198,7 @@ const ChatItemContextProvider = ({
showRouteToAppDetail
,
showRouteToAppDetail
,
showRouteToDatasetDetail
,
showRouteToDatasetDetail
,
isShowReadRawSource
,
isShowReadRawSource
,
isResponseDetail
,
// isShowFullText,
// isShowFullText,
showNodeStatus
,
showNodeStatus
,
quoteData
,
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