Fix styling

This commit is contained in:
Thijmen
2024-06-10 20:43:34 +00:00
committed by github-actions[bot]
parent 41fb6a1fc9
commit d86274cc37
429 changed files with 5307 additions and 2831 deletions

View File

@@ -9,20 +9,27 @@ use Livewire\Component;
class CreateScheduledBackup extends Component
{
public $database;
public $frequency;
public bool $enabled = true;
public bool $save_s3 = false;
public $s3_storage_id;
public Collection $s3s;
protected $rules = [
'frequency' => 'required|string',
'save_s3' => 'required|boolean',
];
protected $validationAttributes = [
'frequency' => 'Backup Frequency',
'save_s3' => 'Save to S3',
];
public function mount()
{
$this->s3s = currentTeam()->s3s;
@@ -36,8 +43,9 @@ class CreateScheduledBackup extends Component
try {
$this->validate();
$isValid = validate_cron_expression($this->frequency);
if (!$isValid) {
if (! $isValid) {
$this->dispatch('error', 'Invalid Cron / Human expression.');
return;
}
$payload = [
@@ -51,9 +59,9 @@ class CreateScheduledBackup extends Component
];
if ($this->database->type() === 'standalone-postgresql') {
$payload['databases_to_backup'] = $this->database->postgres_db;
} else if ($this->database->type() === 'standalone-mysql') {
} elseif ($this->database->type() === 'standalone-mysql') {
$payload['databases_to_backup'] = $this->database->mysql_database;
} else if ($this->database->type() === 'standalone-mariadb') {
} elseif ($this->database->type() === 'standalone-mariadb') {
$payload['databases_to_backup'] = $this->database->mariadb_database;
}