From 65dc43c28ad6373c4f2ee5c8a79b9f505c6b49ab Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Tue, 13 Aug 2024 01:05:42 -0500 Subject: [PATCH] Pipeline run styles --- .../PipelineRuns/PipelineRuns.module.scss | 16 +++ .../Pipelines/PipelineRuns/PipelineRuns.tsx | 116 ++++++++---------- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.module.scss b/src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.module.scss index 067ce4efe..f9ccdba71 100644 --- a/src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.module.scss +++ b/src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.module.scss @@ -41,3 +41,19 @@ .task-executions p { padding: 8px; } + +.runs { + border-bottom: 1px solid #CCCCCC; +} + +.runs-table { + border-radius: 3px 3px 0 0 +} + +.logs { + white-space: pre-line; + padding: 16px; + background: #343A40; + color: #FFFFFF; + border-radius: 0 0 3px 3px; +} diff --git a/src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.tsx b/src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.tsx index 992668e53..0abaaabdb 100644 --- a/src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.tsx +++ b/src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.tsx @@ -4,10 +4,10 @@ import { Workflows as Hooks } from '@tapis/tapisui-hooks'; import { SectionMessage, SectionHeader } from '@tapis/tapisui-common'; import { QueryWrapper } from '@tapis/tapisui-common'; import styles from './PipelineRuns.module.scss'; +import { Link, useHistory, useLocation } from 'react-router-dom'; +import { ExpandMore } from '@mui/icons-material'; +import { Accordion, AccordionDetails, AccordionSummary, Button, AccordionActions } from '@mui/material'; import { Table } from 'reactstrap'; -import { Link } from 'react-router-dom'; -import { Toolbar } from '../../_components'; -import { RunPipelineModal } from '../../_components/Toolbar/RunPipelineModal'; type PipelineRunProps = { order: number; @@ -16,30 +16,6 @@ type PipelineRunProps = { pipelineRun: Workflows.PipelineRun; }; -const PipelineRun: React.FC = ({ - order, - groupId, - pipelineId, - pipelineRun, -}) => { - return ( - - {order} - {pipelineRun.status} - {pipelineRun.started_at} - {pipelineRun.last_modified} - {pipelineRun.uuid} - - - View - - - - ); -}; - type PipelineRunsProps = { groupId: string; pipelineId: string; @@ -55,43 +31,58 @@ const PipelineRuns: React.FC = ({ groupId, pipelineId }) => { a.started_at! < b.started_at! ? 1 : a.started_at! > b.started_at! ? -1 : 0 ); const [showModal, setShowModal] = useState(false); - const toggle = () => { - setShowModal(!showModal); - }; + const history = useHistory() + const { pathname } = useLocation() return (
- {pipelineId} - -
+
{pipelineRuns.length ? ( - - - - - - - - - - - - - {pipelineRuns.map((pipelineRun, i) => ( - - ))} - -
#statusstarted atlast modifieduuidexecutions
+ pipelineRuns.map((run, i) => { + const startedAt = Date.parse(run.started_at!) + const lastModified = Date.parse(run.last_modified!) + const duration = `${Math.floor((lastModified - startedAt)/1000/60)}m ${Math.floor(((lastModified - startedAt)/1000)%60)}s` + return ( + + } + aria-controls="pipeline-run-summary" + id={`pipeline-${pipelineId}-run-summary-${i}`} + > + {run.name} + + + + + + + + + + + + + + + + + + + + + +
#namestatusdurationstartedlast modified
{pipelineRuns.length - i}{run.name}{run.status}{duration}{run.started_at}{run.last_modified}
+
+                      {run.logs}
+                    
+
+ + + +
+ ) + }) ) : ( No runs to show for pipeline '{pipelineId}' @@ -99,13 +90,6 @@ const PipelineRuns: React.FC = ({ groupId, pipelineId }) => { )}
- {/* {showModal && groupId && pipelineId && ( - - )} */}
); };