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
5412f4ab
Unverified
Commit
5412f4ab
authored
Sep 10, 2023
by
Joel
Committed by
GitHub
Sep 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: in log page not show user query (#1140)
parent
2d5ad0d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
index.tsx
web/app/components/app/configuration/config-var/index.tsx
+7
-3
list.tsx
web/app/components/app/log/list.tsx
+2
-2
No files found.
web/app/components/app/configuration/config-var/index.tsx
View file @
5412f4ab
...
@@ -52,13 +52,18 @@ const ConfigVar: FC<IConfigVarProps> = ({ promptVariables, readonly, onPromptVar
...
@@ -52,13 +52,18 @@ const ConfigVar: FC<IConfigVarProps> = ({ promptVariables, readonly, onPromptVar
onPromptVariablesChange
?.(
newPromptVariables
)
onPromptVariablesChange
?.(
newPromptVariables
)
}
}
const
batchUpdatePromptVariable
=
(
key
:
string
,
updateKeys
:
string
[],
newValues
:
any
[])
=>
{
const
batchUpdatePromptVariable
=
(
key
:
string
,
updateKeys
:
string
[],
newValues
:
any
[]
,
isParagraph
?:
boolean
)
=>
{
const
newPromptVariables
=
promptVariables
.
map
((
item
)
=>
{
const
newPromptVariables
=
promptVariables
.
map
((
item
)
=>
{
if
(
item
.
key
===
key
)
{
if
(
item
.
key
===
key
)
{
const
newItem
:
any
=
{
...
item
}
const
newItem
:
any
=
{
...
item
}
updateKeys
.
forEach
((
updateKey
,
i
)
=>
{
updateKeys
.
forEach
((
updateKey
,
i
)
=>
{
newItem
[
updateKey
]
=
newValues
[
i
]
newItem
[
updateKey
]
=
newValues
[
i
]
})
})
if
(
isParagraph
)
{
delete
newItem
.
max_length
delete
newItem
.
options
}
console
.
log
(
newItem
)
return
newItem
return
newItem
}
}
...
@@ -247,9 +252,8 @@ const ConfigVar: FC<IConfigVarProps> = ({ promptVariables, readonly, onPromptVar
...
@@ -247,9 +252,8 @@ const ConfigVar: FC<IConfigVarProps> = ({ promptVariables, readonly, onPromptVar
onConfirm=
{
({
type
,
value
})
=>
{
onConfirm=
{
({
type
,
value
})
=>
{
if
(
type
===
'string'
)
if
(
type
===
'string'
)
batchUpdatePromptVariable
(
currKey
as
string
,
[
'type'
,
'max_length'
],
[
type
,
value
||
DEFAULT_VALUE_MAX_LEN
])
batchUpdatePromptVariable
(
currKey
as
string
,
[
'type'
,
'max_length'
],
[
type
,
value
||
DEFAULT_VALUE_MAX_LEN
])
else
else
batchUpdatePromptVariable
(
currKey
as
string
,
[
'type'
,
'options'
],
[
type
,
value
||
[]])
batchUpdatePromptVariable
(
currKey
as
string
,
[
'type'
,
'options'
],
[
type
,
value
||
[]]
,
type
===
'paragraph'
)
hideEditModal
()
hideEditModal
()
}
}
}
}
...
...
web/app/components/app/log/list.tsx
View file @
5412f4ab
...
@@ -81,7 +81,7 @@ const getFormattedChatList = (messages: ChatMessage[]) => {
...
@@ -81,7 +81,7 @@ const getFormattedChatList = (messages: ChatMessage[]) => {
messages
.
forEach
((
item
:
ChatMessage
)
=>
{
messages
.
forEach
((
item
:
ChatMessage
)
=>
{
newChatList
.
push
({
newChatList
.
push
({
id
:
`question-
${
item
.
id
}
`
,
id
:
`question-
${
item
.
id
}
`
,
content
:
item
.
query
,
content
:
item
.
inputs
.
query
||
item
.
query
,
// text generation: item.inputs.query; chat: item.query
isAnswer
:
false
,
isAnswer
:
false
,
})
})
...
@@ -413,7 +413,7 @@ const ConversationList: FC<IConversationList> = ({ logs, appDetail, onRefresh })
...
@@ -413,7 +413,7 @@ const ConversationList: FC<IConversationList> = ({ logs, appDetail, onRefresh })
<
tbody
className=
"text-gray-500"
>
<
tbody
className=
"text-gray-500"
>
{
logs
.
data
.
map
((
log
)
=>
{
{
logs
.
data
.
map
((
log
)
=>
{
const
endUser
=
log
.
from_end_user_session_id
const
endUser
=
log
.
from_end_user_session_id
const
leftValue
=
get
(
log
,
isChatMode
?
'summary'
:
'message.query'
)
const
leftValue
=
get
(
log
,
isChatMode
?
'summary'
:
'message.
inputs.
query'
)
const
rightValue
=
get
(
log
,
isChatMode
?
'message_count'
:
'message.answer'
)
const
rightValue
=
get
(
log
,
isChatMode
?
'message_count'
:
'message.answer'
)
return
<
tr
return
<
tr
key=
{
log
.
id
}
key=
{
log
.
id
}
...
...
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