import React from 'react'; import type { Application } from '../../application/application.model'; import type { IExecution, IServerGroup, ITask } from '../../domain'; import { CollapsibleSection, robotToHuman } from '../../presentation'; import { PlatformHealthOverrideMessage } from '../../task/PlatformHealthOverrideMessage'; import { StatusGlyph } from '../../task/StatusGlyph'; import { displayableTasks } from '../../task/displayableTasks.filter'; import { duration } from '../../utils/timeFormatters'; export interface IRunningTasksProps { application: Application; serverGroup: IServerGroup; } export class RunningTasks extends React.Component { public render() { const { application, serverGroup } = this.props; const tasks = serverGroup.runningTasks || []; const executions = serverGroup.runningExecutions || []; if (tasks.length > 0 || executions.length > 0) { return ( {tasks .sort((a, b) => a.startTime - b.startTime) .map((task) => ( ))} {executions.map((execution) => ( ))} ); } return null; } } const Task = (props: { task: ITask; application: Application }): JSX.Element => (
{props.task.name} {displayableTasks(props.task.steps).map((step, index) => (
{robotToHuman(step.name)} {step.name === 'waitForUpInstances' && ( )}
{duration(step.runningTimeInMs)}
))}
); const Execution = (props: { execution: IExecution }): JSX.Element => (
Pipeline: {props.execution.name} {props.execution.stages.map((stage) => (
{robotToHuman(stage.name)}
{duration(stage.runningTimeInMs)}
))}
);