Skip to content

Commit e128a4e

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

File tree

2 files changed

+23
-59
lines changed

2 files changed

+23
-59
lines changed

ui/src/MainPage.vue

Lines changed: 23 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,35 @@ 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 progressLine = cellData.value?.progressLine ?? 'Not started';
113+
const live = cellData.value?.live ?? true;
104114
105-
if (parsed.stage === 'Queued') {
115+
const raw = progressLine.replace(ProgressPrefix, '');
116+
const match = raw.match(ProgressPattern);
117+
if (!match || raw === 'Queued')
106118
return {
107119
status: 'not_started',
108-
text: parsed.stage,
120+
text: raw,
109121
};
110-
}
122+
123+
const { stage, progress, eta } = match.groups!;
111124
112125
return {
113-
status: parsed.stage === 'Done' ? 'done' : 'running',
114-
percent: parsed.percentage,
115-
text: parsed.stage,
116-
suffix: parsed.etaLabel ?? '',
126+
status: live ? 'running' : 'done',
127+
percent: progress,
128+
text: stage,
129+
suffix: eta ? `ETA: ${eta}` : '',
117130
};
118131
},
119132
}),

ui/src/parseProgress.ts

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

0 commit comments

Comments
 (0)