Refactor dashboard view to remove unnecessary code and improve readability

This commit is contained in:
Andras Bacsai
2024-03-18 14:35:46 +01:00
parent 8e2ee5e5e4
commit ef2be40478

View File

@@ -15,11 +15,6 @@
subscription is activated.<br> Please be patient.</span>
</div>
@endif
@if ($servers->count() === 0)
No resources found. Add your first server & private key <a class="text-white underline"
href="{{ route('server.create') }}">here</a> or go to the <a class="text-white underline"
href="{{ route('onboarding') }}">onboarding page</a>.
@endif
<h3 class="pb-4">Projects</h3>
<div class="grid grid-cols-1 gap-2 xl:grid-cols-2">
@forelse ($projects as $project)
@@ -59,19 +54,16 @@
</div>
@empty
<div>
No project found.
<x-forms.button class="btn" onclick="newEmptyProject.showModal()">+ Add</x-forms.button>
No projects found. Add your first server <a class="text-white underline"
onclick="newEmptyProject.showModal()">here</a> or
go to the <a class="text-white underline" href="{{ route('onboarding') }}">onboarding page.</a>
<livewire:project.add-empty />
</div>
@endforelse
</div>
<h3 class="py-4">Servers</h3>
@if ($servers->count() === 1)
<div class="grid grid-cols-1 gap-2">
@else
<div class="grid grid-cols-1 gap-2 xl:grid-cols-2">
@endif
@foreach ($servers as $server)
@forelse ($servers as $server)
<a href="{{ route('server.show', ['server_uuid' => data_get($server, 'uuid')]) }}"
@class([
'gap-2 border cursor-pointer box group',
@@ -98,8 +90,14 @@
</div>
<div class="flex-1"></div>
</a>
@endforeach
@empty
<div>
No servers found.
Add your first server <a class="text-white underline" href="{{ route('server.create') }}">here</a> or
go to the <a class="text-white underline" href="{{ route('onboarding') }}">onboarding page.</a>
</div>
@endforelse
</div>
<div class="flex items-center gap-2">
<h3 class="py-4">Deployments</h3>
@if (count($deployments_per_server) > 0)