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
8b42a89c
Commit
8b42a89c
authored
Jul 19, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/application-configuration-preview-style' into deploy/dev
parents
4b45a5f1
88ebbe18
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
index.tsx
...components/app/configuration/prompt-value-panel/index.tsx
+1
-0
index.tsx
web/app/components/base/select/index.tsx
+8
-6
app-debug.zh.ts
web/i18n/lang/app-debug.zh.ts
+1
-1
No files found.
web/app/components/app/configuration/prompt-value-panel/index.tsx
View file @
8b42a89c
...
...
@@ -122,6 +122,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
items=
{
(
options
||
[]).
map
(
i
=>
({
name
:
i
,
value
:
i
}))
}
allowSearch=
{
false
}
bgClassName=
'bg-gray-50'
overlayClassName=
'z-[11]'
/>
)
:
(
...
...
web/app/components/base/select/index.tsx
View file @
8b42a89c
...
...
@@ -31,6 +31,7 @@ export type ISelectProps = {
allowSearch
?:
boolean
bgClassName
?:
string
placeholder
?:
string
overlayClassName
?:
string
}
const
Select
:
FC
<
ISelectProps
>
=
({
className
,
...
...
@@ -40,6 +41,7 @@ const Select: FC<ISelectProps> = ({
onSelect
,
allowSearch
=
true
,
bgClassName
=
'bg-gray-100'
,
overlayClassName
,
})
=>
{
const
[
query
,
setQuery
]
=
useState
(
''
)
const
[
open
,
setOpen
]
=
useState
(
false
)
...
...
@@ -48,9 +50,9 @@ const Select: FC<ISelectProps> = ({
useEffect
(()
=>
{
let
defaultSelect
=
null
const
existed
=
items
.
find
((
item
:
Item
)
=>
item
.
value
===
defaultValue
)
if
(
existed
)
{
if
(
existed
)
defaultSelect
=
existed
}
setSelectedItem
(
defaultSelect
)
},
[
defaultValue
])
...
...
@@ -104,7 +106,7 @@ const Select: FC<ISelectProps> = ({
</
div
>
{
filteredItems
.
length
>
0
&&
(
<
Combobox
.
Options
className=
"absolute z-10 mt-1 px-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg border-gray-200 border-[0.5px] focus:outline-none sm:text-sm"
>
<
Combobox
.
Options
className=
{
`absolute z-10 mt-1 px-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg border-gray-200 border-[0.5px] focus:outline-none sm:text-sm ${overlayClassName}`
}
>
{
filteredItems
.
map
((
item
:
Item
)
=>
(
<
Combobox
.
Option
key=
{
item
.
value
}
...
...
@@ -155,9 +157,9 @@ const SimpleSelect: FC<ISelectProps> = ({
useEffect
(()
=>
{
let
defaultSelect
=
null
const
existed
=
items
.
find
((
item
:
Item
)
=>
item
.
value
===
defaultValue
)
if
(
existed
)
{
if
(
existed
)
defaultSelect
=
existed
}
setSelectedItem
(
defaultSelect
)
},
[
defaultValue
])
...
...
@@ -173,7 +175,7 @@ const SimpleSelect: FC<ISelectProps> = ({
>
<
div
className=
{
`relative h-9 ${wrapperClassName}`
}
>
<
Listbox
.
Button
className=
{
`w-full h-full rounded-lg border-0 bg-gray-100 py-1.5 pl-3 pr-10 shadow-sm sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-gray-200 group-hover:bg-gray-200 cursor-pointer ${className}`
}
>
<
span
className=
{
classNames
(
"block truncate text-left"
,
!
selectedItem
?.
name
&&
'text-gray-400'
)
}
>
{
selectedItem
?.
name
??
localPlaceholder
}
</
span
>
<
span
className=
{
classNames
(
'block truncate text-left'
,
!
selectedItem
?.
name
&&
'text-gray-400'
)
}
>
{
selectedItem
?.
name
??
localPlaceholder
}
</
span
>
<
span
className=
"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2"
>
<
ChevronDownIcon
className=
"h-5 w-5 text-gray-400"
...
...
web/i18n/lang/app-debug.zh.ts
View file @
8b42a89c
...
...
@@ -86,7 +86,7 @@ const translation = {
},
errorMessage
:
{
nameOfKeyRequired
:
'变量 {{key}} 对应的名称必填'
,
valueOfVarRequired
:
'
变量值
必填'
,
valueOfVarRequired
:
'
真实的变量名
必填'
,
queryRequired
:
'主要文本必填'
,
waitForResponse
:
'请等待上条信息响应完成'
,
waitForBatchResponse
:
'请等待批量任务完成'
,
...
...
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