4cb36a92e8
- tabs.cpp draw_timeline: scatter ImPlot con eje X tiempo (UseLocalTime), eje Y categorico DAG (SetupAxisTicks), 1 serie por status con color consistente (verde/rojo/amarillo/gris). - Combo ventana: 15m/1h/6h/24h/7d. Default 24h. - Hover tooltip: punto mas cercano en pixel-space -> muestra status, dag, run id, started/finished, trigger, error. - main.cpp: g_runs_all cache. Snapshot inicial via list_runs_http(limit=200) + upserts desde WS deltas. Auto-refresh por g_refresh_pending. - Panel toggle "Timeline" en el menu View. - Helper parse_rfc3339 inline (ignora offset, asume hora local — coherente con ImPlot::UseLocalTime). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
51 lines
1.7 KiB
C++
51 lines
1.7 KiB
C++
#pragma once
|
|
|
|
// Tabs / panels para dag_engine_ui:
|
|
// - DAG List (lista todos los DAGs, double-click -> selecciona)
|
|
// - DAG Detail (header + Run Now + recent runs como data_table)
|
|
// - Run Detail (steps con duracion/status + stdout/stderr expandible)
|
|
//
|
|
// Todos usan data_table_cpp_viz (issue 0081). State persistente por tab.
|
|
|
|
#include "data_http.h"
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace dag_ui_tabs {
|
|
|
|
// Estado global cross-tab: que DAG/run esta seleccionado actualmente.
|
|
struct Selection {
|
|
std::string dag_name; // "" = nada seleccionado
|
|
std::string run_id; // "" = nada seleccionado
|
|
};
|
|
|
|
Selection& selection();
|
|
|
|
// Cache: detalle actual del DAG seleccionado + del run seleccionado.
|
|
// Se rellena bajo demanda al cambiar la seleccion (o boton Refresh).
|
|
struct Caches {
|
|
dag_ui::DagDetail dag_detail;
|
|
dag_ui::DagRunDetail run_detail;
|
|
bool dag_detail_loaded = false;
|
|
bool run_detail_loaded = false;
|
|
};
|
|
|
|
Caches& caches();
|
|
|
|
// Render cada tab. api_url es el endpoint dag_engine.
|
|
// `live_runs` es el cache global mantenido por WS (sirve para DAG List status).
|
|
void draw_dag_list(const std::string& api_url,
|
|
const std::vector<dag_ui::DagInfo>& dags,
|
|
const std::vector<dag_ui::DagRunRow>& live_runs);
|
|
|
|
void draw_dag_detail(const std::string& api_url);
|
|
|
|
void draw_run_detail(const std::string& api_url);
|
|
|
|
// Timeline panel: scatter X=time, Y=DAG name, color por status.
|
|
// `runs_all` es el cache global de las ultimas N runs (mantenido por main.cpp).
|
|
void draw_timeline(const std::string& api_url,
|
|
const std::vector<dag_ui::DagRunRow>& runs_all);
|
|
|
|
} // namespace dag_ui_tabs
|