mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-11 14:41:21 +00:00
feat(logs): expose stream status to log owners (#6558)
This commit is contained in:
+1
-1
@@ -124,7 +124,7 @@ func formatUserLogs(logs []*Log, startIdx int) {
|
|||||||
// Remove operation-audit details (operator/route info), admin-only.
|
// Remove operation-audit details (operator/route info), admin-only.
|
||||||
delete(otherMap, "audit_info")
|
delete(otherMap, "audit_info")
|
||||||
// delete(otherMap, "reject_reason")
|
// delete(otherMap, "reject_reason")
|
||||||
delete(otherMap, "stream_status")
|
// delete(otherMap, "stream_status")
|
||||||
}
|
}
|
||||||
logs[i].Other = common.MapToJsonStr(otherMap)
|
logs[i].Other = common.MapToJsonStr(otherMap)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1107,48 +1107,46 @@ export function DetailsDialog(props: DetailsDialogProps) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Stream status details (admin only) */}
|
{/* Stream status details */}
|
||||||
{props.isAdmin &&
|
{other?.stream_status && other.stream_status.status !== 'ok' && (
|
||||||
other?.stream_status &&
|
<DetailSection label={t('Stream Status')}>
|
||||||
other.stream_status.status !== 'ok' && (
|
<DetailRow
|
||||||
<DetailSection label={t('Stream Status')}>
|
label={t('Status')}
|
||||||
|
value={
|
||||||
|
<StatusBadge
|
||||||
|
label={other.stream_status.status || t('Error')}
|
||||||
|
variant='red'
|
||||||
|
size='sm'
|
||||||
|
copyable={false}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
{other.stream_status.end_reason && (
|
||||||
<DetailRow
|
<DetailRow
|
||||||
label={t('Status')}
|
label={t('End Reason')}
|
||||||
value={
|
value={other.stream_status.end_reason}
|
||||||
<StatusBadge
|
|
||||||
label={other.stream_status.status || t('Error')}
|
|
||||||
variant='red'
|
|
||||||
size='sm'
|
|
||||||
copyable={false}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
{other.stream_status.end_reason && (
|
)}
|
||||||
<DetailRow
|
{(other.stream_status.error_count ?? 0) > 0 && (
|
||||||
label={t('End Reason')}
|
<DetailRow
|
||||||
value={other.stream_status.end_reason}
|
label={t('Soft Errors')}
|
||||||
/>
|
value={String(other.stream_status.error_count)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{other.stream_status.end_error && (
|
||||||
|
<DetailRow
|
||||||
|
label={t('End Error')}
|
||||||
|
value={other.stream_status.end_error}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{Array.isArray(other.stream_status.errors) &&
|
||||||
|
other.stream_status.errors.length > 0 && (
|
||||||
|
<pre className='bg-background/60 mt-1 max-h-32 overflow-y-auto rounded border p-2 font-mono text-[11px] leading-relaxed wrap-break-word whitespace-pre-wrap'>
|
||||||
|
{other.stream_status.errors.join('\n')}
|
||||||
|
</pre>
|
||||||
)}
|
)}
|
||||||
{(other.stream_status.error_count ?? 0) > 0 && (
|
</DetailSection>
|
||||||
<DetailRow
|
)}
|
||||||
label={t('Soft Errors')}
|
|
||||||
value={String(other.stream_status.error_count)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{other.stream_status.end_error && (
|
|
||||||
<DetailRow
|
|
||||||
label={t('End Error')}
|
|
||||||
value={other.stream_status.end_error}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{Array.isArray(other.stream_status.errors) &&
|
|
||||||
other.stream_status.errors.length > 0 && (
|
|
||||||
<pre className='bg-background/60 mt-1 max-h-32 overflow-y-auto rounded border p-2 font-mono text-[11px] leading-relaxed wrap-break-word whitespace-pre-wrap'>
|
|
||||||
{other.stream_status.errors.join('\n')}
|
|
||||||
</pre>
|
|
||||||
)}
|
|
||||||
</DetailSection>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Subscription billing details */}
|
{/* Subscription billing details */}
|
||||||
{isSubscription && other && (
|
{isSubscription && other && (
|
||||||
|
|||||||
Reference in New Issue
Block a user