Skip to content

Commit 19b3624

Browse files
authored
Display each document ingestion status for zip files (#516)
* Fix litellm issue * Add collapsing table to zip file entries * handle empty dates
1 parent 622eaa2 commit 19b3624

File tree

2 files changed

+315
-48
lines changed

2 files changed

+315
-48
lines changed

Diff for: admin_app/src/app/content/api.ts

+29-13
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,47 @@ import api, { handleApiError } from "@/utils/api";
22

33
type IndexingStatusResponse = boolean | { detail: string };
44

5+
export interface DocIndexingTask {
6+
error_trace: string;
7+
finished_datetime_utc: string;
8+
upload_id: string;
9+
user_id: number;
10+
workspace_id: number;
11+
parent_file_name: string;
12+
created_datetime_utc: string;
13+
task_id: string;
14+
doc_name: string;
15+
task_status: string;
16+
}
17+
518
export interface DocIndexingStatusRow {
619
fileName: string;
720
status: "Ongoing" | "Done" | "Error";
821
docsIndexed: string;
922
errorTrace: string;
1023
created_at: string;
1124
finished_at: string;
25+
tasks: DocIndexingTask[];
1226
}
1327

1428
interface ContentBody {
1529
content_title: string;
1630
content_text: string;
1731
content_metadata: Record<string, unknown>;
1832
}
33+
34+
const formatDate = (dateString: string) => {
35+
if (!dateString) return "—";
36+
const date = new Date(dateString);
37+
return new Intl.DateTimeFormat("en-US", {
38+
year: "numeric",
39+
month: "short",
40+
day: "numeric",
41+
hour: "2-digit",
42+
minute: "2-digit",
43+
second: "2-digit",
44+
}).format(date);
45+
};
1946
const getContentList = async ({
2047
token,
2148
skip = 0,
@@ -208,19 +235,6 @@ const getDocIndexingStatusData = async (
208235
headers: { Authorization: `Bearer ${token}` },
209236
});
210237

211-
const formatDate = (dateString: string) => {
212-
if (!dateString) return "—";
213-
const date = new Date(dateString);
214-
return new Intl.DateTimeFormat("en-US", {
215-
year: "numeric",
216-
month: "short",
217-
day: "numeric",
218-
hour: "2-digit",
219-
minute: "2-digit",
220-
second: "2-digit",
221-
}).format(date);
222-
};
223-
224238
return response.data
225239
.map((entry: any) => ({
226240
fileName: entry.parent_file_name,
@@ -234,6 +248,7 @@ const getDocIndexingStatusData = async (
234248
errorTrace: entry.error_trace || "",
235249
created_at: formatDate(entry.created_datetime_utc),
236250
finished_at: formatDate(entry.finished_datetime_utc),
251+
tasks: (entry.tasks as DocIndexingTask[]) || [],
237252
}))
238253
.sort(
239254
(a: DocIndexingStatusRow, b: DocIndexingStatusRow) =>
@@ -246,6 +261,7 @@ const getDocIndexingStatusData = async (
246261
};
247262

248263
export {
264+
formatDate,
249265
getContentList,
250266
getContent,
251267
archiveContent,

0 commit comments

Comments
 (0)