a466fff71a
- main.cpp: registrar info About via fn_ui::about_window_set_info - views.cpp: nueva columna "Git" en la tabla Apps (remote/local/-) - data.h/cpp + data_http.cpp: AppRow gana repo_url + dir_path - views.cpp: actions bar (Reindex / + Add / Reload / inbox) y modal Add - views.cpp: tab Projects con tree + detalle anidado - data_http.cpp: load_projects_http, load_project_detail_http, http_post_* - http_client.cpp: SO_RCVTIMEO en Windows como DWORD ms (timeout 5 ms bug) - CMakeLists: limpieza de srcs duplicados con fn_framework - app.md: notas operativas y estado actual Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
136 lines
3.0 KiB
C++
136 lines
3.0 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
struct RegistryStats {
|
|
int total_functions = 0;
|
|
int total_types = 0;
|
|
int total_apps = 0;
|
|
int total_analysis = 0;
|
|
int total_unit_tests = 0;
|
|
int total_proposals = 0;
|
|
int tested_functions = 0;
|
|
int pure_functions = 0;
|
|
int impure_functions = 0;
|
|
};
|
|
|
|
struct LangCount {
|
|
std::string lang;
|
|
int count = 0;
|
|
};
|
|
|
|
struct DomainCount {
|
|
std::string domain;
|
|
int count = 0;
|
|
};
|
|
|
|
struct KindCount {
|
|
std::string kind;
|
|
int count = 0;
|
|
};
|
|
|
|
struct DateCount {
|
|
std::string date; // YYYY-MM-DD
|
|
int count = 0;
|
|
};
|
|
|
|
struct FunctionRow {
|
|
std::string id;
|
|
std::string name;
|
|
std::string lang;
|
|
std::string domain;
|
|
std::string kind;
|
|
std::string purity;
|
|
std::string description;
|
|
std::string created_at;
|
|
bool tested = false;
|
|
};
|
|
|
|
struct AppRow {
|
|
std::string id;
|
|
std::string name;
|
|
std::string lang;
|
|
std::string domain;
|
|
std::string description;
|
|
std::string framework;
|
|
std::string repo_url;
|
|
std::string dir_path;
|
|
};
|
|
|
|
struct AnalysisRow {
|
|
std::string id;
|
|
std::string name;
|
|
std::string lang;
|
|
std::string domain;
|
|
std::string description;
|
|
};
|
|
|
|
struct TypeRow {
|
|
std::string id;
|
|
std::string name;
|
|
std::string lang;
|
|
std::string domain;
|
|
std::string algebraic;
|
|
std::string description;
|
|
};
|
|
|
|
struct VaultRow {
|
|
std::string id;
|
|
std::string name;
|
|
std::string path;
|
|
std::string description;
|
|
bool symlink = false;
|
|
};
|
|
|
|
struct ProjectRow {
|
|
std::string id;
|
|
std::string name;
|
|
std::string description;
|
|
int apps_count = 0;
|
|
int analyses_count = 0;
|
|
int vaults_count = 0;
|
|
};
|
|
|
|
struct ProjectDetail {
|
|
std::string id; // "" si no hay seleccion; "orphans" para huerfanas
|
|
std::string name;
|
|
std::string description;
|
|
std::vector<AppRow> apps;
|
|
std::vector<AnalysisRow> analyses;
|
|
std::vector<VaultRow> vaults;
|
|
};
|
|
|
|
// All data loaded from registry.db in one shot
|
|
struct RegistryData {
|
|
RegistryStats stats;
|
|
std::vector<LangCount> by_lang;
|
|
std::vector<DomainCount> by_domain;
|
|
std::vector<KindCount> by_kind;
|
|
std::vector<DateCount> by_date; // last 30 days
|
|
std::vector<FunctionRow> recent_funcs; // last 20
|
|
std::vector<AppRow> apps;
|
|
std::vector<AnalysisRow> analyses;
|
|
std::vector<TypeRow> types;
|
|
std::vector<ProjectRow> projects;
|
|
int orphan_apps = 0;
|
|
int orphan_analyses = 0;
|
|
int orphan_vaults = 0;
|
|
|
|
// For chart data (populated by prepare_chart_data)
|
|
std::vector<std::string> lang_labels;
|
|
std::vector<float> lang_values;
|
|
std::vector<std::string> domain_labels;
|
|
std::vector<float> domain_values;
|
|
std::vector<std::string> kind_labels;
|
|
std::vector<float> kind_values;
|
|
std::vector<std::string> date_labels;
|
|
std::vector<float> date_values;
|
|
|
|
void prepare_chart_data();
|
|
};
|
|
|
|
// Load all data from registry.db. Returns true on success.
|
|
bool load_registry_data(const char* db_path, RegistryData& out);
|