Skip to content

Commit b7c3d81

Browse files
committed
ui: simplify progress futher
1 parent a6c5394 commit b7c3d81

File tree

2 files changed

+24
-59
lines changed

2 files changed

+24
-59
lines changed

ui/src/MainPage.vue

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AgGridVue } from 'ag-grid-vue3';
44
import { ClientSideRowModelModule } from 'ag-grid-enterprise';
55
import type { ColDef, GridApi, GridOptions, GridReadyEvent } from 'ag-grid-enterprise';
66
import { ModuleRegistry } from 'ag-grid-enterprise';
7-
import type { PlId, Qc } from '@platforma-open/milaboratories.mixcr-clonotyping.model';
7+
import { ProgressPattern, ProgressPrefix, type PlId, type Qc } from '@platforma-open/milaboratories.mixcr-clonotyping.model';
88
import {
99
AgGridTheme,
1010
PlAgOverlayLoading,
@@ -28,7 +28,6 @@ import SettingsPanel from './SettingsPanel.vue';
2828
import { getAlignmentChartSettings } from './charts/alignmentChartSettings';
2929
import { getChainsChartSettings } from './charts/chainsChartSettings';
3030
import { PlAgChartStackedBarCell, createAgGridColDef } from '@platforma-sdk/ui-vue';
31-
import { parseProgressString } from './parseProgress';
3231
import type { ProgressLogWithInfo } from '@platforma-sdk/model';
3332
3433
const app = useApp();
@@ -99,21 +98,36 @@ const columnDefs: ColDef<MiXCRResult>[] = [
9998
colId: 'progress',
10099
field: 'progress',
101100
headerName: 'Progress',
101+
102+
// Progress string examples:
103+
// 'Final sorting: 95.2%'
104+
// 'Building pre-clones from tag groups: 92.9% ETA: 00:00:00'
105+
// 'Initialization: progress unknown'
106+
// 'Applying correction & sorting alignments by UMI'
107+
// 'Alignment: 60.4% ETA: 00:00:01'
108+
// 'Exporting clones: 11.1%'
109+
// 'Queued'
110+
// 'Done'
102111
progress(cellData) {
103-
const parsed = parseProgressString(cellData.value?.progressLine, cellData.value?.live);
112+
const val = cellData.value;
113+
const progressLine = val?.progressLine ?? 'Not started';
114+
const live = val?.live ?? true;
104115
105-
if (parsed.stage === 'Queued') {
116+
const raw = progressLine.replace(ProgressPrefix, '');
117+
const match = raw.match(ProgressPattern);
118+
if (!match || raw === 'Queued')
106119
return {
107120
status: 'not_started',
108-
text: parsed.stage,
121+
text: raw,
109122
};
110-
}
123+
124+
const { stage, progress, eta } = match.groups!;
111125
112126
return {
113-
status: parsed.stage === 'Done' ? 'done' : 'running',
114-
percent: parsed.percentage,
115-
text: parsed.stage,
116-
suffix: parsed.etaLabel ?? '',
127+
status: live ? 'running' : 'done',
128+
percent: progress,
129+
text: live ? stage : 'Done',
130+
suffix: eta ? `ETA: ${eta}` : '',
117131
};
118132
},
119133
}),

ui/src/parseProgress.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)