Commit 84834eee by Seefs Committed by GitHub

feat(logs): expose stream status to log owners (#6558)

parent 0f9f668c
...@@ -124,7 +124,7 @@ func formatUserLogs(logs []*Log, startIdx int) { ...@@ -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) { ...@@ -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.error_count ?? 0) > 0 && ( )}
<DetailRow {other.stream_status.end_error && (
label={t('Soft Errors')} <DetailRow
value={String(other.stream_status.error_count)} label={t('End Error')}
/> value={other.stream_status.end_error}
)} />
{other.stream_status.end_error && ( )}
<DetailRow {Array.isArray(other.stream_status.errors) &&
label={t('End Error')} other.stream_status.errors.length > 0 && (
value={other.stream_status.end_error} <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>
)} )}
{Array.isArray(other.stream_status.errors) && </DetailSection>
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 && (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment