Add kb index status

This commit is contained in:
Xin Wang
2026-02-10 10:34:25 +08:00
parent 94a562a1d5
commit 323ef61573
5 changed files with 30 additions and 5 deletions

View File

@@ -525,6 +525,8 @@ const KnowledgeBaseDetail: React.FC<{
<TableRow>
<TableHead></TableHead>
<TableHead></TableHead>
<TableHead></TableHead>
<TableHead></TableHead>
<TableHead></TableHead>
<TableHead className="text-right"></TableHead>
</TableRow>
@@ -536,6 +538,12 @@ const KnowledgeBaseDetail: React.FC<{
<FileText className="h-4 w-4 mr-2 text-primary" /> {doc.name}
</TableCell>
<TableCell className="text-muted-foreground">{doc.size}</TableCell>
<TableCell>
<Badge variant="outline">
{doc.status === 'completed' ? '已索引' : doc.status === 'failed' ? '失败' : doc.status === 'processing' ? '处理中' : '待处理'}
</Badge>
</TableCell>
<TableCell className="text-muted-foreground">{doc.chunkCount ?? 0}</TableCell>
<TableCell className="text-muted-foreground">{doc.uploadDate}</TableCell>
<TableCell className="text-right">
<Button
@@ -550,7 +558,7 @@ const KnowledgeBaseDetail: React.FC<{
</TableRow>
)) : (
<TableRow>
<TableCell colSpan={4} className="text-center py-8 text-muted-foreground"></TableCell>
<TableCell colSpan={6} className="text-center py-8 text-muted-foreground"></TableCell>
</TableRow>
)}
</tbody>

View File

@@ -154,6 +154,8 @@ const mapKnowledgeDocument = (raw: AnyRecord): KnowledgeDocument => ({
name: readField(raw, ['name'], ''),
size: readField(raw, ['size'], ''),
uploadDate: normalizeDateLabel(readField(raw, ['uploadDate', 'upload_date', 'created_at'], '')),
status: readField(raw, ['status'], 'pending'),
chunkCount: Number(readField(raw, ['chunkCount', 'chunk_count'], 0)),
});
const mapKnowledgeBase = (raw: AnyRecord): KnowledgeBase => ({

View File

@@ -57,6 +57,8 @@ export interface KnowledgeDocument {
name: string;
size: string;
uploadDate: string;
status?: string;
chunkCount?: number;
}
export type InteractionType = 'text' | 'audio' | 'video';