feat(log): add paused status count to log rendering and simplify status rendering logic

This commit is contained in:
twwu 2026-01-27 21:20:47 +08:00
parent 1b0abdf642
commit e945f3d439
2 changed files with 9 additions and 9 deletions

View File

@ -68,6 +68,7 @@ type IDrawerContext = {
}
type StatusCount = {
paused: number
success: number
failed: number
partial_success: number
@ -89,8 +90,11 @@ const HandThumbIconWithCount: FC<{ count: number, iconType: 'up' | 'down' }> = (
)
}
const statusTdRender = (status: 'normal' | 'finished' | 'paused', statusCount: StatusCount) => {
if (status === 'paused') {
const statusTdRender = (statusCount: StatusCount) => {
if (!statusCount)
return null
if (statusCount.paused > 0) {
return (
<div className="system-xs-semibold-uppercase inline-flex items-center gap-1">
<Indicator color="yellow" />
@ -98,11 +102,7 @@ const statusTdRender = (status: 'normal' | 'finished' | 'paused', statusCount: S
</div>
)
}
if (!statusCount)
return null
if (statusCount.partial_success + statusCount.failed === 0) {
else if (statusCount.partial_success + statusCount.failed === 0) {
return (
<div className="system-xs-semibold-uppercase inline-flex items-center gap-1">
<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>
{isChatflow && (
<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 className="p-3 pr-2" style={{ maxWidth: isChatMode ? 100 : 200 }}>

View File

@ -29,7 +29,7 @@ export const UnsubmittedHumanInputContent = ({
)}
{/* Expiration Time */}
{typeof expiration_time === 'number' && (
<ExpirationTime expirationTime={expiration_time} />
<ExpirationTime expirationTime={expiration_time * 1000} />
)}
</>
)