Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
f95eb2df
Commit
f95eb2df
authored
Feb 29, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: filed fold
parent
cbb298cc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
field.tsx
web/app/components/workflow/nodes/_base/components/field.tsx
+15
-2
panel.tsx
...p/components/workflow/nodes/question-classifier/panel.tsx
+1
-0
No files found.
web/app/components/workflow/nodes/_base/components/field.tsx
View file @
f95eb2df
...
...
@@ -2,11 +2,14 @@
import
type
{
FC
}
from
'react'
import
React
from
'react'
import
cn
from
'classnames'
import
{
useBoolean
}
from
'ahooks'
import
{
HelpCircle
}
from
'@/app/components/base/icons/src/vender/line/general'
import
TooltipPlus
from
'@/app/components/base/tooltip-plus'
import
{
ChevronDown
,
ChevronRight
}
from
'@/app/components/base/icons/src/vender/line/arrows'
type
Props
=
{
title
:
string
tooltip
?:
string
supportFold
?:
boolean
children
?:
JSX
.
Element
|
string
|
null
operations
?:
JSX
.
Element
inline
?:
boolean
...
...
@@ -18,7 +21,12 @@ const Filed: FC<Props> = ({
children
,
operations
,
inline
,
supportFold
,
})
=>
{
const
[
fold
,
{
toggle
:
toggleFold
,
}]
=
useBoolean
(
true
)
const
FoldHandler
=
fold
?
ChevronRight
:
ChevronDown
return
(
<
div
className=
{
cn
(
inline
&&
'flex justify-between items-center'
)
}
>
<
div
className=
'flex justify-between items-center'
>
...
...
@@ -31,9 +39,14 @@ const Filed: FC<Props> = ({
)
}
</
div
>
<
div
className=
'flex'
>
{
operations
&&
<
div
>
{
operations
}
</
div
>
}
{
supportFold
&&
(
<
FoldHandler
className=
'w-3.5 h-3.5 text-gray-500 cursor-pointer'
onClick=
{
toggleFold
}
/>
)
}
</
div
>
</
div
>
{
children
&&
<
div
className=
{
cn
(
!
inline
&&
'mt-1'
)
}
>
{
children
}
</
div
>
}
{
children
&&
(
!
supportFold
||
(
supportFold
&&
!
fold
))
&&
<
div
className=
{
cn
(
!
inline
&&
'mt-1'
)
}
>
{
children
}
</
div
>
}
</
div
>
)
}
...
...
web/app/components/workflow/nodes/question-classifier/panel.tsx
View file @
f95eb2df
...
...
@@ -61,6 +61,7 @@ const Panel: FC = () => {
</
Field
>
<
Field
title=
{
t
(
`${i18nPrefix}.advancedSetting`
)
}
supportFold
>
<
AdvancedSetting
instruction=
{
inputs
.
instruction
}
...
...
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