redirect to server show page if a gateway is not installed on a given server

This commit is contained in:
2025-04-24 19:08:21 +01:00
parent 6296c2d999
commit 46a76f7bce
7 changed files with 62 additions and 14 deletions

View File

@@ -16,7 +16,13 @@ class EnvironmentController extends Controller
return inertia('environments/Show', [
'environment' => $environment,
'servers' => inertia()->optional(function () use ($environment) {
return $environment->application?->organisation?->servers->where('status', ServerStatus::ACTIVE)?->values() ?? [];
return $environment
->application
?->organisation
?->servers()
->where('status', ServerStatus::ACTIVE)
->with('services')
->get() ?? [];
}),
]);
}