feat: data layer HTTP — consume sqlite_api en vez de SQLite directo
Nuevo data_http.cpp que obtiene todos los datos del registry via HTTP POST a sqlite_api (/api/databases/registry/query). Mismas queries SQL que el data layer SQLite pero ejecutadas remotamente. cpp-httplib como cliente HTTP, nlohmann/json para parsear respuestas. CMakeLists.txt actualizado: incluye data_http.cpp, vendor/ en includes, linkea pthreads (Linux) y ws2_32 (Windows) para sockets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ endif()
|
||||
add_imgui_app(registry_dashboard
|
||||
main.cpp
|
||||
data.cpp
|
||||
data_http.cpp
|
||||
views.cpp
|
||||
${CMAKE_SOURCE_DIR}/functions/viz/kpi_card.cpp
|
||||
${CMAKE_SOURCE_DIR}/functions/viz/bar_chart.cpp
|
||||
@@ -31,6 +32,18 @@ add_imgui_app(registry_dashboard
|
||||
|
||||
target_include_directories(registry_dashboard PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vendor
|
||||
)
|
||||
|
||||
target_link_libraries(registry_dashboard PRIVATE SQLite::SQLite3)
|
||||
|
||||
# cpp-httplib needs threads on Linux
|
||||
if(UNIX)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(registry_dashboard PRIVATE Threads::Threads)
|
||||
endif()
|
||||
|
||||
# On Windows cross-compile, link ws2_32 for sockets
|
||||
if(WIN32)
|
||||
target_link_libraries(registry_dashboard PRIVATE ws2_32)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user