feat(dashboard): enhance project and server sections with modal input for resource creation
- Updated the dashboard view to include modal input components for adding new projects and servers. - Added conditional rendering to display the modal button only when there are existing projects or servers. - Improved layout by wrapping section headers and buttons in a flex container for better alignment and spacing.
This commit is contained in:
parent
201e30e849
commit
b19e8d6a33
1 changed files with 34 additions and 2 deletions
|
|
@ -15,7 +15,23 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<section class="-mt-2">
|
<section class="-mt-2">
|
||||||
<h3 class="pb-2">Projects</h3>
|
<div class="flex items-center gap-2 pb-2">
|
||||||
|
<h3>Projects</h3>
|
||||||
|
@if ($projects->count() > 0)
|
||||||
|
<x-modal-input buttonTitle="Add" title="New Project">
|
||||||
|
<x-slot:content>
|
||||||
|
<button
|
||||||
|
class="flex items-center justify-center size-4 text-white rounded hover:bg-coolgray-400 dark:hover:bg-coolgray-300">
|
||||||
|
<svg class="size-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||||
|
stroke-width="2" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</x-slot:content>
|
||||||
|
<livewire:project.add-empty />
|
||||||
|
</x-modal-input>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
@if ($projects->count() > 0)
|
@if ($projects->count() > 0)
|
||||||
<div class="grid grid-cols-1 gap-4 xl:grid-cols-2">
|
<div class="grid grid-cols-1 gap-4 xl:grid-cols-2">
|
||||||
@foreach ($projects as $project)
|
@foreach ($projects as $project)
|
||||||
|
|
@ -65,7 +81,23 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h3 class="pb-2">Servers</h3>
|
<div class="flex items-center gap-2 pb-2">
|
||||||
|
<h3>Servers</h3>
|
||||||
|
@if ($servers->count() > 0 && $privateKeys->count() > 0)
|
||||||
|
<x-modal-input buttonTitle="Add" title="New Server" :closeOutside="false">
|
||||||
|
<x-slot:content>
|
||||||
|
<button
|
||||||
|
class="flex items-center justify-center size-4 text-white rounded hover:bg-coolgray-400 dark:hover:bg-coolgray-300">
|
||||||
|
<svg class="size-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||||
|
stroke-width="2" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</x-slot:content>
|
||||||
|
<livewire:server.create />
|
||||||
|
</x-modal-input>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
@if ($servers->count() > 0)
|
@if ($servers->count() > 0)
|
||||||
<div class="grid grid-cols-1 gap-4 xl:grid-cols-2">
|
<div class="grid grid-cols-1 gap-4 xl:grid-cols-2">
|
||||||
@foreach ($servers as $server)
|
@foreach ($servers as $server)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue