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\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');

View File

@ -2,7 +2,7 @@
<div class="flex flex-col">
<div class="flex items-center gap-2">
<h2>Backup</h2>
@if(isset($database))
@if (isset($database))
<x-forms.button type="submit" wire:click="submit">
Save
</x-forms.button>
@ -11,19 +11,19 @@
</div>
<div class="pb-4">Backup your Coolify instance settings</div>
<div>
@if(isset($database))
@if (isset($database))
<div class="flex flex-col gap-3 pb-4">
<div class="flex gap-2">
<x-forms.input label="UUID" readonly id="database.uuid"/>
<x-forms.input label="Name" readonly id="database.name"/>
<x-forms.input label="Description" id="database.description"/>
<x-forms.input label="UUID" readonly id="database.uuid" />
<x-forms.input label="Name" readonly id="database.name" />
<x-forms.input label="Description" id="database.description" />
</div>
<div class="flex gap-2">
<x-forms.input label="User" readonly id="database.postgres_user"/>
<x-forms.input type="password" label="Password" readonly id="database.postgres_password"/>
<x-forms.input label="User" readonly id="database.postgres_user" />
<x-forms.input type="password" label="Password" readonly id="database.postgres_password" />
</div>
</div>
<livewire:project.database.backup-edit :backup="$backup" :s3s="$s3s"/>
<livewire:project.database.backup-edit :backup="$backup" :s3s="$s3s" />
@else
To configure automatic backup for your Coolify instance, you first need to add as a database resource
into Coolify.