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 }} > -
- )} - + )} +