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
91182a86
Unverified
Commit
91182a86
authored
Dec 22, 2023
by
crazywoola
Committed by
GitHub
Dec 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: edited by is missing (#1824)
parent
0b7e0cad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
list.tsx
web/app/components/app/log/list.tsx
+5
-7
log.ts
web/models/log.ts
+1
-0
No files found.
web/app/components/app/log/list.tsx
View file @
91182a86
'use client'
import
type
{
FC
}
from
'react'
import
React
,
{
useEffect
,
useState
}
from
'react'
// import type { Log } from '@/models/log'
import
useSWR
from
'swr'
import
{
HandThumbDownIcon
,
...
...
@@ -20,7 +19,7 @@ import VarPanel from './var-panel'
import
{
randomString
}
from
'@/utils'
import
{
EditIconSolid
}
from
'@/app/components/app/chat/icon-component'
import
type
{
FeedbackFunc
,
Feedbacktype
,
IChatItem
,
SubmitAnnotationFunc
}
from
'@/app/components/app/chat/type'
import
type
{
Annotation
,
ChatConversationFullDetailResponse
,
ChatConversationGeneralDetail
,
ChatConversationsResponse
,
ChatMessage
,
ChatMessagesRequest
,
CompletionConversationFullDetailResponse
,
CompletionConversationGeneralDetail
,
CompletionConversationsResponse
}
from
'@/models/log'
import
type
{
ChatConversationFullDetailResponse
,
ChatConversationGeneralDetail
,
ChatConversationsResponse
,
ChatMessage
,
ChatMessagesRequest
,
CompletionConversationFullDetailResponse
,
CompletionConversationGeneralDetail
,
CompletionConversationsResponse
,
LogAnnotation
}
from
'@/models/log'
import
type
{
App
}
from
'@/types/app'
import
Loading
from
'@/app/components/base/loading'
import
Drawer
from
'@/app/components/base/drawer'
...
...
@@ -43,7 +42,6 @@ type IConversationList = {
}
const
defaultValue
=
'N/A'
const
emptyText
=
'[Empty]'
type
IDrawerContext
=
{
onClose
:
()
=>
void
...
...
@@ -130,7 +128,7 @@ type IDetailPanel<T> = {
onSubmitAnnotation
:
SubmitAnnotationFunc
}
function
DetailPanel
<
T
extends
ChatConversationFullDetailResponse
|
CompletionConversationFullDetailResponse
>
({
detail
,
onFeedback
,
onSubmitAnnotation
}:
IDetailPanel
<
T
>
)
{
function
DetailPanel
<
T
extends
ChatConversationFullDetailResponse
|
CompletionConversationFullDetailResponse
>
({
detail
,
onFeedback
}:
IDetailPanel
<
T
>
)
{
const
{
onClose
,
appDetail
}
=
useContext
(
DrawerContext
)
const
{
t
}
=
useTranslation
()
const
[
items
,
setItems
]
=
React
.
useState
<
IChatItem
[]
>
([])
...
...
@@ -176,7 +174,7 @@ function DetailPanel<T extends ChatConversationFullDetailResponse | CompletionCo
useEffect
(()
=>
{
if
(
appDetail
?.
id
&&
detail
.
id
&&
appDetail
?.
mode
===
'chat'
)
fetchData
()
},
[
appDetail
?.
id
,
detail
.
id
])
},
[
appDetail
?.
id
,
detail
.
id
,
appDetail
?.
mode
])
const
isChatMode
=
appDetail
?.
mode
===
'chat'
...
...
@@ -454,12 +452,12 @@ const ConversationList: FC<IConversationList> = ({ logs, appDetail, onRefresh })
const
isChatMode
=
appDetail
?.
mode
===
'chat'
// Whether the app is a chat app
// Annotated data needs to be highlighted
const
renderTdValue
=
(
value
:
string
|
number
|
null
,
isEmptyStyle
:
boolean
,
isHighlight
=
false
,
annotation
?:
Annotation
)
=>
{
const
renderTdValue
=
(
value
:
string
|
number
|
null
,
isEmptyStyle
:
boolean
,
isHighlight
=
false
,
annotation
?:
Log
Annotation
)
=>
{
return
(
<
Tooltip
htmlContent=
{
<
span
className=
'text-xs text-gray-500 inline-flex items-center'
>
<
EditIconSolid
className=
'mr-1'
/>
{
`${t('appLog.detail.annotationTip', { user: annotation?.
logAnnotation?.
account?.name })} ${dayjs.unix(annotation?.created_at || dayjs().unix()).format('MM-DD hh:mm A')}`
}
<
EditIconSolid
className=
'mr-1'
/>
{
`${t('appLog.detail.annotationTip', { user: annotation?.account?.name })} ${dayjs.unix(annotation?.created_at || dayjs().unix()).format('MM-DD hh:mm A')}`
}
</
span
>
}
className=
{
(
isHighlight
&&
!
isChatMode
)
?
''
:
'!hidden'
}
...
...
web/models/log.ts
View file @
91182a86
...
...
@@ -58,6 +58,7 @@ export type LogAnnotation = {
name
:
string
email
:
string
}
created_at
:
number
}
export
type
Annotation
=
{
...
...
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