mirror of
https://github.com/langgenius/dify.git
synced 2026-09-05 00:31:19 +08:00
feat(log): add paused status count to log rendering and simplify status rendering logic
This commit is contained in:
parent
1b0abdf642
commit
e945f3d439
@ -68,6 +68,7 @@ type IDrawerContext = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type StatusCount = {
|
type StatusCount = {
|
||||||
|
paused: number
|
||||||
success: number
|
success: number
|
||||||
failed: number
|
failed: number
|
||||||
partial_success: number
|
partial_success: number
|
||||||
@ -89,8 +90,11 @@ const HandThumbIconWithCount: FC<{ count: number, iconType: 'up' | 'down' }> = (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const statusTdRender = (status: 'normal' | 'finished' | 'paused', statusCount: StatusCount) => {
|
const statusTdRender = (statusCount: StatusCount) => {
|
||||||
if (status === 'paused') {
|
if (!statusCount)
|
||||||
|
return null
|
||||||
|
|
||||||
|
if (statusCount.paused > 0) {
|
||||||
return (
|
return (
|
||||||
<div className="system-xs-semibold-uppercase inline-flex items-center gap-1">
|
<div className="system-xs-semibold-uppercase inline-flex items-center gap-1">
|
||||||
<Indicator color="yellow" />
|
<Indicator color="yellow" />
|
||||||
@ -98,11 +102,7 @@ const statusTdRender = (status: 'normal' | 'finished' | 'paused', statusCount: S
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
else if (statusCount.partial_success + statusCount.failed === 0) {
|
||||||
if (!statusCount)
|
|
||||||
return null
|
|
||||||
|
|
||||||
if (statusCount.partial_success + statusCount.failed === 0) {
|
|
||||||
return (
|
return (
|
||||||
<div className="system-xs-semibold-uppercase inline-flex items-center gap-1">
|
<div className="system-xs-semibold-uppercase inline-flex items-center gap-1">
|
||||||
<Indicator color="green" />
|
<Indicator color="green" />
|
||||||
@ -1039,7 +1039,7 @@ const ConversationList: FC<IConversationList> = ({ logs, appDetail, onRefresh })
|
|||||||
<td className="p-3 pr-2">{renderTdValue(endUser || defaultValue, !endUser)}</td>
|
<td className="p-3 pr-2">{renderTdValue(endUser || defaultValue, !endUser)}</td>
|
||||||
{isChatflow && (
|
{isChatflow && (
|
||||||
<td className="w-[160px] p-3 pr-2" style={{ maxWidth: isChatMode ? 300 : 200 }}>
|
<td className="w-[160px] p-3 pr-2" style={{ maxWidth: isChatMode ? 300 : 200 }}>
|
||||||
{statusTdRender(log.status, log.status_count)}
|
{statusTdRender(log.status_count)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
<td className="p-3 pr-2" style={{ maxWidth: isChatMode ? 100 : 200 }}>
|
<td className="p-3 pr-2" style={{ maxWidth: isChatMode ? 100 : 200 }}>
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export const UnsubmittedHumanInputContent = ({
|
|||||||
)}
|
)}
|
||||||
{/* Expiration Time */}
|
{/* Expiration Time */}
|
||||||
{typeof expiration_time === 'number' && (
|
{typeof expiration_time === 'number' && (
|
||||||
<ExpirationTime expirationTime={expiration_time} />
|
<ExpirationTime expirationTime={expiration_time * 1000} />
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user