feat: wire sse_client_cpp_core for live updates from /api/boards/issues/stream
This commit is contained in:
+9
-2
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <imgui.h>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
namespace kanban_cpp {
|
||||
@@ -30,11 +31,17 @@ void draw_dashboard(AppState& s, bool* p_open) {
|
||||
ImGui::TextDisabled("KPIs sinteticos (TODO: backend /api/stats endpoint)");
|
||||
ImGui::Separator();
|
||||
|
||||
std::vector<Card> cards_snap;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(s.mu);
|
||||
cards_snap = s.cards;
|
||||
}
|
||||
|
||||
// Snapshot counts
|
||||
int total = static_cast<int>(s.cards.size());
|
||||
int total = static_cast<int>(cards_snap.size());
|
||||
std::map<std::string, int> by_priority;
|
||||
std::map<std::string, int> by_status;
|
||||
for (const auto& c : s.cards) {
|
||||
for (const auto& c : cards_snap) {
|
||||
if (!c.priority.empty()) by_priority[c.priority]++;
|
||||
if (!c.status.empty()) by_status[c.status]++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user