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
8d6ec9aa
Commit
8d6ec9aa
authored
Jun 26, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support clear
parent
60f6ab03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
index.tsx
...components/app/configuration/prompt-value-panel/index.tsx
+16
-1
index.tsx
.../components/share/text-generation/config-scence/index.tsx
+9
-1
No files found.
web/app/components/app/configuration/prompt-value-panel/index.tsx
View file @
8d6ec9aa
...
@@ -58,6 +58,14 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
...
@@ -58,6 +58,14 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
setInputs
(
newInputs
)
setInputs
(
newInputs
)
}
}
const
onClear
=
()
=>
{
const
newInputs
:
Record
<
string
,
any
>
=
{}
promptVariables
.
forEach
((
item
)
=>
{
newInputs
[
item
.
key
]
=
''
})
setInputs
(
newInputs
)
}
const
promptPreview
=
(
const
promptPreview
=
(
<
div
className=
'pt-3 pb-4 rounded-t-xl bg-indigo-25'
>
<
div
className=
'pt-3 pb-4 rounded-t-xl bg-indigo-25'
>
<
div
className=
"px-4"
>
<
div
className=
"px-4"
>
...
@@ -154,7 +162,14 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
...
@@ -154,7 +162,14 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
appType
===
AppType
.
completion
&&
(
appType
===
AppType
.
completion
&&
(
<
div
>
<
div
>
<
div
className=
"mt-5 border-b border-gray-100"
></
div
>
<
div
className=
"mt-5 border-b border-gray-100"
></
div
>
<
div
className=
"flex justify-end mt-4 px-4"
>
<
div
className=
"flex justify-between mt-4 px-4"
>
<
Button
className=
'w-[58px] !h-8 !p-3'
onClick=
{
onClear
}
disabled=
{
false
}
>
<
span
className=
'text-[13px]'
>
{
t
(
'common.operation.clear'
)
}
</
span
>
</
Button
>
<
Button
<
Button
type=
"primary"
type=
"primary"
onClick=
{
()
=>
onSend
&&
onSend
()
}
onClick=
{
()
=>
onSend
&&
onSend
()
}
...
...
web/app/components/share/text-generation/config-scence/index.tsx
View file @
8d6ec9aa
...
@@ -25,6 +25,14 @@ const ConfigSence: FC<IConfigSenceProps> = ({
...
@@ -25,6 +25,14 @@ const ConfigSence: FC<IConfigSenceProps> = ({
})
=>
{
})
=>
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
const
onClear
=
()
=>
{
const
newInputs
:
Record
<
string
,
any
>
=
{}
promptConfig
.
prompt_variables
.
forEach
((
item
)
=>
{
newInputs
[
item
.
key
]
=
''
})
onInputsChange
(
newInputs
)
}
return
(
return
(
<
div
className=
""
>
<
div
className=
""
>
<
section
>
<
section
>
...
@@ -73,7 +81,7 @@ const ConfigSence: FC<IConfigSenceProps> = ({
...
@@ -73,7 +81,7 @@ const ConfigSence: FC<IConfigSenceProps> = ({
<
div
className=
"flex items-center justify-between"
>
<
div
className=
"flex items-center justify-between"
>
<
Button
<
Button
className=
'w-[58px] !h-8 !p-3'
className=
'w-[58px] !h-8 !p-3'
onClick=
{
on
Send
}
onClick=
{
on
Clear
}
disabled=
{
false
}
disabled=
{
false
}
>
>
<
span
className=
'text-[13px]'
>
{
t
(
'common.operation.clear'
)
}
</
span
>
<
span
className=
'text-[13px]'
>
{
t
(
'common.operation.clear'
)
}
</
span
>
...
...
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