From 7cf4932f3a58657c7226acb0584b121742156f7e Mon Sep 17 00:00:00 2001 From: jialin Date: Thu, 18 Jun 2026 11:41:21 +0800 Subject: [PATCH] fix(deploymentlog): show the checkbox only when container exsiting previous --- .../llmodels/components/view-logs-modal.tsx | 32 ++++++++++++------- .../model-routes/hooks/use-open-playground.ts | 8 +++-- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/pages/llmodels/components/view-logs-modal.tsx b/src/pages/llmodels/components/view-logs-modal.tsx index 0ace47a8..7f979b9e 100644 --- a/src/pages/llmodels/components/view-logs-modal.tsx +++ b/src/pages/llmodels/components/view-logs-modal.tsx @@ -55,6 +55,12 @@ const ViewLogsModal: React.FC = (props) => { ); }, [countOptions, showPrevious]); + const hasPreviousContainer = useMemo(() => { + return countOptions?.some((option) => + option.children?.some((child) => child.previous) + ); + }, [countOptions]); + const handleCancel = useCallback(() => { logsViewerRef.current?.abort(); onCancel(); @@ -186,15 +192,15 @@ const ViewLogsModal: React.FC = (props) => { {intl.formatMessage({ id: 'common.button.viewlog' })} - {showCascader && ( -
+
+ {hasPreviousContainer && ( = (props) => { + )} + + {showCascader && ( = (props) => { onChange={handleContainerChange} style={{ width: 360 }} > -
- )} - + )} +