add destinations

This commit is contained in:
Andras Bacsai
2023-05-02 12:47:52 +02:00
parent 77c86400c0
commit 1a9f360132
16 changed files with 144 additions and 11 deletions

View File

@@ -11,4 +11,10 @@
@empty
<p>No servers found.</p>
@endforelse
<h1>Destinations <a href="{{ route('destination.new') }}"><button>New</button></a></h1>
@forelse ($destinations as $destination)
<a href="{{ route('destination.show', [$destination->uuid]) }}">{{ data_get($destination, 'name') }}</a>
@empty
<p>No servers found.</p>
@endforelse
</x-layout>

View File

@@ -0,0 +1,4 @@
<x-layout>
<h1>New Destination</h1>
<livewire:destination.new.standalone-docker />
</x-layout>

View File

@@ -0,0 +1,11 @@
<x-layout>
<h1>Destination</h1>
<p>Name: {{ data_get($destination, 'name') }}</p>
<p>Server:{{ data_get($destination, 'server.ip') }}:{{ data_get($destination, 'server.port') }} </p>
@if ($destination->getMorphClass() === 'App\Models\StandaloneDocker')
<p>Network: {{ data_get($destination, 'network') }}</p>
@endif
@if ($destination->getMorphClass() === 'App\Models\SwarmDocker')
<p>Uuid: {{ data_get($destination, 'uuid') }}</p>
@endif
</x-layout>

View File

@@ -0,0 +1,15 @@
<div>
<form class="flex flex-col" wire:submit.prevent='submit'>
<x-form-input id="name" label="Name" required />
<x-form-input id="network" label="Network" required />
<x-form-input id="server_id" label="Server ID" required />
@foreach ($servers as $key)
<button @if ($server_id == $key->id) class="bg-green-500" @endif
wire:click.prevent="setServerId('{{ $key->id }}')">{{ $key->name }}</button>
@endforeach
<button class="mt-4" type="submit">
Submit
</button>
</form>
</div>

View File

@@ -1,4 +1,10 @@
<x-layout>
<h1>Server</h1>
<livewire:server.form :server_id="$server_id" />
<livewire:server.form :server_id="$server->id" />
<h2>Destinations</h2>
@if ($server->standaloneDockers)
@foreach ($server->standaloneDockers as $docker)
<p>Network: {{ data_get($docker, 'network') }}</p>
@endforeach
@endif
</x-layout>