diff --git a/app/routers/runs.py b/app/routers/runs.py index 8a4030d..7341f70 100644 --- a/app/routers/runs.py +++ b/app/routers/runs.py @@ -171,11 +171,42 @@ async def get_run( "media_type": media_type or "application/octet-stream", }) + # Build DAG elements for visualization + dag_elements = [] + if plan and plan.get("steps"): + node_colors = { + "input": "#3b82f6", + "effect": "#8b5cf6", + "analyze": "#ec4899", + "transform": "#10b981", + "output": "#f59e0b", + "SOURCE": "#3b82f6", + "EFFECT": "#8b5cf6", + "SEQUENCE": "#ec4899", + } + for i, step in enumerate(plan["steps"]): + step_id = step.get("id", f"step-{i}") + dag_elements.append({ + "data": { + "id": step_id, + "label": step.get("name", f"Step {i+1}"), + "color": node_colors.get(step.get("type", "effect"), "#6b7280"), + } + }) + for inp in step.get("inputs", []): + dag_elements.append({ + "data": { + "source": inp, + "target": step_id, + } + }) + templates = get_templates(request) return render(templates, "runs/detail.html", request, run=run, plan=plan, artifacts=artifacts, + dag_elements=dag_elements, active_tab="runs", )