- Add run pipeline page with job selection UI - Add execution detail page with stage metrics visualization - Add stage_metrics and total_duration_ms to pipeline.executions table - Create Next.js API proxy routes for all pipeline endpoints - Fix trailing slash issues in pipeline-api.ts URLs - Add Docker volume mounts for pipeline packages - Add REVIEWIQ_DATABASE_URL and LLM API keys to docker-compose - Fix JSONB field parsing in execution detail endpoint Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
31 lines
887 B
TypeScript
31 lines
887 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
|
|
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000';
|
|
|
|
export async function GET(
|
|
request: NextRequest,
|
|
{ params }: { params: Promise<{ pipelineId: string; executionId: string }> }
|
|
) {
|
|
try {
|
|
const { pipelineId, executionId } = await params;
|
|
const url = `${API_BASE_URL}/api/pipelines/${pipelineId}/executions/${executionId}`;
|
|
const response = await fetch(url);
|
|
|
|
if (!response.ok) {
|
|
return NextResponse.json(
|
|
{ error: 'Failed to fetch execution' },
|
|
{ status: response.status }
|
|
);
|
|
}
|
|
|
|
const data = await response.json();
|
|
return NextResponse.json(data);
|
|
} catch (error) {
|
|
console.error('Pipeline execution API error:', error);
|
|
return NextResponse.json(
|
|
{ error: 'Failed to fetch execution' },
|
|
{ status: 500 }
|
|
);
|
|
}
|
|
}
|