- Ajout migrations DB: index_job_errors, library_monitoring, full_rebuild_type - API: endpoints progression temps reel (/jobs/:id/stream), active jobs, details - API: support full_rebuild avec suppression donnees existantes - Indexer: logs detailles avec timing [SCAN][META][PARSER][BDD] - Indexer: optimisation parsing PDF (lopdf -> pdfinfo) 235x plus rapide - Indexer: corrections chemins LIBRARIES_ROOT_PATH pour dev local - Backoffice: composants JobProgress, JobsIndicator (header), JobsList - Backoffice: SSE streaming pour progression temps reel - Backoffice: boutons Index/Index Full sur page libraries - Backoffice: highlight job apres creation avec redirection - Fix: parsing volume type i32, sync meilisearch cleanup Perf: parsing PDF passe de 8.7s a 37ms Perf: indexation 45 fichiers en ~15s vs plusieurs minutes avant
36 lines
979 B
TypeScript
36 lines
979 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
|
|
export async function GET(
|
|
request: NextRequest,
|
|
{ params }: { params: Promise<{ id: string }> }
|
|
) {
|
|
const { id } = await params;
|
|
const apiBaseUrl = process.env.API_BASE_URL || "http://api:8080";
|
|
const apiToken = process.env.API_BOOTSTRAP_TOKEN;
|
|
|
|
if (!apiToken) {
|
|
return NextResponse.json({ error: "API token not configured" }, { status: 500 });
|
|
}
|
|
|
|
try {
|
|
const response = await fetch(`${apiBaseUrl}/index/jobs/${id}`, {
|
|
headers: {
|
|
Authorization: `Bearer ${apiToken}`,
|
|
},
|
|
});
|
|
|
|
if (!response.ok) {
|
|
return NextResponse.json(
|
|
{ error: `API error: ${response.status}` },
|
|
{ status: response.status }
|
|
);
|
|
}
|
|
|
|
const data = await response.json();
|
|
return NextResponse.json(data);
|
|
} catch (error) {
|
|
console.error("Proxy error:", error);
|
|
return NextResponse.json({ error: "Failed to fetch job" }, { status: 500 });
|
|
}
|
|
}
|