2024-11-03 21:19:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Livewire\Destination;
|
|
|
|
|
|
|
|
|
|
use App\Models\Server;
|
2026-05-19 10:50:08 +00:00
|
|
|
use Illuminate\Support\Collection;
|
2024-11-03 21:19:41 +00:00
|
|
|
use Livewire\Attributes\Locked;
|
|
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
|
|
class Index extends Component
|
|
|
|
|
{
|
|
|
|
|
#[Locked]
|
|
|
|
|
public $servers;
|
|
|
|
|
|
2026-05-19 10:50:08 +00:00
|
|
|
#[Locked]
|
|
|
|
|
public Collection $destinations;
|
|
|
|
|
|
|
|
|
|
public function mount(): void
|
2024-11-03 21:19:41 +00:00
|
|
|
{
|
|
|
|
|
$this->servers = Server::isUsable()->get();
|
2026-05-19 10:50:08 +00:00
|
|
|
$this->destinations = $this->servers
|
|
|
|
|
->flatMap(fn (Server $server) => $server->standaloneDockers->concat($server->swarmDockers))
|
|
|
|
|
->values();
|
2024-11-03 21:19:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function render()
|
|
|
|
|
{
|
|
|
|
|
return view('livewire.destination.index');
|
|
|
|
|
}
|
|
|
|
|
}
|