diff --git a/src/components/DAG/components/DAGContent.tsx b/src/components/DAG/components/DAGContent.tsx index dd53aa60..f997a0d8 100644 --- a/src/components/DAG/components/DAGContent.tsx +++ b/src/components/DAG/components/DAGContent.tsx @@ -259,7 +259,9 @@ const StatusColorStyles = css<{ state: TaskStatus }>` ? 'var(--color-text-warning)' : p.state === 'failed' ? 'var(--color-text-danger)' - : 'var(--color-border-2)'}; + : p.state === 'killed' + ? 'var(--color-text-warning)' + : 'var(--color-border-2)'}; background: ${(p) => p.state === 'completed' ? 'color-mix(in hsl, var(--color-text-success) 5%, #fff)' @@ -267,7 +269,9 @@ const StatusColorStyles = css<{ state: TaskStatus }>` ? 'color-mix(in hsl, var(--color-text-warning) 5%, #fff)' : p.state === 'failed' ? 'color-mix(in hsl, var(--color-text-danger) 5%, #fff)' - : '#fff'}; + : p.state === 'killed' + ? 'color-mix(in hsl, var(--color-text-warning) 5%, #fff)' + : '#fff'}; `; const NormalItem = styled.div<{ state: TaskStatus }>` diff --git a/src/components/TaskListingHeader/components/CustomSettings.tsx b/src/components/TaskListingHeader/components/CustomSettings.tsx index ae4af3ad..3cbec01a 100644 --- a/src/components/TaskListingHeader/components/CustomSettings.tsx +++ b/src/components/TaskListingHeader/components/CustomSettings.tsx @@ -81,6 +81,9 @@ const CustomSettings: React.FC = ({ ['running', t('run.filter-running') + ` (${counts.running})`], ['pending', t('run.filter-pending') + ` (${counts.pending})`], ['failed', t('run.filter-failed') + ` (${counts.failed})`], + ...(counts.killed > 0 + ? ([['killed', t('run.filter-killed') + ` (${counts.killed})`]] as [string, string][]) + : []), ...(counts.unknown > 0 ? ([['unknown', t('run.filter-unknown') + ` (${counts.unknown})`]] as [string, string][]) : []), diff --git a/src/components/TaskListingHeader/components/StatusLights.tsx b/src/components/TaskListingHeader/components/StatusLights.tsx index 3333f18e..ce20377d 100644 --- a/src/components/TaskListingHeader/components/StatusLights.tsx +++ b/src/components/TaskListingHeader/components/StatusLights.tsx @@ -20,10 +20,12 @@ const StatusLights: React.FC = ({ status }) => ( + )} {status === 'completed' && } {status === 'failed' && } + {status === 'killed' && } {status === 'running' && } {status === 'pending' && } {status === 'unknown' && } diff --git a/src/components/Timeline/taskdataUtils.ts b/src/components/Timeline/taskdataUtils.ts index 439a456f..76a371d5 100644 --- a/src/components/Timeline/taskdataUtils.ts +++ b/src/components/Timeline/taskdataUtils.ts @@ -11,6 +11,7 @@ export type RowCounts = { running: number; pending: number; failed: number; + killed: number; unknown: number; }; @@ -20,6 +21,7 @@ export function countTaskRowsByStatus(rows: RowDataModel): RowCounts { completed: 0, running: 0, failed: 0, + killed: 0, pending: 0, unknown: 0, }; @@ -124,6 +126,9 @@ export function getStepStatus(stepTaskData: Record): TaskStatus if (statusOfLastItem === 'failed') { return 'failed'; } + if (statusOfLastItem === 'killed') { + return 'killed'; + } } return 'completed'; } diff --git a/src/components/Timeline/useTaskData.ts b/src/components/Timeline/useTaskData.ts index 1d3f43f4..8c437a58 100644 --- a/src/components/Timeline/useTaskData.ts +++ b/src/components/Timeline/useTaskData.ts @@ -302,6 +302,7 @@ export default function useTaskData(flowId: string, runNumber: string): useTaskD completed: 0, running: 0, failed: 0, + killed: 0, pending: 0, unknown: 0, }); diff --git a/src/pages/Home/ResultGroup/TimelinePreview.tsx b/src/pages/Home/ResultGroup/TimelinePreview.tsx index f7b758ba..ec6f0ca2 100644 --- a/src/pages/Home/ResultGroup/TimelinePreview.tsx +++ b/src/pages/Home/ResultGroup/TimelinePreview.tsx @@ -9,7 +9,7 @@ import { Row } from '@components/Timeline/VirtualizedTimeline'; import useTaskData from '@components/Timeline/useTaskData'; import { startAndEndpointsOfRows } from '@utils/row'; -const zeroCounts = { all: 0, failed: 0, running: 0, completed: 0, unknown: 0, pending: 0 }; +const zeroCounts = { all: 0, failed: 0, running: 0, completed: 0, unknown: 0, pending: 0, killed: 0 }; // // Typedef diff --git a/src/translations/en.ts b/src/translations/en.ts index dc410979..d82aa001 100644 --- a/src/translations/en.ts +++ b/src/translations/en.ts @@ -108,6 +108,7 @@ const en = { 'filter-completed': 'Completed', 'filter-running': 'Running', 'filter-failed': 'Failed', + 'filter-killed': 'Killed', 'filter-pending': 'Pending', 'filter-unknown': 'Unknown', mode: 'Mode', diff --git a/src/types.ts b/src/types.ts index 15e321f4..2e11ae30 100755 --- a/src/types.ts +++ b/src/types.ts @@ -48,7 +48,7 @@ export interface Task extends MetaDataBaseObject { status: TaskStatus; } -export type TaskStatus = 'running' | 'completed' | 'failed' | 'unknown' | 'pending' | 'refining'; +export type TaskStatus = 'running' | 'completed' | 'failed' | 'killed' | 'unknown' | 'pending' | 'refining'; export interface Metadata extends MetaDataBaseObject { id: number; diff --git a/src/utils/style.ts b/src/utils/style.ts index aa36564b..965b1e92 100644 --- a/src/utils/style.ts +++ b/src/utils/style.ts @@ -37,6 +37,8 @@ export function colorByStatus(status: string): string { return 'var(--color-bg-success)'; case 'failed': return 'var(--color-bg-danger)'; + case 'killed': + return 'var(--color-bg-warning)'; case 'running': return 'var(--color-bg-success-light)'; case 'pending': @@ -55,6 +57,8 @@ export function iconByStatus(status: keyof RunStatus | TaskStatus): keyof Suppor return 'completed'; case 'failed': return 'error'; + case 'killed': + return 'warning'; case 'running': return 'running'; default: