feat(storage): group backups by database and filter by s3 status

Group backup schedules by their parent database (type + ID) for better
organization in the UI. Filter to only display backups with save_s3
enabled. Restructure the template to show database name as a header with
nested backups underneath, allowing clearer visualization of which
backups belong to each database. Add key binding to livewire component
to ensure proper re-rendering when resources change.
This commit is contained in:
Andras Bacsai committed 2026-03-19 12:04:16 +01:00
1 parent ca3ae289eb
commit 86c8ec9c20
3 files changed
+76 -55

No files matched your search

+4 -2
View File
@@ -13,11 +13,13 @@ class Resources extends Component
public function render()
{
$backups = ScheduledDatabaseBackup::where('s3_storage_id', $this->storage->id)
->where('save_s3', true)
->with('database')
->get();
->get()
->groupBy(fn ($backup) => $backup->database_type.'-'.$backup->database_id);
return view('livewire.storage.resources', [
'backups' => $backups,
'groupedBackups' => $backups,
]);
}
}