no destination found
This commit is contained in:
@@ -103,10 +103,17 @@ class GithubPrivateRepository extends Component
|
|||||||
}
|
}
|
||||||
public function loadDestinations()
|
public function loadDestinations()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
$server = $this->servers->where('id', $this->selected_server_id)->first();
|
$server = $this->servers->where('id', $this->selected_server_id)->first();
|
||||||
|
if ($server->standaloneDockers->count() === 0 && $server->swarmDockers->count() === 0) {
|
||||||
|
$this->destinations = 0;
|
||||||
|
}
|
||||||
$this->destinations = $server->standaloneDockers->merge($server->swarmDockers);
|
$this->destinations = $server->standaloneDockers->merge($server->swarmDockers);
|
||||||
$this->selected_destination_id = $this->destinations[0]['id'];
|
$this->selected_destination_id = $this->destinations[0]['id'];
|
||||||
$this->selected_destination_class = $this->destinations[0]->getMorphClass();
|
$this->selected_destination_class = $this->destinations[0]->getMorphClass();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return generalErrorHandler($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public function submit()
|
public function submit()
|
||||||
{
|
{
|
||||||
|
@@ -72,6 +72,11 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
<x-inputs.button wire:click="submit">Select Destination</x-inputs.button>
|
<x-inputs.button wire:click="submit">Select Destination</x-inputs.button>
|
||||||
|
@else
|
||||||
|
<h1>No destinations found on this server.</h1>
|
||||||
|
<a href="{{ route('destination.new', ['server_id' => $selected_server_id]) }}">Add
|
||||||
|
a
|
||||||
|
destination</a>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
|
Reference in New Issue
Block a user