feat: document status

This commit is contained in:
shiweisong.ssw 2023-06-28 14:59:13 +08:00
parent f854c94aba
commit abaf45f7c6

View File

@ -10,6 +10,7 @@ import {
Box, Box,
Stack, Stack,
Input, Input,
Chip,
styled styled
} from '@/lib/mui' } from '@/lib/mui'
import moment from 'moment' import moment from 'moment'
@ -108,7 +109,20 @@ const Documents = () => {
<td>{row.doc_type}</td> <td>{row.doc_type}</td>
<td>{row.chunk_size}</td> <td>{row.chunk_size}</td>
<td>{moment(row.last_sync).format('YYYY-MM-DD HH:MM:SS')}</td> <td>{moment(row.last_sync).format('YYYY-MM-DD HH:MM:SS')}</td>
<td>{row.status}</td> <td><Chip color={
(function(){
switch(row.status) {
case 'TODO':
return 'neutral';
case 'RUNNING':
return 'primary';
case 'FINISHED':
return 'success';
case 'FAILED':
return 'danger';
}
})()
}>{row.status}</Chip></td>
<td> <td>
{ {
<> <>