Skip to content

Commit

Permalink
ML Edge updates. Styles for pipeline runs
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Aug 13, 2024
1 parent 3c5ba98 commit 27f38b2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,12 @@ const AnalysisForm: React.FC = () => {
}
onBlur={handleBlur}
value={values.model}
className={
errors.model && touched.model ? 'is-invalid' : ''
}
>
<option value="" label="Select option" />
<option
value="kudu-megadetector-ft"
label="kudu-megadetector-ft"
/>
<option value="megadetectorv5a" label="megadetectorv5a" />
<option value="megadetectorv5b" label="megadetectorv5b" />
<option
Expand Down Expand Up @@ -442,6 +443,7 @@ const AnalysisForm: React.FC = () => {
value="Ohio Small Animals dataset"
label="Ohio Small Animals dataset"
/>
<option value="okavango-delta" label="Okavanga Delta" />
<option value="Other" label="Other" />
</Input>
{values.dataset === 'Other' && (
Expand Down
28 changes: 28 additions & 0 deletions src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,34 @@
border-radius: 3px 3px 0 0;
}

.run-status-text {
display: inline-block;
}

.run-status-icon {
display: inline-block;
border-radius: 50%;
margin-right: 16px;
height: 12px;
width: 12px;
}

.run-status-icon-failed {
background-color: #d32f2f;
}

.run-status-icon-completed {
background-color: #15bd42;
}

.run-status-icon-pending {
background-color: #ffa726;
}

.run-status-icon-active {
background-color: #ffa726;
}

.logs {
white-space: pre-line;
padding: 16px;
Expand Down
35 changes: 24 additions & 11 deletions src/app/Workflows/Pipelines/PipelineRuns/PipelineRuns.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useState } from 'react';
import React, { useState, useMemo } from 'react';
import { Workflows } from '@tapis/tapis-typescript';
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 { ExpandMore, Check, Close, DonutLarge } from '@mui/icons-material';
import {
Accordion,
AccordionDetails,
Expand All @@ -15,16 +15,25 @@ import {
} from '@mui/material';
import { Table } from 'reactstrap';

type PipelineRunProps = {
order: number;
type PipelineRunsProps = {
groupId: string;
pipelineId: string;
pipelineRun: Workflows.PipelineRun;
};

type PipelineRunsProps = {
groupId: string;
pipelineId: string;
const PipelineRunHeader: React.FC<{
status: Workflows.PipelineRun['status'];
text: string | undefined;
}> = ({ status, text = '' }) => {
return (
<div>
<div
className={`${styles['run-status-icon']} ${
styles[`run-status-icon-${status}`]
}`}
/>
<div className={styles['run-status-text']}>{text}</div>
</div>
);
};

const PipelineRuns: React.FC<PipelineRunsProps> = ({ groupId, pipelineId }) => {
Expand Down Expand Up @@ -58,7 +67,9 @@ const PipelineRuns: React.FC<PipelineRunsProps> = ({ groupId, pipelineId }) => {
aria-controls="pipeline-run-summary"
id={`pipeline-${pipelineId}-run-summary-${i}`}
>
<b>{run.name}</b>
<div>
<PipelineRunHeader status={run.status} text={run.name} />
</div>
</AccordionSummary>
<AccordionDetails>
<Table
Expand All @@ -69,7 +80,7 @@ const PipelineRuns: React.FC<PipelineRunsProps> = ({ groupId, pipelineId }) => {
>
<thead>
<tr>
<th>#</th>
<th style={{ textAlign: 'center' }}>#</th>
<th>name</th>
<th>status</th>
<th>duration</th>
Expand All @@ -78,7 +89,9 @@ const PipelineRuns: React.FC<PipelineRunsProps> = ({ groupId, pipelineId }) => {
</tr>
</thead>
<tr>
<th scope="row">{pipelineRuns.length - i}</th>
<th style={{ textAlign: 'center' }} scope="row">
{pipelineRuns.length - i}
</th>
<td>{run.name}</td>
<td>{run.status}</td>
<td>{duration}</td>
Expand Down

0 comments on commit 27f38b2

Please sign in to comment.