Add fleet registry removal with confirm modal and agent_removed WS.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Operators can remove machines from Crucible and dashboard rosters with honest messaging that deletion is registry-only; bulk select, oath ledger entries, and Go/Vitest coverage included.
This commit is contained in:
@@ -18,6 +18,7 @@ const (
|
||||
OathSpreadDiscoveredHost = "spread_discovered_host"
|
||||
OathStrainHospice = "strain_hospice"
|
||||
OathReconScan = "recon_scan"
|
||||
OathAgentRemoved = "agent_removed"
|
||||
)
|
||||
|
||||
// Oath outcomes.
|
||||
|
||||
@@ -389,9 +389,13 @@ func (d *Database) MarkStaleAgentsOffline(olderThan time.Duration) (int, error)
|
||||
return int(n), nil
|
||||
}
|
||||
|
||||
func (d *Database) DeleteAgent(id string) error {
|
||||
_, err := d.Exec("DELETE FROM agents WHERE id = ?", id)
|
||||
return err
|
||||
func (d *Database) DeleteAgent(id string) (bool, error) {
|
||||
res, err := d.Exec("DELETE FROM agents WHERE id = ?", id)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
n, _ := res.RowsAffected()
|
||||
return n > 0, nil
|
||||
}
|
||||
|
||||
// FindAgentByMAC returns the agent ID for an agent whose MAC address matches.
|
||||
|
||||
Reference in New Issue
Block a user