Fix mappings

This commit is contained in:
Lance Pioch 2024-07-04 13:50:48 -04:00
parent 8b86707150
commit f2754c3cb1

View File

@ -200,7 +200,12 @@ class Server extends Model
*/ */
public function getPortMappings(): array public function getPortMappings(): array
{ {
return $this->ports->map(fn (Endpoint $port) => (string) $port)->all(); return $this->ports->mapToGroups(fn (Endpoint $endpoint) =>
[$endpoint->ip => $endpoint->port]
)->toArray();
$ips = $this->ports->map(fn (Endpoint $endpoint) => $endpoint->ip)->unique()->all();
} }
public function isInstalled(): bool public function isInstalled(): bool