From 9b9b19e9d2b42d1ddeaf72ba8b41c692c8d1caab Mon Sep 17 00:00:00 2001 From: yyhhyyyyyy Date: Tue, 16 Jun 2026 23:26:42 +0800 Subject: [PATCH] fix(web): prevent usage log details dialog from clipping bottom content (#5533) --- .../components/dialogs/details-dialog.tsx | 1147 ++++++++--------- 1 file changed, 569 insertions(+), 578 deletions(-) diff --git a/web/default/src/features/usage-logs/components/dialogs/details-dialog.tsx b/web/default/src/features/usage-logs/components/dialogs/details-dialog.tsx index d559ed1f..2904e0ea 100644 --- a/web/default/src/features/usage-logs/components/dialogs/details-dialog.tsx +++ b/web/default/src/features/usage-logs/components/dialogs/details-dialog.tsx @@ -38,7 +38,6 @@ import { cn } from '@/lib/utils' import { useCopyToClipboard } from '@/hooks/use-copy-to-clipboard' import { Button } from '@/components/ui/button' import { Label } from '@/components/ui/label' -import { ScrollArea } from '@/components/ui/scroll-area' import { Dialog } from '@/components/dialog' import { StatusBadge, type StatusBadgeProps } from '@/components/status-badge' import { DynamicPricingBreakdown } from '@/features/pricing/components/dynamic-pricing-breakdown' @@ -94,7 +93,7 @@ function DetailRow(props: { - -
- {/* Overview section - key identifiers */} -
- {props.log.request_id && ( - - )} - {props.log.upstream_request_id && ( - - )} - - {props.isAdmin && props.log.channel > 0 && ( - - {props.log.channel} - {props.log.channel_name && ( - - {' '} - ({props.log.channel_name}) - - )} - - } - mono - /> - )} - - {channelChain && props.isAdmin && ( - - )} - - {props.log.token_name && ( - - )} - - {(props.log.group || other?.group) && ( - - )} - - {showAdminIp && ( - -
- - {/* Request conversion (admin only, not for refund) */} - {showConversion && ( - -
- -
- {other?.request_path && ( - - )} -
-
-
-
-
- )} - - {/* Reject reason (admin only) */} - {props.isAdmin && other?.reject_reason && ( - - )} - - {/* Violation fee info */} - {isViolation && other && ( - - )} - - {/* Refund details (type=6) */} - {isRefund && other && (other.task_id || other.reason) && ( - - {other.task_id && ( - - )} - {other.reason && ( - - )} - - )} - - {/* Top-up audit info (type=1, admin only) */} - {showTopupAuditSection && ( - - )} - - {/* Manage operator (type=3, admin only) */} - {manageOperator && ( +
+ {/* Overview section - key identifiers */} +
+ {props.log.request_id && ( -
+ + {/* Request conversion (admin only, not for refund) */} + {showConversion && ( + +
+ +
+ {other?.request_path && ( )} - {other.subscription_consumed != null && ( - - )} - {other.subscription_remain != null && ( - - )} - - )} - - {/* Param override */} - {other?.po && Array.isArray(other.po) && other.po.length > 0 && ( - - )} - - {/* Content */} - {details && ( -
- -
- -

- {details} -

+
+
+ + )} + + {/* Reject reason (admin only) */} + {props.isAdmin && other?.reject_reason && ( + + )} + + {/* Violation fee info */} + {isViolation && other && ( + + )} + + {/* Refund details (type=6) */} + {isRefund && other && (other.task_id || other.reason) && ( + + {other.task_id && ( + + )} + {other.reason && ( + + )} + + )} + + {/* Top-up audit info (type=1, admin only) */} + {showTopupAuditSection && ( + + )} + + {/* Manage operator (type=3, admin only) */} + {manageOperator && ( + +
- + + {/* Stream status details (admin only) */} + {props.isAdmin && + other?.stream_status && + other.stream_status.status !== 'ok' && ( + + + } + /> + {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')}
+                  
+ )} +
+ )} + + {/* Subscription billing details */} + {isSubscription && other && ( + + {other.subscription_plan_id && ( + + )} + {other.subscription_id && ( + + )} + {other.subscription_pre_consumed != null && ( + + )} + {other.subscription_post_delta != null && + other.subscription_post_delta !== 0 && ( + + )} + {other.subscription_consumed != null && ( + + )} + {other.subscription_remain != null && ( + + )} + + )} + + {/* Param override */} + {other?.po && Array.isArray(other.po) && other.po.length > 0 && ( + + )} + + {/* Content */} + {details && ( +
+ +
+ +

+ {details} +

+
+
+ )} +
) }