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
Commit
9de88491
authored
Sep 13, 2024
by
Patrickill
Committed by
Archer
Sep 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
3d5da270
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
39 deletions
+35
-39
packages/global/common/system/types/index.d.ts
+1
-1
projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/ChatInput.tsx
+2
-2
projects/app/src/components/core/chat/ChatContainer/PluginRunBox/components/RenderOutput.tsx
+2
-2
projects/app/src/components/support/compliance/ComplianceTip.tsx
+20
-23
projects/app/src/pages/dataset/list/component/CreateModal.tsx
+10
-11
No files found.
packages/global/common/system/types/index.d.ts
View file @
9de88491
...
@@ -34,7 +34,7 @@ export type FastGPTFeConfigsType = {
...
@@ -34,7 +34,7 @@ export type FastGPTFeConfigsType = {
show_openai_account
?:
boolean
;
show_openai_account
?:
boolean
;
show_promotion
?:
boolean
;
show_promotion
?:
boolean
;
show_team_chat
?:
boolean
;
show_team_chat
?:
boolean
;
show_compliance_
documentation
?:
boolean
;
show_compliance_
copywriting
?:
boolean
;
concatMd
?:
string
;
concatMd
?:
string
;
docUrl
?:
string
;
docUrl
?:
string
;
...
...
projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/ChatInput.tsx
View file @
9de88491
...
@@ -38,7 +38,7 @@ import { clone } from 'lodash';
...
@@ -38,7 +38,7 @@ import { clone } from 'lodash';
import
{
formatFileSize
}
from
'@fastgpt/global/common/file/tools'
;
import
{
formatFileSize
}
from
'@fastgpt/global/common/file/tools'
;
import
MyBox
from
'@fastgpt/web/components/common/MyBox'
;
import
MyBox
from
'@fastgpt/web/components/common/MyBox'
;
import
{
getErrText
}
from
'@fastgpt/global/common/error/utils'
;
import
{
getErrText
}
from
'@fastgpt/global/common/error/utils'
;
import
ComplianceTip
,
{
TipTypeEnum
}
from
'@/components/support/compliance/ComplianceTip'
;
import
ComplianceTip
from
'@/components/support/compliance/ComplianceTip'
;
const
InputGuideBox
=
dynamic
(()
=>
import
(
'./InputGuideBox'
));
const
InputGuideBox
=
dynamic
(()
=>
import
(
'./InputGuideBox'
));
...
@@ -710,7 +710,7 @@ const ChatInput = ({
...
@@ -710,7 +710,7 @@ const ChatInput = ({
{
RenderTextarea
}
{
RenderTextarea
}
</
Box
>
</
Box
>
<
ComplianceTip
type=
{
TipTypeEnum
.
chat
}
/>
<
ComplianceTip
type=
{
'chat'
}
/>
</
Box
>
</
Box
>
);
);
};
};
...
...
projects/app/src/components/core/chat/ChatContainer/PluginRunBox/components/RenderOutput.tsx
View file @
9de88491
...
@@ -6,7 +6,7 @@ import Markdown from '@/components/Markdown';
...
@@ -6,7 +6,7 @@ import Markdown from '@/components/Markdown';
import
{
FlowNodeTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
FlowNodeTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
AIResponseBox
from
'../../../components/AIResponseBox'
;
import
AIResponseBox
from
'../../../components/AIResponseBox'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
ComplianceTip
,
{
TipTypeEnum
}
from
'@/components/support/compliance/ComplianceTip'
;
import
ComplianceTip
from
'@/components/support/compliance/ComplianceTip'
;
const
RenderOutput
=
()
=>
{
const
RenderOutput
=
()
=>
{
const
{
histories
,
isChatting
}
=
useContextSelector
(
PluginRunContext
,
(
v
)
=>
v
);
const
{
histories
,
isChatting
}
=
useContextSelector
(
PluginRunContext
,
(
v
)
=>
v
);
const
{
t
}
=
useTranslation
();
const
{
t
}
=
useTranslation
();
...
@@ -50,7 +50,7 @@ const RenderOutput = () => {
...
@@ -50,7 +50,7 @@ const RenderOutput = () => {
)
:
null
}
)
:
null
}
</
Box
>
</
Box
>
</
Box
>
</
Box
>
<
ComplianceTip
type=
{
TipTypeEnum
.
chat
}
/>
<
ComplianceTip
type=
{
'chat'
}
/>
</>
</>
);
);
};
};
...
...
projects/app/src/components/support/compliance/ComplianceTip.tsx
View file @
9de88491
...
@@ -2,35 +2,32 @@ import { useSystemStore } from '@/web/common/system/useSystemStore';
...
@@ -2,35 +2,32 @@ import { useSystemStore } from '@/web/common/system/useSystemStore';
import
{
Box
,
BoxProps
}
from
'@chakra-ui/react'
;
import
{
Box
,
BoxProps
}
from
'@chakra-ui/react'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useMemo
}
from
'react'
;
import
{
useMemo
}
from
'react'
;
export
enum
TipTypeEnum
{
chat
=
'chat'
,
const
ChatTip
=
({
type
,
...
props
}:
{
type
:
'chat'
|
'dataset'
}
&
BoxProps
)
=>
{
dataset
=
'dataset'
}
const
ChatTip
=
({
type
,
...
props
}:
{
type
:
`
${
TipTypeEnum
}
`
}
&
BoxProps
)
=>
{
const
{
t
}
=
useTranslation
();
const
{
t
}
=
useTranslation
();
const
{
feConfigs
}
=
useSystemStore
();
const
{
feConfigs
}
=
useSystemStore
();
const
textMap
=
useMemo
(()
=>
{
const
textMap
=
useMemo
(()
=>
{
return
{
return
{
[
TipTypeEnum
.
chat
]
:
t
(
'common:compliance.chat'
),
chat
:
t
(
'common:compliance.chat'
),
[
TipTypeEnum
.
dataset
]
:
t
(
'common:compliance.dataset'
)
dataset
:
t
(
'common:compliance.dataset'
)
};
};
},
[
t
]);
},
[
t
]);
return
(
feConfigs
.
show_compliance_documentation
&&
(
return
feConfigs
.
show_compliance_copywriting
?
(
<
Box
<
Box
w=
{
'100%'
}
w=
{
'100%'
}
textAlign=
{
'center'
}
textAlign=
{
'center'
}
fontSize=
{
'0.6875rem'
}
fontSize=
{
'0.6875rem'
}
fontWeight=
{
'400'
}
fontWeight=
{
'400'
}
pt=
{
3
}
pt=
{
3
}
pb=
{
[
3
,
0
]
}
pb=
{
[
3
,
0
]
}
color=
{
'myGray.400'
}
color=
{
'myGray.400'
}
{
...
props
}
{
...
props
}
>
>
{
textMap
[
type
]
}
{
textMap
[
type
]
}
</
Box
>
</
Box
>
)
)
:
null
;
);
};
};
export
default
ChatTip
;
export
default
ChatTip
;
projects/app/src/pages/dataset/list/component/CreateModal.tsx
View file @
9de88491
...
@@ -20,7 +20,7 @@ import AIModelSelector from '@/components/Select/AIModelSelector';
...
@@ -20,7 +20,7 @@ import AIModelSelector from '@/components/Select/AIModelSelector';
import
MyIcon
from
'@fastgpt/web/components/common/Icon'
;
import
MyIcon
from
'@fastgpt/web/components/common/Icon'
;
import
{
useSystem
}
from
'@fastgpt/web/hooks/useSystem'
;
import
{
useSystem
}
from
'@fastgpt/web/hooks/useSystem'
;
import
QuestionTip
from
'@fastgpt/web/components/common/MyTooltip/QuestionTip'
;
import
QuestionTip
from
'@fastgpt/web/components/common/MyTooltip/QuestionTip'
;
import
ComplianceTip
,
{
TipTypeEnum
}
from
'@/components/support/compliance/ComplianceTip'
;
import
ComplianceTip
from
'@/components/support/compliance/ComplianceTip'
;
export
type
CreateDatasetType
=
export
type
CreateDatasetType
=
|
DatasetTypeEnum
.
dataset
|
DatasetTypeEnum
.
dataset
...
@@ -225,20 +225,19 @@ const CreateModal = ({
...
@@ -225,20 +225,19 @@ const CreateModal = ({
</
Box
>
</
Box
>
</
Flex
>
</
Flex
>
)
}
)
}
<
Flex
w=
{
'100%'
}
pt=
{
6
}
justifyContent=
{
'flex-end'
}
>
<
Button
variant=
{
'whiteBase'
}
mr=
{
3
}
onClick=
{
onClose
}
>
{
t
(
'common:common.Close'
)
}
</
Button
>
<
Button
isLoading=
{
creating
}
onClick=
{
handleSubmit
((
data
)
=>
onclickCreate
(
data
))
}
>
{
t
(
'common:common.Confirm Create'
)
}
</
Button
>
</
Flex
>
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
px=
{
9
}
pt=
{
0
}
>
<
ModalFooter
px=
{
9
}
>
<
ComplianceTip
pt=
{
0
}
type=
{
TipTypeEnum
.
dataset
}
/>
<
Button
variant=
{
'whiteBase'
}
mr=
{
3
}
onClick=
{
onClose
}
>
{
t
(
'common:common.Close'
)
}
</
Button
>
<
Button
isLoading=
{
creating
}
onClick=
{
handleSubmit
((
data
)
=>
onclickCreate
(
data
))
}
>
{
t
(
'common:common.Confirm Create'
)
}
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
<
ComplianceTip
pb=
{
6
}
pt=
{
0
}
px=
{
9
}
type=
{
'dataset'
}
/>
<
File
onSelect=
{
onSelectFile
}
/>
<
File
onSelect=
{
onSelectFile
}
/>
</
MyModal
>
</
MyModal
>
);
);
...
...
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