currentTeam()->id; return [ "echo-private:team.{$teamId},ScheduledTaskDone" => 'refreshExecutions', ]; } public function mount($taskId) { try { $this->taskId = $taskId; $this->task = ScheduledTask::findOrFail($taskId); $this->executions = $this->task->executions()->take(20)->get(); $this->serverTimezone = data_get($this->task, 'application.destination.server.settings.server_timezone'); if (! $this->serverTimezone) { $this->serverTimezone = data_get($this->task, 'service.destination.server.settings.server_timezone'); } if (! $this->serverTimezone) { $this->serverTimezone = 'UTC'; } } catch (\Exception $e) { return handleError($e); } } public function refreshExecutions(): void { $this->executions = $this->task->executions()->take(20)->get(); } public function selectTask($key): void { if ($key == $this->selectedKey) { $this->selectedKey = null; return; } $this->selectedKey = $key; } public function formatDateInServerTimezone($date) { $serverTimezone = $this->serverTimezone; $dateObj = new \DateTime($date); try { $dateObj->setTimezone(new \DateTimeZone($serverTimezone)); } catch (\Exception) { $dateObj->setTimezone(new \DateTimeZone('UTC')); } return $dateObj->format('Y-m-d H:i:s T'); } }