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

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:
AetherForge
2026-06-07 18:23:41 -07:00
parent e1b1a2aa65
commit 07fdb39b63
21 changed files with 533 additions and 53 deletions

View File

@@ -18,6 +18,7 @@ const (
OathSpreadDiscoveredHost = "spread_discovered_host"
OathStrainHospice = "strain_hospice"
OathReconScan = "recon_scan"
OathAgentRemoved = "agent_removed"
)
// Oath outcomes.

View File

@@ -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.