Skip to content

Commit fa28e95

Browse files
committed
refactor: Update cron expressions and add helper text for scheduled tasks
1 parent c2e431d commit fa28e95

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

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

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/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>

0 commit comments

Comments
 (0)