@@ -60,8 +60,9 @@ const useUploadMutation = (index: RagIndexAttributes | null) => {
60
60
61
61
const RagFile : React . FC < { file : RagFileAttributes } > = ( { file } ) => {
62
62
const inProgress = file . pipelineStage !== 'completed' && file . pipelineStage !== 'pending'
63
- const progressIdx = IngestionPipelineStageKeys . findIndex ( ( stage ) => stage === file . pipelineStage )
63
+ const progressIdx = IngestionPipelineStageKeys . findIndex ( ( stage ) => stage === file . pipelineStage ) - 1
64
64
const progressNextIdx = inProgress ? progressIdx + 1 : progressIdx
65
+ const numSteps = IngestionPipelineStageKeys . length - 2
65
66
66
67
return (
67
68
< Paper sx = { { padding : 2 , marginBottom : 2 } } elevation = { 3 } >
@@ -85,16 +86,12 @@ const RagFile: React.FC<{ file: RagFileAttributes }> = ({ file }) => {
85
86
< TableCell > { file . fileType } </ TableCell >
86
87
< TableCell > { file . fileSize } </ TableCell >
87
88
< TableCell > { file . numChunks } </ TableCell >
88
- < TableCell > { file . pipelineStage } </ TableCell >
89
+ < TableCell > { IngestionPipelineStages [ file . pipelineStage ] . name } </ TableCell >
89
90
</ TableRow >
90
91
</ TableBody >
91
92
</ Table >
92
93
{ file . pipelineStage !== 'completed' && file . pipelineStage !== 'pending' && (
93
- < LinearProgress
94
- variant = "buffer"
95
- value = { ( progressIdx * 100 ) / ( IngestionPipelineStageKeys . length - 1 ) }
96
- valueBuffer = { ( progressNextIdx * 100 ) / ( IngestionPipelineStageKeys . length - 1 ) }
97
- />
94
+ < LinearProgress variant = "buffer" value = { ( progressIdx * 100 ) / numSteps } valueBuffer = { ( progressNextIdx * 100 ) / numSteps } />
98
95
) }
99
96
{ file . error && (
100
97
< Typography variant = "body2" color = "error" >
@@ -132,8 +129,8 @@ export const RagIndex: React.FC = () => {
132
129
133
130
return (
134
131
< >
135
- < Typography variant = ' body1' > RAG index</ Typography >
136
- < Typography variant = 'h3' > { ragDetails ?. metadata ?. name } </ Typography >
132
+ < Typography variant = " body1" > RAG index</ Typography >
133
+ < Typography variant = "h3" > { ragDetails ?. metadata ?. name } </ Typography >
137
134
< Box py = { 2 } >
138
135
< Box sx = { { display : 'flex' , gap : 2 } } >
139
136
< Button component = "label" role = { undefined } variant = "contained" tabIndex = { - 1 } startIcon = { < CloudUpload /> } disabled = { uploadMutation . isPending } >
0 commit comments