From 84834eee859fd69ed6b8ab3c848f86f1ff98b992 Mon Sep 17 00:00:00 2001 From: Seefs <40468931+seefs001@users.noreply.github.com> Date: Fri, 31 Jul 2026 13:29:07 +0800 Subject: [PATCH] feat(logs): expose stream status to log owners (#6558) --- model/log.go | 2 +- .../components/dialogs/details-dialog.tsx | 76 +++++++++---------- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/model/log.go b/model/log.go index 401d53c4..1d2b38fc 100644 --- a/model/log.go +++ b/model/log.go @@ -124,7 +124,7 @@ func formatUserLogs(logs []*Log, startIdx int) { // Remove operation-audit details (operator/route info), admin-only. delete(otherMap, "audit_info") // delete(otherMap, "reject_reason") - delete(otherMap, "stream_status") + // delete(otherMap, "stream_status") } logs[i].Other = common.MapToJsonStr(otherMap) } diff --git a/web/src/features/usage-logs/components/dialogs/details-dialog.tsx b/web/src/features/usage-logs/components/dialogs/details-dialog.tsx index ded70ad5..8f57ac6b 100644 --- a/web/src/features/usage-logs/components/dialogs/details-dialog.tsx +++ b/web/src/features/usage-logs/components/dialogs/details-dialog.tsx @@ -1107,48 +1107,46 @@ export function DetailsDialog(props: DetailsDialogProps) { /> )} - {/* Stream status details (admin only) */} - {props.isAdmin && - other?.stream_status && - other.stream_status.status !== 'ok' && ( - + {/* Stream status details */} + {other?.stream_status && other.stream_status.status !== 'ok' && ( + + + } + /> + {other.stream_status.end_reason && ( - } + label={t('End Reason')} + value={other.stream_status.end_reason} /> - {other.stream_status.end_reason && ( - + )} + {(other.stream_status.error_count ?? 0) > 0 && ( + + )} + {other.stream_status.end_error && ( + + )} + {Array.isArray(other.stream_status.errors) && + other.stream_status.errors.length > 0 && ( +
+                  {other.stream_status.errors.join('\n')}
+                
)} - {(other.stream_status.error_count ?? 0) > 0 && ( - - )} - {other.stream_status.end_error && ( - - )} - {Array.isArray(other.stream_status.errors) && - other.stream_status.errors.length > 0 && ( -
-                    {other.stream_status.errors.join('\n')}
-                  
- )} -
- )} +
+ )} {/* Subscription billing details */} {isSubscription && other && (