add destinations
This commit is contained in:
@@ -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>
|
||||
|
||||
4
resources/views/destination/new.blade.php
Normal file
4
resources/views/destination/new.blade.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<x-layout>
|
||||
<h1>New Destination</h1>
|
||||
<livewire:destination.new.standalone-docker />
|
||||
</x-layout>
|
||||
11
resources/views/destination/show.blade.php
Normal file
11
resources/views/destination/show.blade.php
Normal 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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user