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
024d03e8
Commit
024d03e8
authored
Jul 07, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: annotation in logs
parent
e7284142
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
index.tsx
web/app/components/app/chat/index.tsx
+13
-6
No files found.
web/app/components/app/chat/index.tsx
View file @
024d03e8
...
@@ -4,6 +4,7 @@ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react'
...
@@ -4,6 +4,7 @@ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react'
import
{
useContext
}
from
'use-context-selector'
import
{
useContext
}
from
'use-context-selector'
import
cn
from
'classnames'
import
cn
from
'classnames'
import
Recorder
from
'js-audio-recorder'
import
Recorder
from
'js-audio-recorder'
import
{
usePathname
}
from
'next/navigation'
import
{
HandThumbDownIcon
,
HandThumbUpIcon
}
from
'@heroicons/react/24/outline'
import
{
HandThumbDownIcon
,
HandThumbUpIcon
}
from
'@heroicons/react/24/outline'
import
{
UserCircleIcon
}
from
'@heroicons/react/24/solid'
import
{
UserCircleIcon
}
from
'@heroicons/react/24/solid'
import
{
useTranslation
}
from
'react-i18next'
import
{
useTranslation
}
from
'react-i18next'
...
@@ -186,6 +187,7 @@ const Answer: FC<IAnswerProps> = ({ item, feedbackDisabled = false, isHideFeedba
...
@@ -186,6 +187,7 @@ const Answer: FC<IAnswerProps> = ({ item, feedbackDisabled = false, isHideFeedba
const
[
localAdminFeedback
,
setLocalAdminFeedback
]
=
useState
<
Feedbacktype
|
undefined
|
null
>
(
adminFeedback
)
const
[
localAdminFeedback
,
setLocalAdminFeedback
]
=
useState
<
Feedbacktype
|
undefined
|
null
>
(
adminFeedback
)
const
{
userProfile
}
=
useContext
(
AppContext
)
const
{
userProfile
}
=
useContext
(
AppContext
)
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
const
pathname
=
usePathname
()
/**
/**
* Render feedback results (distinguish between users and administrators)
* Render feedback results (distinguish between users and administrators)
...
@@ -250,13 +252,18 @@ const Answer: FC<IAnswerProps> = ({ item, feedbackDisabled = false, isHideFeedba
...
@@ -250,13 +252,18 @@ const Answer: FC<IAnswerProps> = ({ item, feedbackDisabled = false, isHideFeedba
}
}
const
adminOperation
=
()
=>
{
const
adminOperation
=
()
=>
{
const
inAppLogPage
=
/
\/
app
\/
.+
\/
logs/g
.
test
(
pathname
)
return
<
div
className=
'flex gap-1'
>
return
<
div
className=
'flex gap-1'
>
<
Tooltip
selector=
{
`user-feedback-${randomString(16)}`
}
content=
{
t
(
'appLog.detail.operation.addAnnotation'
)
as
string
}
>
{
{
OperationBtn
({
inAppLogPage
&&
(
innerContent
:
<
IconWrapper
><
EditIcon
className=
'hover:text-gray-800'
/></
IconWrapper
>,
<
Tooltip
selector=
{
`user-feedback-${randomString(16)}`
}
content=
{
t
(
'appLog.detail.operation.addAnnotation'
)
as
string
}
>
onClick
:
()
=>
setShowEdit
(
true
),
{
OperationBtn
({
})
}
innerContent
:
<
IconWrapper
><
EditIcon
className=
'hover:text-gray-800'
/></
IconWrapper
>,
</
Tooltip
>
onClick
:
()
=>
setShowEdit
(
true
),
})
}
</
Tooltip
>
)
}
{
!
localAdminFeedback
?.
rating
&&
<>
{
!
localAdminFeedback
?.
rating
&&
<>
<
Tooltip
selector=
{
`user-feedback-${randomString(16)}`
}
content=
{
t
(
'appLog.detail.operation.like'
)
as
string
}
>
<
Tooltip
selector=
{
`user-feedback-${randomString(16)}`
}
content=
{
t
(
'appLog.detail.operation.like'
)
as
string
}
>
{
OperationBtn
({
{
OperationBtn
({
...
...
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