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
6fd83e1e
authored
Jul 23, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: tooltip
parent
ea35ad21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
37 additions
and
19 deletions
+37
-19
client/src/components/ChatBox/ResponseDetailModal.tsx
+2
-2
client/src/constants/model.ts
+1
-2
client/src/pages/api/admin/initv4.ts
+0
-0
client/src/pages/app/detail/components/BasicEdit/index.tsx
+4
-4
client/src/pages/app/detail/components/Edit/components/Nodes/NodeUserGuide.tsx
+1
-1
client/src/pages/app/detail/components/Edit/components/modules/Label.tsx
+1
-1
client/src/pages/app/detail/components/Edit/components/modules/NodeCard.tsx
+1
-1
client/src/pages/app/detail/components/Edit/components/render/RenderInput.tsx
+1
-1
client/src/pages/app/detail/components/Edit/components/render/RenderOutput.tsx
+1
-1
client/src/pages/app/detail/components/KBSelectModal.tsx
+1
-1
client/src/pages/app/detail/components/Share.tsx
+4
-1
client/src/pages/kb/detail/components/Import/Chunk.tsx
+5
-1
client/src/pages/kb/detail/components/Import/Csv.tsx
+1
-0
client/src/pages/kb/detail/components/Import/FileSelect.tsx
+7
-1
client/src/pages/kb/detail/components/Import/QA.tsx
+5
-1
client/src/pages/kb/detail/components/Info.tsx
+1
-1
client/src/pages/kb/detail/components/Test.tsx
+1
-0
No files found.
client/src/components/ChatBox/ResponseDetailModal.tsx
View file @
6fd83e1e
...
@@ -17,8 +17,6 @@ const ResponseDetailModal = ({
...
@@ -17,8 +17,6 @@ const ResponseDetailModal = ({
contentId
?:
string
;
contentId
?:
string
;
responseData
?:
ChatHistoryItemResType
[];
responseData
?:
ChatHistoryItemResType
[];
})
=>
{
})
=>
{
console
.
log
(
responseData
);
const
[
quoteModalData
,
setQuoteModalData
]
=
useState
<
QuoteItemType
[]
>
();
const
[
quoteModalData
,
setQuoteModalData
]
=
useState
<
QuoteItemType
[]
>
();
const
{
const
{
...
@@ -62,9 +60,11 @@ const ResponseDetailModal = ({
...
@@ -62,9 +60,11 @@ const ResponseDetailModal = ({
</
MyTooltip
>
</
MyTooltip
>
)
}
)
}
{
completeMessages
.
length
>
0
&&
(
{
completeMessages
.
length
>
0
&&
(
<
MyTooltip
label=
{
'提示词和限定词分别算 1 条上下文'
}
forceShow
>
<
Tag
colorSchema=
"green"
cursor=
{
'default'
}
{
...
TagStyles
}
>
<
Tag
colorSchema=
"green"
cursor=
{
'default'
}
{
...
TagStyles
}
>
{
completeMessages
.
length
}
条上下文
{
completeMessages
.
length
}
条上下文
</
Tag
>
</
Tag
>
</
MyTooltip
>
)
}
)
}
{
tokens
>
0
&&
(
{
tokens
>
0
&&
(
<
Tag
colorSchema=
"gray"
cursor=
{
'default'
}
{
...
TagStyles
}
>
<
Tag
colorSchema=
"gray"
cursor=
{
'default'
}
{
...
TagStyles
}
>
...
...
client/src/constants/model.ts
View file @
6fd83e1e
...
@@ -24,6 +24,5 @@ export const defaultApp: AppSchema = {
...
@@ -24,6 +24,5 @@ export const defaultApp: AppSchema = {
};
};
export
const
defaultShareChat
:
ShareChatEditType
=
{
export
const
defaultShareChat
:
ShareChatEditType
=
{
name
:
''
,
name
:
''
maxContext
:
5
};
};
client/src/pages/api/admin/initv4.ts
View file @
6fd83e1e
This diff is collapsed.
Click to expand it.
client/src/pages/app/detail/components/BasicEdit/index.tsx
View file @
6fd83e1e
...
@@ -174,7 +174,7 @@ const Settings = ({ appId }: { appId: string }) => {
...
@@ -174,7 +174,7 @@ const Settings = ({ appId }: { appId: string }) => {
<
Flex
pr=
{
4
}
justifyContent=
{
'space-between'
}
>
<
Flex
pr=
{
4
}
justifyContent=
{
'space-between'
}
>
<
Box
fontSize=
{
[
'md'
,
'xl'
]
}
fontWeight=
{
'bold'
}
>
<
Box
fontSize=
{
[
'md'
,
'xl'
]
}
fontWeight=
{
'bold'
}
>
应用配置
应用配置
<
MyTooltip
label=
{
'仅包含基础功能,复杂 agent 功能请使用高级编排。'
}
>
<
MyTooltip
label=
{
'仅包含基础功能,复杂 agent 功能请使用高级编排。'
}
forceShow
>
<
QuestionOutlineIcon
ml=
{
2
}
fontSize=
{
'md'
}
/>
<
QuestionOutlineIcon
ml=
{
2
}
fontSize=
{
'md'
}
/>
</
MyTooltip
>
</
MyTooltip
>
</
Box
>
</
Box
>
...
@@ -309,7 +309,7 @@ const Settings = ({ appId }: { appId: string }) => {
...
@@ -309,7 +309,7 @@ const Settings = ({ appId }: { appId: string }) => {
<
Flex
mt=
{
10
}
alignItems=
{
'flex-start'
}
>
<
Flex
mt=
{
10
}
alignItems=
{
'flex-start'
}
>
<
Box
{
...
LabelStyles
}
>
<
Box
{
...
LabelStyles
}
>
提示词
提示词
<
MyTooltip
label=
{
ChatModelSystemTip
}
>
<
MyTooltip
label=
{
ChatModelSystemTip
}
forceShow
>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
</
Box
>
</
Box
>
...
@@ -323,7 +323,7 @@ const Settings = ({ appId }: { appId: string }) => {
...
@@ -323,7 +323,7 @@ const Settings = ({ appId }: { appId: string }) => {
<
Flex
mt=
{
5
}
alignItems=
{
'flex-start'
}
>
<
Flex
mt=
{
5
}
alignItems=
{
'flex-start'
}
>
<
Box
{
...
LabelStyles
}
>
<
Box
{
...
LabelStyles
}
>
限定词
限定词
<
MyTooltip
label=
{
ChatModelLimitTip
}
>
<
MyTooltip
label=
{
ChatModelLimitTip
}
forceShow
>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
</
Box
>
</
Box
>
...
@@ -381,7 +381,7 @@ const Settings = ({ appId }: { appId: string }) => {
...
@@ -381,7 +381,7 @@ const Settings = ({ appId }: { appId: string }) => {
<
Flex
alignItems=
{
'center'
}
>
<
Flex
alignItems=
{
'center'
}
>
<
Avatar
src=
{
'/imgs/module/userGuide.png'
}
w=
{
'18px'
}
/>
<
Avatar
src=
{
'/imgs/module/userGuide.png'
}
w=
{
'18px'
}
/>
<
Box
mx=
{
2
}
>
对话开场白
</
Box
>
<
Box
mx=
{
2
}
>
对话开场白
</
Box
>
<
MyTooltip
label=
{
welcomeTextTip
}
>
<
MyTooltip
label=
{
welcomeTextTip
}
forceShow
>
<
QuestionOutlineIcon
/>
<
QuestionOutlineIcon
/>
</
MyTooltip
>
</
MyTooltip
>
</
Flex
>
</
Flex
>
...
...
client/src/pages/app/detail/components/Edit/components/Nodes/NodeUserGuide.tsx
View file @
6fd83e1e
...
@@ -26,7 +26,7 @@ const NodeUserGuide = ({
...
@@ -26,7 +26,7 @@ const NodeUserGuide = ({
<
Flex
mb=
{
1
}
alignItems=
{
'center'
}
>
<
Flex
mb=
{
1
}
alignItems=
{
'center'
}
>
<
MyIcon
name=
{
'welcomeText'
}
mr=
{
2
}
w=
{
'16px'
}
color=
{
'#E74694'
}
/>
<
MyIcon
name=
{
'welcomeText'
}
mr=
{
2
}
w=
{
'16px'
}
color=
{
'#E74694'
}
/>
<
Box
>
开场白
</
Box
>
<
Box
>
开场白
</
Box
>
<
MyTooltip
label=
{
welcomeTextTip
}
>
<
MyTooltip
label=
{
welcomeTextTip
}
forceShow
>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
</
Flex
>
</
Flex
>
...
...
client/src/pages/app/detail/components/Edit/components/modules/Label.tsx
View file @
6fd83e1e
...
@@ -20,7 +20,7 @@ const Label = ({
...
@@ -20,7 +20,7 @@ const Label = ({
</
Box
>
</
Box
>
)
}
)
}
{
description
&&
(
{
description
&&
(
<
MyTooltip
label=
{
description
}
>
<
MyTooltip
label=
{
description
}
forceShow
>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
fontSize=
{
'12px'
}
mb=
{
1
}
ml=
{
1
}
/>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
fontSize=
{
'12px'
}
mb=
{
1
}
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
)
}
)
}
...
...
client/src/pages/app/detail/components/Edit/components/modules/NodeCard.tsx
View file @
6fd83e1e
...
@@ -36,7 +36,7 @@ const NodeCard = ({
...
@@ -36,7 +36,7 @@ const NodeCard = ({
{
name
}
{
name
}
</
Box
>
</
Box
>
{
description
&&
(
{
description
&&
(
<
MyTooltip
label=
{
description
}
>
<
MyTooltip
label=
{
description
}
forceShow
>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
)
}
)
}
...
...
client/src/pages/app/detail/components/Edit/components/render/RenderInput.tsx
View file @
6fd83e1e
...
@@ -34,7 +34,7 @@ export const Label = ({
...
@@ -34,7 +34,7 @@ export const Label = ({
</
Box
>
</
Box
>
)
}
)
}
{
description
&&
(
{
description
&&
(
<
MyTooltip
label=
{
description
}
>
<
MyTooltip
label=
{
description
}
forceShow
>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
)
}
)
}
...
...
client/src/pages/app/detail/components/Edit/components/render/RenderOutput.tsx
View file @
6fd83e1e
...
@@ -15,7 +15,7 @@ const Label = ({
...
@@ -15,7 +15,7 @@ const Label = ({
})
=>
(
})
=>
(
<
Flex
as=
{
'label'
}
justifyContent=
{
'right'
}
alignItems=
{
'center'
}
position=
{
'relative'
}
>
<
Flex
as=
{
'label'
}
justifyContent=
{
'right'
}
alignItems=
{
'center'
}
position=
{
'relative'
}
>
{
description
&&
(
{
description
&&
(
<
MyTooltip
label=
{
description
}
>
<
MyTooltip
label=
{
description
}
forceShow
>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
mr=
{
1
}
/>
<
QuestionOutlineIcon
display=
{
[
'none'
,
'inline'
]
}
mr=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
)
}
)
}
...
...
client/src/pages/app/detail/components/KBSelectModal.tsx
View file @
6fd83e1e
...
@@ -146,7 +146,7 @@ export const KbParamsModal = ({
...
@@ -146,7 +146,7 @@ export const KbParamsModal = ({
<
Box
display=
{
[
'block'
,
'flex'
]
}
pt=
{
3
}
pb=
{
5
}
>
<
Box
display=
{
[
'block'
,
'flex'
]
}
pt=
{
3
}
pb=
{
5
}
>
<
Box
flex=
{
'0 0 100px'
}
mb=
{
[
8
,
0
]
}
>
<
Box
flex=
{
'0 0 100px'
}
mb=
{
[
8
,
0
]
}
>
相似度
相似度
<
MyTooltip
label=
{
'高相似度推荐0.8及以上。'
}
>
<
MyTooltip
label=
{
'高相似度推荐0.8及以上。'
}
forceShow
>
<
QuestionOutlineIcon
ml=
{
1
}
/>
<
QuestionOutlineIcon
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
</
Box
>
</
Box
>
...
...
client/src/pages/app/detail/components/Share.tsx
View file @
6fd83e1e
...
@@ -88,7 +88,10 @@ const Share = ({ appId }: { appId: string }) => {
...
@@ -88,7 +88,10 @@ const Share = ({ appId }: { appId: string }) => {
<
Flex
justifyContent=
{
'space-between'
}
>
<
Flex
justifyContent=
{
'space-between'
}
>
<
Box
fontWeight=
{
'bold'
}
>
<
Box
fontWeight=
{
'bold'
}
>
免登录聊天窗口
免登录聊天窗口
<
MyTooltip
label=
"可以直接分享该模型给其他用户去进行对话,对方无需登录即可直接进行对话。注意,这个功能会消耗你账号的tokens。请保管好链接和密码。"
>
<
MyTooltip
forceShow
label=
"可以直接分享该模型给其他用户去进行对话,对方无需登录即可直接进行对话。注意,这个功能会消耗你账号的tokens。请保管好链接和密码。"
>
<
QuestionOutlineIcon
ml=
{
1
}
/>
<
QuestionOutlineIcon
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
</
Box
>
</
Box
>
...
...
client/src/pages/kb/detail/components/Import/Chunk.tsx
View file @
6fd83e1e
...
@@ -260,6 +260,7 @@ const ChunkImport = ({ kbId }: { kbId: string }) => {
...
@@ -260,6 +260,7 @@ const ChunkImport = ({ kbId }: { kbId: string }) => {
段落长度
段落长度
<
MyTooltip
<
MyTooltip
label=
{
'基于 Gpt3.5 的 Token 计算方法进行分段。前后段落会有 30% 的内容重叠。'
}
label=
{
'基于 Gpt3.5 的 Token 计算方法进行分段。前后段落会有 30% 的内容重叠。'
}
forceShow
>
>
<
QuestionOutlineIcon
ml=
{
1
}
/>
<
QuestionOutlineIcon
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
...
@@ -287,7 +288,10 @@ const ChunkImport = ({ kbId }: { kbId: string }) => {
...
@@ -287,7 +288,10 @@ const ChunkImport = ({ kbId }: { kbId: string }) => {
<
Flex
py=
{
5
}
alignItems=
{
'center'
}
>
<
Flex
py=
{
5
}
alignItems=
{
'center'
}
>
<
Box
>
<
Box
>
预估价格
预估价格
<
MyTooltip
label=
{
`索引生成计费为: ${formatPrice(unitPrice, 1000)}/1k tokens`
}
>
<
MyTooltip
label=
{
`索引生成计费为: ${formatPrice(unitPrice, 1000)}/1k tokens`
}
forceShow
>
<
QuestionOutlineIcon
ml=
{
1
}
/>
<
QuestionOutlineIcon
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
</
Box
>
</
Box
>
...
...
client/src/pages/kb/detail/components/Import/Csv.tsx
View file @
6fd83e1e
...
@@ -135,6 +135,7 @@ const CsvImport = ({ kbId }: { kbId: string }) => {
...
@@ -135,6 +135,7 @@ const CsvImport = ({ kbId }: { kbId: string }) => {
fileExtension=
{
fileExtension
}
fileExtension=
{
fileExtension
}
onSelectFile=
{
onSelectFile
}
onSelectFile=
{
onSelectFile
}
isLoading=
{
selecting
}
isLoading=
{
selecting
}
tipText=
{
'如果导入文件乱码,请将 CSV 转成 utf-8 编码格式'
}
py=
{
emptyFiles
?
'100px'
:
5
}
py=
{
emptyFiles
?
'100px'
:
5
}
/>
/>
...
...
client/src/pages/kb/detail/components/Import/FileSelect.tsx
View file @
6fd83e1e
...
@@ -7,11 +7,12 @@ import MyIcon from '@/components/Icon';
...
@@ -7,11 +7,12 @@ import MyIcon from '@/components/Icon';
interface
Props
extends
BoxProps
{
interface
Props
extends
BoxProps
{
fileExtension
:
string
;
fileExtension
:
string
;
tipText
?:
string
;
onSelectFile
:
(
files
:
File
[])
=>
Promise
<
void
>
;
onSelectFile
:
(
files
:
File
[])
=>
Promise
<
void
>
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
}
}
const
FileSelect
=
({
fileExtension
,
onSelectFile
,
isLoading
,
...
props
}:
Props
)
=>
{
const
FileSelect
=
({
fileExtension
,
onSelectFile
,
isLoading
,
tipText
,
...
props
}:
Props
)
=>
{
const
{
Loading
:
FileSelectLoading
}
=
useLoading
();
const
{
Loading
:
FileSelectLoading
}
=
useLoading
();
const
{
File
,
onOpen
}
=
useSelectFile
({
const
{
File
,
onOpen
}
=
useSelectFile
({
...
@@ -41,6 +42,11 @@ const FileSelect = ({ fileExtension, onSelectFile, isLoading, ...props }: Props)
...
@@ -41,6 +42,11 @@ const FileSelect = ({ fileExtension, onSelectFile, isLoading, ...props }: Props)
</
Box
>
</
Box
>
</
Flex
>
</
Flex
>
<
Box
mt=
{
1
}
>
支持
{
fileExtension
}
文件
</
Box
>
<
Box
mt=
{
1
}
>
支持
{
fileExtension
}
文件
</
Box
>
{
tipText
&&
(
<
Box
mt=
{
1
}
fontSize=
{
'sm'
}
color=
{
'myGray.600'
}
>
{
tipText
}
</
Box
>
)
}
<
FileSelectLoading
loading=
{
isLoading
}
fixed=
{
false
}
/>
<
FileSelectLoading
loading=
{
isLoading
}
fixed=
{
false
}
/>
<
File
onSelect=
{
onSelectFile
}
/>
<
File
onSelect=
{
onSelectFile
}
/>
</
Box
>
</
Box
>
...
...
client/src/pages/kb/detail/components/Import/QA.tsx
View file @
6fd83e1e
...
@@ -263,6 +263,7 @@ const QAImport = ({ kbId }: { kbId: string }) => {
...
@@ -263,6 +263,7 @@ const QAImport = ({ kbId }: { kbId: string }) => {
QA 拆分引导词
{
' '
}
QA 拆分引导词
{
' '
}
<
MyTooltip
<
MyTooltip
label=
{
`可输入关于文件内容的范围介绍,例如:\n1. 关于 Laf 的介绍\n2. xxx的简历`
}
label=
{
`可输入关于文件内容的范围介绍,例如:\n1. 关于 Laf 的介绍\n2. xxx的简历`
}
forceShow
>
>
<
QuestionOutlineIcon
ml=
{
1
}
/>
<
QuestionOutlineIcon
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
...
@@ -282,7 +283,10 @@ const QAImport = ({ kbId }: { kbId: string }) => {
...
@@ -282,7 +283,10 @@ const QAImport = ({ kbId }: { kbId: string }) => {
<
Flex
py=
{
5
}
alignItems=
{
'center'
}
>
<
Flex
py=
{
5
}
alignItems=
{
'center'
}
>
<
Box
>
<
Box
>
预估价格
预估价格
<
MyTooltip
label=
{
`索引生成计费为: ${formatPrice(unitPrice, 1000)}/1k tokens`
}
>
<
MyTooltip
label=
{
`索引生成计费为: ${formatPrice(unitPrice, 1000)}/1k tokens`
}
forceShow
>
<
QuestionOutlineIcon
ml=
{
1
}
/>
<
QuestionOutlineIcon
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
</
Box
>
</
Box
>
...
...
client/src/pages/kb/detail/components/Info.tsx
View file @
6fd83e1e
...
@@ -201,7 +201,7 @@ const Info = (
...
@@ -201,7 +201,7 @@ const Info = (
<
Flex
mt=
{
8
}
alignItems=
{
'center'
}
w=
{
'100%'
}
flexWrap=
{
'wrap'
}
>
<
Flex
mt=
{
8
}
alignItems=
{
'center'
}
w=
{
'100%'
}
flexWrap=
{
'wrap'
}
>
<
Box
flex=
{
[
'0 0 90px'
,
'0 0 160px'
]
}
w=
{
0
}
>
<
Box
flex=
{
[
'0 0 90px'
,
'0 0 160px'
]
}
w=
{
0
}
>
分类标签
分类标签
<
MyTooltip
label=
{
'用空格隔开多个标签,便于搜索'
}
>
<
MyTooltip
label=
{
'用空格隔开多个标签,便于搜索'
}
forceShow
>
<
QuestionOutlineIcon
ml=
{
1
}
/>
<
QuestionOutlineIcon
ml=
{
1
}
/>
</
MyTooltip
>
</
MyTooltip
>
</
Box
>
</
Box
>
...
...
client/src/pages/kb/detail/components/Test.tsx
View file @
6fd83e1e
...
@@ -161,6 +161,7 @@ const Test = ({ kbId }: { kbId: string }) => {
...
@@ -161,6 +161,7 @@ const Test = ({ kbId }: { kbId: string }) => {
label=
{
label=
{
'根据知识库内容与测试文本的相似度进行排序,你可以根据测试结果调整对应的文本。\n注意:测试记录中的数据可能已经被修改过,点击某条测试数据后将展示最新的数据。'
'根据知识库内容与测试文本的相似度进行排序,你可以根据测试结果调整对应的文本。\n注意:测试记录中的数据可能已经被修改过,点击某条测试数据后将展示最新的数据。'
}
}
forceShow
>
>
<
QuestionOutlineIcon
<
QuestionOutlineIcon
ml=
{
2
}
ml=
{
2
}
...
...
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