refactor(web): move timing column next to stream column in usage logs

This commit is contained in:
t0ng7u
2026-07-12 15:34:26 +08:00
parent 31b6832314
commit 135628a5cb
@@ -691,6 +691,31 @@ export function useCommonLogsColumns(isAdmin: boolean): ColumnDef<UsageLog>[] {
contentMode: 'full',
},
},
{
accessorKey: 'use_time',
header: t('Timing'),
cell: ({ row }) => {
const log = row.original
if (!isTimingLogType(log.type)) return null
const useTime = row.getValue('use_time') as number
const other = parseLogOther(log.other)
return (
<TimingMetricsCell
useTimeSec={useTime}
completionTokens={log.completion_tokens}
frtMs={other?.frt}
isStream={log.is_stream}
/>
)
},
meta: {
cardRole: 'primary',
cardOrder: 55,
contentMode: 'full',
},
},
{
accessorKey: 'prompt_tokens',
header: 'Tokens',
@@ -788,32 +813,6 @@ export function useCommonLogsColumns(isAdmin: boolean): ColumnDef<UsageLog>[] {
},
},
{
accessorKey: 'use_time',
header: t('Timing'),
cell: ({ row }) => {
const log = row.original
if (!isTimingLogType(log.type)) return null
const useTime = row.getValue('use_time') as number
const other = parseLogOther(log.other)
return (
<TimingMetricsCell
useTimeSec={useTime}
completionTokens={log.completion_tokens}
frtMs={other?.frt}
isStream={log.is_stream}
/>
)
},
meta: {
cardRole: 'primary',
cardOrder: 55,
contentMode: 'full',
},
},
{
accessorKey: 'content',
header: t('Details'),