This commit is contained in:
ayntk-ai 2024-08-16 14:45:40 +02:00
parent ea4b085dbe
commit e3b9884247
No known key found for this signature in database
3 changed files with 30 additions and 6 deletions

View File

@ -7,8 +7,8 @@
class Executions extends Component
{
public $executions = [];
public $selectedKey;
public $task;
public function getListeners()
{
@ -26,4 +26,12 @@ public function selectTask($key): void
}
$this->selectedKey = $key;
}
}
public function getServerTimezone()
{
$server = data_get($this, 'destination.server');
$serverTimezone = $server->settings->server_timezone;
ray('Server Timezone:', $serverTimezone);
return $serverTimezone;
}
}

View File

@ -24,9 +24,25 @@
</div>
@endif
<div>Status: {{ data_get($execution, 'status') }}</div>
<div>Started At: {{ data_get($execution, 'created_at') }}</div>
<div>Started At:
@php
$createdAt = data_get($execution, 'created_at', now());
$serverTimezone = $this->getServerTimezone();
ray('Created At:', $createdAt, 'Server Timezone:', $serverTimezone);
$date = new DateTime($createdAt);
if ($serverTimezone) {
try {
$date->setTimezone(new DateTimeZone($serverTimezone));
} catch (\Exception $e) {
ray('Invalid timezone:', $serverTimezone);
}
}
echo $date->format('Y-m-d H:i:s T');
@endphp
</div>
</a>
@empty
<div>No executions found.</div>
@endforelse
</div>
</div>

View File

@ -42,6 +42,6 @@
<div class="pt-4">
<h3 class="py-4">Recent executions <span class="text-xs text-neutral-500">(click to check output)</span></h3>
<livewire:project.shared.scheduled-task.executions key="{{ $task->id }}" selectedKey="" :executions="$task->executions->take(-20)" />
<livewire:project.shared.scheduled-task.executions :task="$task" key="{{ $task->id }}" selectedKey="" :executions="$task->executions->take(-20)" />
</div>
</div>
</div>