From 054bebb0819d391e1d569a5cb7305be9e0fe3ad7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 11 Aug 2023 18:14:58 +0200 Subject: [PATCH] fix: backup now button --- app/Http/Livewire/Settings/Backup.php | 7 +++++++ .../views/livewire/settings/backup.blade.php | 16 ++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/Http/Livewire/Settings/Backup.php b/app/Http/Livewire/Settings/Backup.php index 99ca1d731..0b0dde7f2 100644 --- a/app/Http/Livewire/Settings/Backup.php +++ b/app/Http/Livewire/Settings/Backup.php @@ -7,6 +7,7 @@ use App\Models\ScheduledDatabaseBackup; use App\Models\Server; use App\Models\StandalonePostgresql; +use App\Jobs\DatabaseBackupJob; use Livewire\Component; class Backup extends Component @@ -67,6 +68,12 @@ public function add_coolify_database() $this->s3s = S3Storage::whereTeamId(0)->get(); } + public function backup_now() { + dispatch(new DatabaseBackupJob( + backup: $this->backup + )); + $this->emit('success', 'Backup queued. It will be available in a few minutes'); + } public function submit() { $this->emit('success', 'Backup updated successfully'); diff --git a/resources/views/livewire/settings/backup.blade.php b/resources/views/livewire/settings/backup.blade.php index aabe5daad..88febe521 100644 --- a/resources/views/livewire/settings/backup.blade.php +++ b/resources/views/livewire/settings/backup.blade.php @@ -2,7 +2,7 @@

Backup

- @if(isset($database)) + @if (isset($database)) Save @@ -11,19 +11,19 @@
Backup your Coolify instance settings
- @if(isset($database)) + @if (isset($database))
- - - + + +
- - + +
- + @else To configure automatic backup for your Coolify instance, you first need to add as a database resource into Coolify.