fix: backup now button

This commit is contained in:
Andras Bacsai 2023-08-11 18:14:58 +02:00
parent 8a93f1fc0c
commit 054bebb081
2 changed files with 15 additions and 8 deletions

View File

@ -7,6 +7,7 @@ use App\Models\S3Storage;
use App\Models\ScheduledDatabaseBackup; use App\Models\ScheduledDatabaseBackup;
use App\Models\Server; use App\Models\Server;
use App\Models\StandalonePostgresql; use App\Models\StandalonePostgresql;
use App\Jobs\DatabaseBackupJob;
use Livewire\Component; use Livewire\Component;
class Backup extends Component class Backup extends Component
@ -67,6 +68,12 @@ class Backup extends Component
$this->s3s = S3Storage::whereTeamId(0)->get(); $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() public function submit()
{ {
$this->emit('success', 'Backup updated successfully'); $this->emit('success', 'Backup updated successfully');