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
8bdb35ff
authored
Oct 16, 2024
by
heheer
Committed by
GitHub
Oct 16, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: quote settings default value & zindex & i18n (#2931)
parent
e56965a8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
11 deletions
+17
-11
packages/web/components/common/Textarea/PromptEditor/plugins/VariableLabelPickerPlugin/index.tsx
+1
-1
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/components/ButtonEdge.tsx
+3
-4
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/index.tsx
+0
-1
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/SettingQuotePrompt.tsx
+12
-5
projects/app/src/pages/app/detail/components/WorkflowComponents/utils.tsx
+1
-0
No files found.
packages/web/components/common/Textarea/PromptEditor/plugins/VariableLabelPickerPlugin/index.tsx
View file @
8bdb35ff
...
...
@@ -129,7 +129,7 @@ export default function VariableLabelPickerPlugin({
color={'myGray.600'}
fontWeight={'semibold'}
>
{
item.label
}
{
t(item.label as any)
}
</Box>
</Flex>
{item.children?.map((child) => (
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/components/ButtonEdge.tsx
View file @
8bdb35ff
...
...
@@ -37,7 +37,7 @@ const ButtonEdge = (props: EdgeProps) => {
},
[
nodeList
,
source
,
target
]);
const
defaultZIndex
=
useMemo
(
()
=>
(
nodeList
.
find
((
node
)
=>
node
.
nodeId
===
source
&&
node
.
parentNodeId
)
?
1001
:
0
),
()
=>
(
nodeList
.
find
((
node
)
=>
node
.
nodeId
===
source
&&
node
.
parentNodeId
)
?
2002
:
0
),
[
nodeList
,
source
]
);
...
...
@@ -159,7 +159,7 @@ const ButtonEdge = (props: EdgeProps) => {
bg=
{
'white'
}
borderRadius=
{
'17px'
}
cursor=
{
'pointer'
}
zIndex=
{
9999
}
zIndex=
{
defaultZIndex
+
1000
}
onClick=
{
()
=>
onDelConnect
(
id
)
}
>
<
MyIcon
name=
{
'core/workflow/closeEdge'
}
w=
{
'100%'
}
></
MyIcon
>
...
...
@@ -173,8 +173,7 @@ const ButtonEdge = (props: EdgeProps) => {
pointerEvents=
{
'all'
}
w=
{
highlightEdge
?
'14px'
:
'10px'
}
h=
{
highlightEdge
?
'14px'
:
'10px'
}
// bg=
{'
white
'}
zIndex=
{
highlightEdge
?
1000
:
defaultZIndex
}
zIndex=
{
highlightEdge
?
defaultZIndex
+
1000
:
defaultZIndex
}
>
<
MyIcon
name=
{
'core/workflow/edgeArrow'
}
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/index.tsx
View file @
8bdb35ff
...
...
@@ -160,7 +160,6 @@ const Workflow = () => {
}
:
{})}
onNodeDragStop=
{
onNodeDragStop
}
// deleteKeyCode={[]}
>
<
FlowController
/>
<
HelperLines
horizontal=
{
helperLineHorizontal
}
vertical=
{
helperLineVertical
}
/>
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/SettingQuotePrompt.tsx
View file @
8bdb35ff
import
React
,
{
useCallback
,
useMemo
,
useState
}
from
'react'
;
import
React
,
{
useCallback
,
use
Effect
,
use
Memo
,
useState
}
from
'react'
;
import
type
{
RenderInputProps
}
from
'../type'
;
import
{
Box
,
BoxProps
,
Button
,
Flex
,
ModalFooter
,
useDisclosure
}
from
'@chakra-ui/react'
;
import
MyModal
from
'@fastgpt/web/components/common/MyModal'
;
...
...
@@ -50,16 +50,23 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
const
onChangeNode
=
useContextSelector
(
WorkflowContext
,
(
v
)
=>
v
.
onChangeNode
);
const
nodeList
=
useContextSelector
(
WorkflowContext
,
(
v
)
=>
v
.
nodeList
);
const
{
watch
,
setValue
,
handleSubmit
}
=
useForm
(
{
defaultValues
:
{
const
defaultValues
=
useMemo
(()
=>
{
return
{
quoteTemplate
:
inputs
.
find
((
input
)
=>
input
.
key
===
NodeInputKeyEnum
.
aiChatQuoteTemplate
)?.
value
||
''
,
quotePrompt
:
inputs
.
find
((
input
)
=>
input
.
key
===
NodeInputKeyEnum
.
aiChatQuotePrompt
)?.
value
||
''
,
quoteRole
:
(
inputs
.
find
((
input
)
=>
input
.
key
===
NodeInputKeyEnum
.
aiChatQuoteRole
)?.
value
||
'system'
)
as
AiChatQuoteRoleType
}
});
};
},
[
inputs
]);
const
{
watch
,
setValue
,
handleSubmit
,
reset
}
=
useForm
({
defaultValues
});
useEffect
(()
=>
{
reset
(
defaultValues
);
},
[
defaultValues
,
reset
]);
const
aiChatQuoteTemplate
=
watch
(
'quoteTemplate'
);
const
aiChatQuotePrompt
=
watch
(
'quotePrompt'
);
const
aiChatQuoteRole
=
watch
(
'quoteRole'
);
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/utils.tsx
View file @
8bdb35ff
...
...
@@ -123,6 +123,7 @@ export const getEditorVariables = ({
const
sourceNodeVariables
=
!
sourceNodes
?
[]
:
sourceNodes
.
reverse
()
.
map
((
node
)
=>
{
return
node
.
outputs
.
filter
((
output
)
=>
!!
output
.
label
)
...
...
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