diff --git a/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss b/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss index 458071577..261829da9 100644 --- a/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss +++ b/web/src/cde-gitness/components/ContainerLogs/ContainerLogs.module.scss @@ -17,7 +17,7 @@ @import 'src/utils/utils'; .consoleContainer { - min-height: 500px !important; + min-height: 120px !important; max-height: 70vh !important; overflow: scroll; align-items: start !important; diff --git a/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss index 7c67f1348..09ca13057 100644 --- a/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss +++ b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss @@ -84,3 +84,8 @@ } } } + +.containerlogsTitle { + width: 130px; + justify-content: space-between !important; +} diff --git a/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss.d.ts b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss.d.ts index 9c9cd578f..a8c3ed840 100644 --- a/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss.d.ts +++ b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.module.scss.d.ts @@ -18,6 +18,7 @@ // This is an auto-generated file export declare const accordionnCustomSummary: string export declare const cardContainer: string +export declare const containerlogsTitle: string export declare const customSubheader: string export declare const pageMain: string export declare const popover: string diff --git a/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.tsx b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.tsx index 01b2f18f2..0f9601376 100644 --- a/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.tsx +++ b/web/src/cde-gitness/pages/GitspaceDetails/GitspaceDetails.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import React, { useEffect, useState } from 'react' +import React, { useEffect, useRef, useState } from 'react' import { Breadcrumbs, Button, @@ -25,7 +25,8 @@ import { Accordion, Page, Text, - useToaster + useToaster, + AccordionHandle } from '@harnessio/uicore' import { Play } from 'iconoir-react' import { useHistory, useParams } from 'react-router-dom' @@ -82,12 +83,15 @@ const GitspaceDetails = () => { data: responseData, refetch: refetchLogsData, response, - error: streamLogsError + error: streamLogsError, + loading: logsLoading } = useGitspacesLogs({ gitspaceId }) - if (streamLogsError) { - showError(streamLogsError.message) - } + useEffect(() => { + if (streamLogsError?.message) { + showError(streamLogsError.message) + } + }, [streamLogsError?.message]) const { mutate: actionMutate, loading: mutateLoading } = useGitspaceActions({ gitspaceId }) @@ -201,6 +205,16 @@ const GitspaceDetails = () => { const { refetchToken, setSelectedRowUrl } = useOpenVSCodeBrowserURL() + const accordionRef = useRef(null) + + useEffect(() => { + if (standalone ? formattedlogsdata.data : responseData) { + accordionRef.current?.open('logsCard') + } else { + accordionRef.current?.close('logsCard') + } + }, [standalone, responseData, formattedlogsdata.data]) + return ( <> { - + - + {getString('cde.details.containerLogs')} {getString('cde.details.containerLogsSubText')}