feat: tabs DAG List / Detail / Run Detail via data_table_cpp_viz (issue 0095 step 5)
- tabs.{h,cpp}: 3 paneles que renderizan TableInput con data_table::render() + RowDoubleClick events para drill-down (DAG -> Detail -> Run Detail).
- main.cpp: arranca con auto-fetch DAGs y los 3 tabs visibles por defecto. Panel Main diagnostico apagado.
- CMakeLists.txt: linka empty_state.cpp del registry.
- app.md: uses_functions completo (data_table_cpp_viz + stack TQL + empty_state). Tags: [imgui, dashboard, dag, scheduler, http, websocket].
Funcionalidades:
- DAG List: tabla con Name/Schedule/Last Status/Tags/Valid/File. Status combina last_run (REST) + live_runs (WS). Double-click selecciona DAG.
- DAG Detail: header + Run Now (POST /api/dags/{name}/run) + tabla recent runs. Double-click run abre Run Detail.
- Run Detail: header del run + tabla steps (name/status/exit/duration/started) + CollapsingHeader por step con stdout/stderr.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "core/logger.h"
|
||||
#include "data_http.h"
|
||||
#include "ws_client.h"
|
||||
#include "tabs.h"
|
||||
#include "vendor/nlohmann/json.hpp"
|
||||
|
||||
#include <string>
|
||||
@@ -29,8 +30,14 @@ static std::string g_last_error;
|
||||
static WsClient g_ws;
|
||||
|
||||
// Toggles de paneles (visibles desde el menu View del menubar canonico)
|
||||
static bool g_show_main = true;
|
||||
static bool g_show_live = true;
|
||||
static bool g_show_main = false; // diagnostico, off por defecto
|
||||
static bool g_show_live = true;
|
||||
static bool g_show_dag_list = true;
|
||||
static bool g_show_dag_detail = true;
|
||||
static bool g_show_run_detail = true;
|
||||
|
||||
// Auto-fetch DAG list una vez al arrancar.
|
||||
static bool g_initial_fetched = false;
|
||||
|
||||
// Upsert por id en g_live_runs.
|
||||
static void upsert_live_run(const dag_ui::DagRunRow& r) {
|
||||
@@ -115,6 +122,12 @@ static void draw_live() {
|
||||
}
|
||||
|
||||
static void render() {
|
||||
// Auto-fetch DAGs on first frame.
|
||||
if (!g_initial_fetched) {
|
||||
g_initial_fetched = true;
|
||||
dag_ui::list_dags_http(g_api_url, g_dags);
|
||||
}
|
||||
|
||||
// Drain WS messages this frame (cheap, max 64).
|
||||
{
|
||||
std::vector<std::string> msgs;
|
||||
@@ -122,8 +135,11 @@ static void render() {
|
||||
for (auto& m : msgs) parse_ws_payload(m);
|
||||
}
|
||||
|
||||
if (g_show_main) draw_main();
|
||||
if (g_show_live) draw_live();
|
||||
if (g_show_dag_list) dag_ui_tabs::draw_dag_list(g_api_url, g_dags, g_live_runs);
|
||||
if (g_show_dag_detail) dag_ui_tabs::draw_dag_detail(g_api_url);
|
||||
if (g_show_run_detail) dag_ui_tabs::draw_run_detail(g_api_url);
|
||||
if (g_show_main) draw_main();
|
||||
if (g_show_live) draw_live();
|
||||
}
|
||||
|
||||
int main(int /*argc*/, char** /*argv*/) {
|
||||
@@ -131,8 +147,11 @@ int main(int /*argc*/, char** /*argv*/) {
|
||||
g_ws.start(g_ws_host, g_ws_port, g_ws_path);
|
||||
|
||||
static fn_ui::PanelToggle panels[] = {
|
||||
{ "Main", nullptr, &g_show_main },
|
||||
{ "Live (WS)", nullptr, &g_show_live },
|
||||
{ "DAGs", nullptr, &g_show_dag_list },
|
||||
{ "DAG Detail", nullptr, &g_show_dag_detail },
|
||||
{ "Run Detail", nullptr, &g_show_run_detail },
|
||||
{ "Live (WS)", nullptr, &g_show_live },
|
||||
{ "Main (diag)", nullptr, &g_show_main },
|
||||
};
|
||||
|
||||
fn::AppConfig cfg;
|
||||
|
||||
Reference in New Issue
Block a user