Skip to content

Commit f089185

Browse files
authored
Merge pull request coollabsio#3027 from coollabsio/next
v4.0.0-beta.321
2 parents 671b22e + fa28e95 commit f089185

File tree

9 files changed

+31
-21
lines changed

9 files changed

+31
-21
lines changed

app/Livewire/SettingsBackup.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SettingsBackup extends Component
1616

1717
public $s3s;
1818

19-
public StandalonePostgresql|null|array $database = [];
19+
public ?StandalonePostgresql $database = null;
2020

2121
public ScheduledDatabaseBackup|null|array $backup = [];
2222

@@ -43,19 +43,19 @@ public function mount()
4343
{
4444
if (isInstanceAdmin()) {
4545
$settings = InstanceSettings::get();
46-
$database = StandalonePostgresql::whereName('coolify-db')->first();
46+
$this->database = StandalonePostgresql::whereName('coolify-db')->first();
4747
$s3s = S3Storage::whereTeamId(0)->get() ?? [];
48-
if ($database) {
49-
if ($database->status !== 'running') {
50-
$database->status = 'running';
51-
$database->save();
48+
if ($this->database) {
49+
if ($this->database->status !== 'running') {
50+
$this->database->status = 'running';
51+
$this->database->save();
5252
}
53-
$this->database = $database;
53+
$this->backup = $this->database->scheduledBackups->first();
54+
$this->executions = $this->backup->executions;
5455
}
5556
$this->settings = $settings;
5657
$this->s3s = $s3s;
57-
$this->backup = $this->database?->scheduledBackups?->first() ?? null;
58-
$this->executions = $this->backup?->executions ?? [];
58+
5959
} else {
6060
return redirect()->route('dashboard');
6161
}

bootstrap/helpers/constants.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
'weekly' => '0 0 * * 0',
1010
'monthly' => '0 0 1 * *',
1111
'yearly' => '0 0 1 1 *',
12+
'@hourly' => '0 * * * *',
13+
'@daily' => '0 0 * * *',
14+
'@weekly' => '0 0 * * 0',
15+
'@monthly' => '0 0 1 * *',
16+
'@yearly' => '0 0 1 1 *',
1217
];
1318
const RESTART_MODE = 'unless-stopped';
1419

config/sentry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// The release version of your application
99
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
10-
'release' => '4.0.0-beta.320',
10+
'release' => '4.0.0-beta.321',
1111
// When left empty or `null` the Laravel environment will be used
1212
'environment' => config('app.env'),
1313

config/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
return '4.0.0-beta.320';
3+
return '4.0.0-beta.321';

resources/views/livewire/project/database/create-scheduled-backup.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<form class="flex flex-col w-full gap-2 rounded" wire:submit='submit'>
2-
<x-forms.input autofocus placeholder="0 0 * * * or daily" id="frequency" label="Frequency" required />
2+
<x-forms.input autofocus placeholder="0 0 * * * or daily" id="frequency"
3+
helper="You can use every_minute, hourly, daily, weekly, monthly, yearly or a cron expression." label="Frequency"
4+
required />
35
<x-forms.checkbox id="save_s3" label="Save to S3" />
46
<x-forms.select id="selected_storage_id">
57
@if ($s3s->count() === 0)

resources/views/livewire/project/shared/scheduled-task/add.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<form class="flex flex-col w-full gap-2 rounded" wire:submit='submit'>
22
<x-forms.input autofocus placeholder="Run cron" id="name" label="Name" />
33
<x-forms.input placeholder="php artisan schedule:run" id="command" label="Command" />
4-
<x-forms.input placeholder="0 0 * * * or daily" id="frequency" label="Frequency" />
4+
<x-forms.input placeholder="0 0 * * * or daily"
5+
helper="You can use every_minute, hourly, daily, weekly, monthly, yearly or a cron expression." id="frequency"
6+
label="Frequency" />
57
@if ($type === 'application')
68
@if ($containerNames->count() > 1)
79
<x-forms.select id="container" label="Container name">

resources/views/livewire/settings-backup.blade.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</div>
1515
<div class="pb-4">Backup configuration for Coolify instance.</div>
1616
<div>
17-
@if (isset($database))
17+
@if (isset($database) && isset($backup))
1818
<div class="flex flex-col gap-3 pb-4">
1919
<div class="flex gap-2">
2020
<x-forms.input label="UUID" readonly id="database.uuid" />
@@ -27,14 +27,15 @@
2727
</div>
2828
</div>
2929
<livewire:project.database.backup-edit :backup="$backup" :s3s="$s3s" :status="data_get($database, 'status')" />
30+
<div class="py-4">
31+
<livewire:project.database.backup-executions :backup="$backup" />
32+
</div>
3033
@else
3134
To configure automatic backup for your Coolify instance, you first need to add a database resource
3235
into Coolify.
3336
<x-forms.button class="mt-2" wire:click="add_coolify_database">Add Database</x-forms.button>
3437
@endif
3538
</div>
36-
<div class="py-4">
37-
<livewire:project.database.backup-executions :backup="$backup" />
38-
</div>
39+
3940
</div>
4041
</div>

resources/views/livewire/settings/index.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@
6060
<div class="flex items-end gap-2">
6161
<x-forms.input required id="update_check_frequency" label="Update Check Frequency"
6262
placeholder="0 * * * *"
63-
helper="Cron expression for update check frequency (check for new Coolify versions and pull new Service Templates from CDN). Default is every hour." />
63+
helper="Cron expression for update check frequency (check for new Coolify versions and pull new Service Templates from CDN).<br>You can use every_minute, hourly, daily, weekly, monthly, yearly.<br><br>Default is every hour." />
6464
<x-forms.button wire:click='checkManually'>Check Manually</x-forms.button>
6565
</div>
6666

6767
@if (is_null(env('AUTOUPDATE', null)) && $is_auto_update_enabled)
6868
<x-forms.input required id="auto_update_frequency" label="Auto Update Frequency" placeholder="0 0 * * *"
69-
helper="Cron expression for auto update frequency (automatically update coolify). Default is every day at 00:00" />
69+
helper="Cron expression for auto update frequency (automatically update coolify).<br>You can use every_minute, hourly, daily, weekly, monthly, yearly.<br><br>Default is every day at 00:00" />
7070
@endif
7171
</div>
7272
</form>

versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"coolify": {
33
"v4": {
4-
"version": "4.0.0-beta.320"
4+
"version": "4.0.0-beta.321"
55
}
66
}
7-
}
7+
}

0 commit comments

Comments
 (0)