@@ -4,7 +4,7 @@ import { AgGridVue } from 'ag-grid-vue3';
4
4
import { ClientSideRowModelModule } from ' ag-grid-enterprise' ;
5
5
import type { ColDef , GridApi , GridOptions , GridReadyEvent } from ' ag-grid-enterprise' ;
6
6
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' ;
8
8
import {
9
9
AgGridTheme ,
10
10
PlAgOverlayLoading ,
@@ -28,7 +28,6 @@ import SettingsPanel from './SettingsPanel.vue';
28
28
import { getAlignmentChartSettings } from ' ./charts/alignmentChartSettings' ;
29
29
import { getChainsChartSettings } from ' ./charts/chainsChartSettings' ;
30
30
import { PlAgChartStackedBarCell , createAgGridColDef } from ' @platforma-sdk/ui-vue' ;
31
- import { parseProgressString } from ' ./parseProgress' ;
32
31
import type { ProgressLogWithInfo } from ' @platforma-sdk/model' ;
33
32
34
33
const app = useApp ();
@@ -99,21 +98,36 @@ const columnDefs: ColDef<MiXCRResult>[] = [
99
98
colId: ' progress' ,
100
99
field: ' progress' ,
101
100
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'
102
111
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 ;
104
115
105
- if (parsed .stage === ' Queued' ) {
116
+ const raw = progressLine .replace (ProgressPrefix , ' ' );
117
+ const match = raw .match (ProgressPattern );
118
+ if (! match || raw === ' Queued' )
106
119
return {
107
120
status: ' not_started' ,
108
- text: parsed . stage ,
121
+ text: raw ,
109
122
};
110
- }
123
+
124
+ const { stage, progress, eta } = match .groups ! ;
111
125
112
126
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 } ` : ' ' ,
117
131
};
118
132
},
119
133
}),
0 commit comments