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
9587479b
Unverified
Commit
9587479b
authored
Nov 22, 2023
by
zxhlyh
Committed by
GitHub
Nov 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: chat token spent info style (#1597)
parent
3c0fbf3a
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/chat/answer/index.tsx
+2
-2
index.tsx
web/app/components/app/chat/more-info/index.tsx
+7
-3
No files found.
web/app/components/app/chat/answer/index.tsx
View file @
9587479b
...
...
@@ -194,7 +194,7 @@ const Answer: FC<IAnswerProps> = ({
</
div
>
)
}
<
div
className=
{
cn
(
s
.
answerWrapWrap
,
'chat-answer-container'
)
}
>
<
div
className=
{
cn
(
s
.
answerWrapWrap
,
'chat-answer-container
group
'
)
}
>
<
div
className=
{
`${s.answerWrap} ${showEdit ? 'w-full' : ''}`
}
>
<
div
className=
{
`${s.answer} relative text-sm text-gray-900`
}
>
<
div
className=
{
'ml-2 py-3 px-4 bg-gray-100 rounded-tr-2xl rounded-b-2xl'
}
>
...
...
@@ -280,7 +280,7 @@ const Answer: FC<IAnswerProps> = ({
{
!
feedbackDisabled
&&
renderFeedbackRating
(
feedback
?.
rating
,
!
isHideFeedbackEdit
,
displayScene
!==
'console'
)
}
</
div
>
</
div
>
{
more
&&
<
MoreInfo
more=
{
more
}
isQuestion=
{
false
}
/>
}
{
more
&&
<
MoreInfo
className=
'hidden group-hover:block'
more=
{
more
}
isQuestion=
{
false
}
/>
}
</
div
>
</
div
>
</
div
>
...
...
web/app/components/app/chat/more-info/index.tsx
View file @
9587479b
...
...
@@ -5,11 +5,15 @@ import { useTranslation } from 'react-i18next'
import
type
{
MessageMore
}
from
'../type'
import
{
formatNumber
}
from
'@/utils/format'
export
type
IMoreInfoProps
=
{
more
:
MessageMore
;
isQuestion
:
boolean
}
export
type
IMoreInfoProps
=
{
more
:
MessageMore
isQuestion
:
boolean
className
?:
string
}
const
MoreInfo
:
FC
<
IMoreInfoProps
>
=
({
more
,
isQuestion
})
=>
{
const
MoreInfo
:
FC
<
IMoreInfoProps
>
=
({
more
,
isQuestion
,
className
})
=>
{
const
{
t
}
=
useTranslation
()
return
(<
div
className=
{
`mt-1 w-full text-xs text-gray-400
!text-right ${isQuestion ? 'mr-2 text-right ' : 'ml-2 text-left float-right'
}`
}
>
return
(<
div
className=
{
`mt-1 w-full text-xs text-gray-400
${isQuestion ? 'mr-2 text-right ' : 'pl-2 text-left float-right'} ${className
}`
}
>
<
span
>
{
`${t('appLog.detail.timeConsuming')} ${more.latency}${t('appLog.detail.second')}`
}
</
span
>
<
span
>
{
`${t('appLog.detail.tokenCost')} ${formatNumber(more.tokens)}`
}
</
span
>
<
span
>
·
</
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