feat(dashboard): v0.3.0 — Status panel, dashboard_panel/grid, AppConfig pattern
- main.cpp: bump 0.2.0 → 0.3.0; añadir Status section en Settings via settings_window_add_section (fuente API/SQLite, URL, DB path, Reload). - views.cpp: chart_panel manual + BeginChild custom → dashboard_panel/grid del registry. KPI cards con sparkline a la derecha, altura responsive. - views.h: signature de draw_kpi_row pasa RegistryData (para sparkline). - CMakeLists.txt: añadir process_state_machine.cpp (dependencia de process_runner tras issue 0045).
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include "core/fullscreen_window.h"
|
||||
#include "core/app_menubar.h"
|
||||
#include "core/app_about.h"
|
||||
#include "core/app_settings.h"
|
||||
#include "core/tokens.h"
|
||||
#include "data.h"
|
||||
#include "data_http.h"
|
||||
#include "views.h"
|
||||
@@ -118,12 +120,51 @@ int main(int argc, char** argv) {
|
||||
// Info de la ventana About (submenu Settings → About...)
|
||||
fn_ui::about_window_set_info(
|
||||
"fn_registry Dashboard",
|
||||
"0.2.0",
|
||||
"0.3.0",
|
||||
"Dashboard ImGui para visualizar el estado del fn_registry. "
|
||||
"Consume datos via sqlite_api HTTP (fallback a SQLite directo). "
|
||||
"KPIs, charts, tablas, desglose por lenguaje/dominio/pureza."
|
||||
"KPIs con sparkline, charts con leyenda, tablas, altura responsive, "
|
||||
"Status panel en Settings, multi-viewport, dashboard_panel en views."
|
||||
);
|
||||
|
||||
// Seccion Status dentro de la ventana Settings (submenu Settings → Settings...).
|
||||
// Muestra fuente activa de datos, URL del API y path SQLite fallback.
|
||||
fn_ui::settings_window_add_section("status", "Status", []{
|
||||
using namespace fn_tokens;
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, colors::text_muted);
|
||||
ImGui::TextUnformatted("Source:");
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::SameLine();
|
||||
if (g_loaded) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, colors::success);
|
||||
ImGui::TextUnformatted(g_using_http ? "HTTP API (connected)" : "SQLite (direct)");
|
||||
ImGui::PopStyleColor();
|
||||
} else {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, colors::error);
|
||||
ImGui::TextUnformatted("not connected");
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
if (!g_api_url.empty()) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, colors::text_muted);
|
||||
ImGui::TextUnformatted("API:");
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::SameLine();
|
||||
ImGui::TextUnformatted(g_api_url.c_str());
|
||||
}
|
||||
if (!g_db_path.empty()) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, colors::text_muted);
|
||||
ImGui::TextUnformatted("DB:");
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::SameLine();
|
||||
ImGui::TextUnformatted(g_db_path.c_str());
|
||||
}
|
||||
ImGui::Spacing();
|
||||
if (ImGui::Button("Reload")) {
|
||||
ImGui::GetIO().UserData = reinterpret_cast<void*>(1);
|
||||
}
|
||||
});
|
||||
|
||||
reload_data();
|
||||
|
||||
return fn::run_app(
|
||||
|
||||
Reference in New Issue
Block a user