diff --git a/app.py b/app.py index 6d82b12..2671df9 100644 --- a/app.py +++ b/app.py @@ -950,11 +950,19 @@ def pipeline_visual_asset(asset): for n in nodes: n["status"] = "idle" - recent_runs = [{ - "started_at": r["started_at"], - "decio_decision": r.get("decio_decision", "?"), - "status": r.get("status", "completed") - } for r in last_5] + # Para USD/XAU, não mostrar histórico BTC — ativo ainda não executou pipeline + if asset != 'btc': + recent_runs = [{ + "started_at": "—", + "decio_decision": f"Execute o pipeline de {asset_labels.get(asset, asset)} para ver o histórico", + "status": "no-data" + }] + else: + recent_runs = [{ + "started_at": r["started_at"], + "decio_decision": r.get("decio_decision", "?"), + "status": r.get("status", "completed") + } for r in last_5] return jsonify({"nodes": nodes, "recent_runs": recent_runs, "asset": asset}) except Exception as e: