fix: add new destination

This commit is contained in:
Andras Bacsai 2023-12-11 13:02:29 +01:00
parent af6d94c0d8
commit dbc55233cb
3 changed files with 12 additions and 6 deletions

View File

@ -109,9 +109,6 @@ class Select extends Component
if (count($this->servers) === 1) {
$server = $this->servers->first();
$this->setServer($server);
if (count($server->destinations()) === 1) {
$this->setDestination($server->destinations()->first()->uuid);
}
}
if (!is_null($this->server)) {
$foundServer = $this->servers->where('id', $this->server)->first();

View File

@ -2,7 +2,7 @@
@if ($server->isFunctional())
<div class="flex items-end gap-2">
<h2>Destinations</h2>
<a href="{{ route('destination.new', ['server_id' => $server->id]) }}">
<a wire:navigate href="{{ route('destination.new', ['server_id' => $server->id]) }}">
<x-forms.button>Add a new destination</x-forms.button>
</a>
<x-forms.button wire:click='scan'>Scan destinations on the server</x-forms.button>
@ -11,7 +11,7 @@
<div class="flex gap-2 ">
Available for using:
@forelse ($server->standaloneDockers as $docker)
<a href="{{ route('destination.show', ['destination_uuid' => data_get($docker, 'uuid')]) }}">
<a wire:navigate href="{{ route('destination.show', ['destination_uuid' => data_get($docker, 'uuid')]) }}">
<button class="text-white btn-link">{{ data_get($docker, 'network') }} </button>
</a>
@empty
@ -25,7 +25,7 @@
<div class="flex flex-wrap gap-2 ">
@foreach ($networks as $network)
<div>
<a
<a wire:navigate
href="{{ route('destination.new', ['server_id' => $server->id, 'network_name' => data_get($network, 'Name')]) }}">
<x-forms.button>+<x-highlighted text="{{ data_get($network, 'Name') }}" />
</x-forms.button>

View File

@ -230,7 +230,16 @@
<li class="step step-secondary">Select a Server</li>
<li class="step step-secondary">Select a Destination</li>
</ul>
<a wire:navigate href="{{ route('destination.new', ['server_id' => $server_id]) }}"
class="items-center justify-center pb-10 text-center box-without-bg group bg-coollabs hover:bg-coollabs-100">
<div class="flex flex-col mx-6 ">
<div class="font-bold text-white">
+ Add New
</div>
</div>
</a>
<div class="flex flex-col justify-center gap-2 text-left xl:flex-row xl:flex-wrap">
@foreach ($standaloneDockers as $standaloneDocker)
<div class="box group" wire:click="setDestination('{{ $standaloneDocker->uuid }}')">
<div class="flex flex-col mx-6">