feat(dashboard): métriques chargées immédiatement au rechargement de page
GET /api/agents inclut désormais last_metrics (dernière ligne de la table metrics) pour chaque agent. grid.js l'utilise lors du refresh initial, ce qui peuple les tuiles sans attendre le prochain message WebSocket. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
f69c22039b
commit
d8f395cb53
@@ -15,6 +15,9 @@ func AgentsHandler(database *db.DB) http.HandlerFunc {
|
||||
http.Error(w, err.Error(), 500)
|
||||
return
|
||||
}
|
||||
for i := range agents {
|
||||
agents[i].LastMetrics, _ = database.GetLastMetrics(agents[i].ID)
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(agents)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user