diff --git a/app/Jobs/ScheduledTaskJob.php b/app/Jobs/ScheduledTaskJob.php index 3daaa9e83..93d5fca70 100644 --- a/app/Jobs/ScheduledTaskJob.php +++ b/app/Jobs/ScheduledTaskJob.php @@ -55,10 +55,13 @@ class ScheduledTaskJob implements ShouldQueue private function getServerTimezone(): string { if ($this->resource instanceof Application) { - return $this->resource->destination->server->settings->server_timezone; + $timezone = $this->resource->destination->server->settings->server_timezone; + return $timezone; } elseif ($this->resource instanceof Service) { - return $this->resource->server->settings->server_timezone; + $timezone = $this->resource->server->settings->server_timezone; + return $timezone; } + return 'UTC'; } public function middleware(): array @@ -91,12 +94,12 @@ class ScheduledTaskJob implements ShouldQueue } elseif ($this->resource->type() == 'service') { $this->resource->applications()->get()->each(function ($application) { if (str(data_get($application, 'status'))->contains('running')) { - $this->containers[] = data_get($application, 'name').'-'.data_get($this->resource, 'uuid'); + $this->containers[] = data_get($application, 'name') . '-' . data_get($this->resource, 'uuid'); } }); $this->resource->databases()->get()->each(function ($database) { if (str(data_get($database, 'status'))->contains('running')) { - $this->containers[] = data_get($database, 'name').'-'.data_get($this->resource, 'uuid'); + $this->containers[] = data_get($database, 'name') . '-' . data_get($this->resource, 'uuid'); } }); } @@ -109,8 +112,8 @@ class ScheduledTaskJob implements ShouldQueue } foreach ($this->containers as $containerName) { - if (count($this->containers) == 1 || str_starts_with($containerName, $this->task->container.'-'.$this->resource->uuid)) { - $cmd = "sh -c '".str_replace("'", "'\''", $this->task->command)."'"; + if (count($this->containers) == 1 || str_starts_with($containerName, $this->task->container . '-' . $this->resource->uuid)) { + $cmd = "sh -c '" . str_replace("'", "'\''", $this->task->command) . "'"; $exec = "docker exec {$containerName} {$cmd}"; $this->task_output = instant_remote_process([$exec], $this->server, true); $this->task_log->update([ @@ -135,7 +138,6 @@ class ScheduledTaskJob implements ShouldQueue // send_internal_notification('ScheduledTaskJob failed with: ' . $e->getMessage()); throw $e; } finally { - } } -} \ No newline at end of file +} diff --git a/app/Models/ScheduledTask.php b/app/Models/ScheduledTask.php index c01e5e057..81ca6dba5 100644 --- a/app/Models/ScheduledTask.php +++ b/app/Models/ScheduledTask.php @@ -38,7 +38,8 @@ class ScheduledTask extends BaseModel $server = $this->application->server; ray('Returning server from application: '.$server); return $server; - } elseif ($this->database) { + } + elseif ($this->database) { ray('Returning server from database'); $server = $this->database->server; ray('Returning server from database: '.$server); diff --git a/resources/views/livewire/project/database/backup-executions.blade.php b/resources/views/livewire/project/database/backup-executions.blade.php index 483fecc34..c3fc01fb4 100644 --- a/resources/views/livewire/project/database/backup-executions.blade.php +++ b/resources/views/livewire/project/database/backup-executions.blade.php @@ -1,57 +1,56 @@
@isset($backup) -
-

Executions

- Cleanup Failed Backups -
-
- @forelse($executions as $execution) -
data_get($execution, 'status') === 'success', - 'border-red-500' => data_get($execution, 'status') === 'failed', - ])> - @if (data_get($execution, 'status') === 'running') -
- -
- @endif -
Database: {{ data_get($execution, 'database_name', 'N/A') }}
-
Status: {{ data_get($execution, 'status') }}
-
Started At: {{ $this->formatDateInServerTimezone(data_get($execution, 'created_at')) }}
- @if (data_get($execution, 'message')) -
Message: {{ data_get($execution, 'message') }}
- @endif -
Size: {{ data_get($execution, 'size') }} B / - {{ round((int) data_get($execution, 'size') / 1024, 2) }} - kB / {{ round((int) data_get($execution, 'size') / 1024 / 1024, 3) }} MB -
-
Location: {{ data_get($execution, 'filename', 'N/A') }}
-
-
- @if (data_get($execution, 'status') === 'success') - Download - @endif - - - Delete - - This will delete this backup. It is not reversible.
Please think again. -
-
-
+
+

Executions

+ Cleanup Failed Backups +
+
+ @forelse($executions as $execution) +
data_get($execution, 'status') === 'success', + 'border-red-500' => data_get($execution, 'status') === 'failed', + ])> + @if (data_get($execution, 'status') === 'running') +
+ +
+ @endif +
Database: {{ data_get($execution, 'database_name', 'N/A') }}
+
Status: {{ data_get($execution, 'status') }}
+
Started At: {{ $this->formatDateInServerTimezone(data_get($execution, 'created_at')) }}
+ @if (data_get($execution, 'message')) +
Message: {{ data_get($execution, 'message') }}
+ @endif +
Size: {{ data_get($execution, 'size') }} B / + {{ round((int) data_get($execution, 'size') / 1024, 2) }} + kB / {{ round((int) data_get($execution, 'size') / 1024 / 1024, 3) }} MB +
+
Location: {{ data_get($execution, 'filename', 'N/A') }}
+
+
+ @if (data_get($execution, 'status') === 'success') + Download + @endif + + + Delete + + This will delete this backup. It is not reversible.
Please think again. +
+
+
- @empty -
No executions found.
- @endforelse -
- + @empty +
No executions found.
+ @endforelse +
+ @endisset -
\ No newline at end of file + diff --git a/resources/views/livewire/project/shared/scheduled-task/show.blade.php b/resources/views/livewire/project/shared/scheduled-task/show.blade.php index d448000ca..125a431a4 100644 --- a/resources/views/livewire/project/shared/scheduled-task/show.blade.php +++ b/resources/views/livewire/project/shared/scheduled-task/show.blade.php @@ -1,47 +1,47 @@
{{ data_get_str($resource, 'name')->limit(10) }} > Scheduled Tasks | Coolify - - @if ($type === 'application') + + @if ($type === 'application')

Scheduled Task

- @elseif ($type === 'service') + @elseif ($type === 'service') - @endif + @endif -
-
-
-

Scheduled Task

- - Save - - - You will delete scheduled task {{ $task->name }}. - + +
+
+

Scheduled Task

+ + Save + + + You will delete scheduled task {{ $task->name }}. + +
+
+ +
-
- -
-
-
- - - - @if ($type === 'application') +
+ + + + @if ($type === 'application') - @elseif ($type === 'service') + @elseif ($type === 'service') - @endif -
- + @endif +
+ -
-

Recent executions (click to check output)

- -
-
\ No newline at end of file +
+

Recent executions (click to check output)

+ +
+