diff --git a/src/renderer/components/Experiment/Eval/EvalJobsTable.tsx b/src/renderer/components/Experiment/Eval/EvalJobsTable.tsx index 19f0ffee429052bb005eefaa919ef1383d297851..ac6c602f550ceadf2ae954fd0ec4c885a6fa3147 100644 --- a/src/renderer/components/Experiment/Eval/EvalJobsTable.tsx +++ b/src/renderer/components/Experiment/Eval/EvalJobsTable.tsx @@ -15,6 +15,7 @@ import ViewOutputModalStreaming from './ViewOutputModalStreaming'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; +import { jobChipColor } from 'renderer/lib/utils'; dayjs.extend(relativeTime); var duration = require('dayjs/plugin/duration'); dayjs.extend(duration); @@ -65,7 +66,14 @@ const EvalJobsTable = () => { {job?.job_data?.evaluator} </td> <td> - <Chip>{job.status}</Chip> + <Chip + sx={{ + backgroundColor: jobChipColor(job.status), + color: 'var(--joy-palette-neutral-800)', + }} + > + {job.status} + </Chip> <br /> Progress: {job?.progress} </td> diff --git a/src/renderer/components/Experiment/Train/TrainLoRA.tsx b/src/renderer/components/Experiment/Train/TrainLoRA.tsx index 64adc78b252eadf16be7008329f11a74f8e1934c..66f645b192462bb72d926e3cb3647447de4e50c3 100644 --- a/src/renderer/components/Experiment/Train/TrainLoRA.tsx +++ b/src/renderer/components/Experiment/Train/TrainLoRA.tsx @@ -49,6 +49,7 @@ import relativeTime from 'dayjs/plugin/relativeTime'; import ViewOutputModalStreaming from './ViewOutputModalStreaming'; import CurrentDownloadBox from 'renderer/components/currentDownloadBox'; import DownloadProgressBox from 'renderer/components/Shared/DownloadProgressBox'; +import { jobChipColor } from 'renderer/lib/utils'; dayjs.extend(relativeTime); var duration = require('dayjs/plugin/duration'); dayjs.extend(duration); @@ -71,16 +72,6 @@ function formatTemplateConfig(config): ReactElement { return r; } -function jobChipColor(status: string): string { - if (status === 'COMPLETE') return 'var(--joy-palette-success-200)'; - if (status === 'QUEUED') return 'var(--joy-palette-warning-200)'; - if (status === 'FAILED') return 'var(--joy-palette-danger-200)'; - if (status == 'STOPPED') return 'var(--joy-palette-warning-200)'; - if (status == 'RUNNING') return 'rgb(225,237,233)'; - - return 'var(--joy-palette-neutral-200)'; -} - function formatJobConfig(c): ReactElement { const r = ( <> diff --git a/src/renderer/lib/utils.ts b/src/renderer/lib/utils.ts index 8b303fba193c9582071540c80a8e28fc85cd1294..6ad0c10c2564f2a407886c355e444383a0c5190a 100644 --- a/src/renderer/lib/utils.ts +++ b/src/renderer/lib/utils.ts @@ -201,3 +201,13 @@ export function useTraceUpdate(props) { prev.current = props; }); } + +export function jobChipColor(status: string): string { + if (status === 'COMPLETE') return 'var(--joy-palette-success-200)'; + if (status === 'QUEUED') return 'var(--joy-palette-warning-200)'; + if (status === 'FAILED') return 'var(--joy-palette-danger-200)'; + if (status == 'STOPPED') return 'var(--joy-palette-warning-200)'; + if (status == 'RUNNING') return 'rgb(225,237,233)'; + + return 'var(--joy-palette-neutral-200)'; +}