diff --git a/app/Http/Controllers/EnvironmentController.php b/app/Http/Controllers/EnvironmentController.php index ce5d614..070ed4b 100644 --- a/app/Http/Controllers/EnvironmentController.php +++ b/app/Http/Controllers/EnvironmentController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Enums\ServerStatus; use App\Models\Environment; use Illuminate\Http\Request; @@ -10,9 +11,13 @@ class EnvironmentController extends Controller public function show(Request $request) { $id = $request->route('environment'); + $environment = Environment::with('application')->findOrFail($id); return inertia('environments/Show', [ - 'environment' => Environment::with('application')->findOrFail($id), + 'environment' => $environment, + 'servers' => inertia()->optional(function () use ($environment) { + return $environment->application?->organisation?->servers->where('status', ServerStatus::ACTIVE)?->values() ?? []; + }), ]); } } diff --git a/resources/js/components/ServerSelector.vue b/resources/js/components/ServerSelector.vue new file mode 100644 index 0000000..949bdfc --- /dev/null +++ b/resources/js/components/ServerSelector.vue @@ -0,0 +1,63 @@ + + + + diff --git a/resources/js/pages/environments/Show.vue b/resources/js/pages/environments/Show.vue index c2195e5..a03bf90 100644 --- a/resources/js/pages/environments/Show.vue +++ b/resources/js/pages/environments/Show.vue @@ -1,18 +1,19 @@ @@ -48,16 +49,20 @@ const props = defineProps({