authorize('view', [$this->server, auth()->user()->currentProject]); $this->previousStatus = $this->server->status; } #[On('$refresh')] public function refresh(): void { $currentStatus = $this->server->refresh()->status; if ($this->previousStatus !== $currentStatus) { $this->redirect(static::getUrl(parameters: ['server' => $this->server])); } $this->previousStatus = $currentStatus; } public function getWidgets(): array { $widgets = []; if ($this->server->isInstalling()) { $widgets[] = [Installing::class, ['server' => $this->server]]; } else { $widgets[] = [ServerStats::class, ['server' => $this->server]]; } if (auth()->user()->can('viewAny', [ServerLog::class, $this->server])) { $widgets[] = [ LogsList::class, [ 'server' => $this->server, 'label' => 'Logs', ], ]; } return $widgets; } }