From 7a69c70da29460da6d8b5484cfe3d2d1fbc47f27 Mon Sep 17 00:00:00 2001 From: Chi-Sheng Liu Date: Tue, 26 Mar 2024 16:29:55 +0800 Subject: [PATCH] feat(log-panel): Add a button to show log panel in popup window Resolves: flyteorg/flyte#5108 Signed-off-by: Chi-Sheng Liu --- .../NodeExecutionDetailsPanelContent.tsx | 49 ++++++++++++++++--- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/packages/oss-console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx b/packages/oss-console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx index 9f2b5eeb0..8947b1a6f 100644 --- a/packages/oss-console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx +++ b/packages/oss-console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx @@ -1,10 +1,12 @@ import React, { FC, useEffect, useMemo, useRef, useState } from 'react'; import IconButton from '@mui/material/IconButton'; import Typography from '@mui/material/Typography'; +import Modal from '@mui/material/Modal'; import Tab from '@mui/material/Tab'; import Tabs from '@mui/material/Tabs'; import ArrowBackIos from '@mui/icons-material/ArrowBackIos'; import Close from '@mui/icons-material/Close'; +import OpenInFullIcon from '@mui/icons-material/OpenInFull'; import classnames from 'classnames'; import { LocationDescriptor } from 'history'; import Skeleton from 'react-loading-skeleton'; @@ -105,8 +107,8 @@ const StatusContainer = styled('div')(({ theme }) => ({ marginLeft: theme.spacing(1), cursor: 'pointer', }, - '& .statusBody': { - marginTop: theme.spacing(2), + '& .reasonsIconContainer': { + textAlign: 'right', }, })); @@ -126,6 +128,23 @@ const NotRunStatus = styled('div')(({ theme }) => ({ fontWeight: 'bold', })); +const ModalScrollableMonospaceText = styled(ScrollableMonospaceText)(({ theme }) => ({ + '&': { + position: 'absolute' as 'absolute', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + width: '85%', + height: '85%', + boxShadow: 12, + }, + '& .container': { + maxHeight: '100%', + height: '100%', + flexDirection: 'column', + }, +})); + const tabIds = { executions: 'executions', inputs: 'inputs', @@ -227,6 +246,26 @@ const WorkflowTabs: React.FC<{ ); }; +const TaskExecutionDetailReasons: React.FC<{ text: string }> = ({ text }) => { + const [open, setOpen] = useState(false); + const handleModalOpen = () => setOpen(true); + const handleModalClose = () => setOpen(false); + + return ( +
+
+ + + +
+ + + + +
+ ); +}; + interface NodeExecutionStatusProps { nodeExecution?: NodeExecution; frontendPhase: NodeExecutionPhase; @@ -248,11 +287,7 @@ const NodeExecutionStatus: FC = ({ nodeExecution, fron
- {reasons?.length ? ( -
- -
- ) : null} + {reasons?.length && } ) : ( NOT RUN