(ui) Separate healthy and problematic dashboard runs
Split dashboard host cards into last successful backup and latest warning or failed run so operators can quickly see whether a host is protected even when recent activity produced an issue. Also add queued and warning run counts to the dashboard summary metrics.
This commit is contained in:
@@ -42,6 +42,19 @@ class ViewTests(TestCase):
|
||||
snapshot=snapshot,
|
||||
started_at=datetime(2026, 5, 19, 2, 15, tzinfo=timezone.utc),
|
||||
)
|
||||
warning_run = BackupRun.objects.create(
|
||||
host=host,
|
||||
run_type=BackupRun.RunType.SCHEDULED,
|
||||
status=BackupRun.Status.WARNING,
|
||||
started_at=datetime(2026, 5, 19, 3, 15, tzinfo=timezone.utc),
|
||||
result={
|
||||
"ok": True,
|
||||
"prune": {
|
||||
"ok": False,
|
||||
"error": "Retention warning",
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
response = self.client.get(reverse("dashboard"))
|
||||
|
||||
@@ -50,8 +63,13 @@ class ViewTests(TestCase):
|
||||
self.assertContains(response, "web-01")
|
||||
self.assertContains(response, "20260519-021500Z__ABCDEFGH")
|
||||
self.assertContains(response, "success")
|
||||
self.assertContains(response, "Last Good Backup")
|
||||
self.assertContains(response, "Latest Issue")
|
||||
self.assertContains(response, f"Run {run.id}")
|
||||
self.assertContains(response, f"Run {warning_run.id}")
|
||||
self.assertContains(response, "warning")
|
||||
self.assertContains(response, "manual")
|
||||
self.assertContains(response, "scheduled")
|
||||
|
||||
def test_dashboard_renders_backup_trend_summary(self) -> None:
|
||||
self.client.force_login(self.staff_user)
|
||||
@@ -92,6 +110,8 @@ class ViewTests(TestCase):
|
||||
self.assertContains(response, "Runs Until Full")
|
||||
self.assertContains(response, "Avg Daily New")
|
||||
self.assertContains(response, "Days Until Full")
|
||||
self.assertContains(response, "Warnings")
|
||||
self.assertContains(response, "Queued")
|
||||
self.assertContains(response, "Next Run")
|
||||
self.assertContains(response, "UTC")
|
||||
self.assertContains(response, "10")
|
||||
|
||||
Reference in New Issue
Block a user