feat: bump to v0.1.23 with security metrics and UI improvements
- Bump agent and server versions to 0.1.23 - Implement security metrics collection (bound agents, command processing, version compliance) - Add dismiss button for timed out commands in agent status - Add config sync endpoint for server->agent configuration updates - Add ignored updates workflow in AgentUpdatesEnhanced (approve/reject workflow) - Swap AgentScanners layout (subsystems top, security bottom) - Replace placeholder security data with database metrics - Add backpressure detection based on pending command ratios
This commit is contained in:
@@ -370,6 +370,38 @@ func (q *CommandQueries) CountPendingCommandsForAgent(agentID uuid.UUID) (int, e
|
||||
return count, err
|
||||
}
|
||||
|
||||
// GetTotalPendingCommands returns total pending commands across all agents
|
||||
func (q *CommandQueries) GetTotalPendingCommands() (int, error) {
|
||||
var count int
|
||||
query := `SELECT COUNT(*) FROM agent_commands WHERE status = 'pending'`
|
||||
err := q.db.Get(&count, query)
|
||||
return count, err
|
||||
}
|
||||
|
||||
// GetAgentsWithPendingCommands returns count of agents with pending commands
|
||||
func (q *CommandQueries) GetAgentsWithPendingCommands() (int, error) {
|
||||
var count int
|
||||
query := `
|
||||
SELECT COUNT(DISTINCT agent_id)
|
||||
FROM agent_commands
|
||||
WHERE status = 'pending'
|
||||
`
|
||||
err := q.db.Get(&count, query)
|
||||
return count, err
|
||||
}
|
||||
|
||||
// GetCommandsInTimeRange returns count of commands processed in a time range
|
||||
func (q *CommandQueries) GetCommandsInTimeRange(hours int) (int, error) {
|
||||
var count int
|
||||
query := `
|
||||
SELECT COUNT(*)
|
||||
FROM agent_commands
|
||||
WHERE created_at >= $1 AND status IN ('completed', 'failed', 'timed_out')
|
||||
`
|
||||
err := q.db.Get(&count, query, time.Now().Add(-time.Duration(hours)*time.Hour))
|
||||
return count, err
|
||||
}
|
||||
|
||||
// VerifyCommandsCompleted checks which command IDs from the provided list have been completed or failed
|
||||
// Returns the list of command IDs that have been successfully recorded (completed or failed status)
|
||||
func (q *CommandQueries) VerifyCommandsCompleted(commandIDs []string) ([]string, error) {
|
||||
|
||||
Reference in New Issue
Block a user