Refactor Docker-related code and add conditional rendering

This commit is contained in:
Andras Bacsai
2024-03-25 13:10:05 +01:00
parent 3de4f2805a
commit bcbdee1dcc
4 changed files with 21 additions and 13 deletions

View File

@@ -1,11 +1,13 @@
<x-layout>
<div class="flex items-start gap-2">
<h1>Destinations</h1>
<x-modal-input buttonTitle="+ Add" title="New Destination">
<livewire:destination.new.docker :server_id="$server_id" />
</x-modal-input>
@if ($servers->count() > 0)
<x-modal-input buttonTitle="+ Add" title="New Destination">
<livewire:destination.new.docker :server_id="$server_id" />
</x-modal-input>
@endif
</div>
<div class="subtitle">Endpoints to deploy your resources.</div>
<div class="subtitle">Network endpoints to deploy your resources.</div>
<div class="grid gap-2 lg:grid-cols-2">
@forelse ($destinations as $destination)
@if ($destination->getMorphClass() === 'App\Models\StandaloneDocker')
@@ -27,7 +29,11 @@
@endif
@empty
<div>
<div>No destinations found.</div>
@if ($servers->count() === 0)
<div> No servers found. Please add one first.</div>
@else
<div>No destinations found.</div>
@endif
</div>
@endforelse
</div>