api: expose host.repo_status in /api/hosts JSON

The dashboard renders init_running / init_failed / ready state
based on host.repo_status, but the JSON endpoint dropped the
field on its way out. The e2e test couldn't poll for repo
readiness; reflect the same projection the UI uses.
This commit is contained in:
2026-05-08 22:06:22 +01:00
parent 5925d09e8b
commit b9439da467
+2
View File
@@ -25,6 +25,7 @@ type hostView struct {
CurrentJobID *string `json:"current_job_id,omitempty"` CurrentJobID *string `json:"current_job_id,omitempty"`
LastBackupAt *string `json:"last_backup_at,omitempty"` LastBackupAt *string `json:"last_backup_at,omitempty"`
LastBackupStatus *string `json:"last_backup_status,omitempty"` LastBackupStatus *string `json:"last_backup_status,omitempty"`
RepoStatus string `json:"repo_status,omitempty"`
RepoSizeBytes int64 `json:"repo_size_bytes"` RepoSizeBytes int64 `json:"repo_size_bytes"`
SnapshotCount int `json:"snapshot_count"` SnapshotCount int `json:"snapshot_count"`
OpenAlertCount int `json:"open_alert_count"` OpenAlertCount int `json:"open_alert_count"`
@@ -85,6 +86,7 @@ func hostToView(h store.Host) hostView {
Tags: h.Tags, Tags: h.Tags,
CurrentJobID: h.CurrentJobID, CurrentJobID: h.CurrentJobID,
LastBackupStatus: h.LastBackupStatus, LastBackupStatus: h.LastBackupStatus,
RepoStatus: h.RepoStatus,
RepoSizeBytes: h.RepoSizeBytes, RepoSizeBytes: h.RepoSizeBytes,
SnapshotCount: h.SnapshotCount, SnapshotCount: h.SnapshotCount,
OpenAlertCount: h.OpenAlertCount, OpenAlertCount: h.OpenAlertCount,