feat: big ahh commit

- agent+proto+backend: transfer service status
- agent: fix returning empty message on nonzero exit status
- backend: refactor collector+commander and handlers dependent on them: implement agent accounting via grpc stats handler
This commit is contained in:
2026-04-04 22:55:39 +03:00
parent b516a54c17
commit 7be99f8e91
12 changed files with 541 additions and 190 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
package handlers
import (
"fmt"
"net/http"
"gitea.d3m0k1d.ru/d3m0k1d/HellreigN/backend/internal/grpcsrv/collector"
@@ -36,10 +37,14 @@ func (ag *AgentsGroup) List(c *gin.Context) {
agents := make([]AgentInfo, 0)
for _, agent := range ag.collector.Agents() {
services := make([]string, 0, len(agent.Services))
for _, s := range agent.Services {
services = append(services, fmt.Sprintf("%s:%s", s.Name, s.Status))
}
agents = append(agents, AgentInfo{
Token: agent.ID,
Label: agent.Label,
Services: agent.Services,
Services: services,
ConnectedAt: agent.ConnectedAt.Format("2006-01-02 15:04:05"),
})
}