feat: implement available IPs loading in Proxmox Firewall component to streamline IP selection for firewall rules and enhance user experience
This commit is contained in:
@@ -261,20 +261,7 @@
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-2">Destination</label>
|
||||
<select wire:model="ruleDest" class="w-full px-3 py-2 border border-neutral rounded-lg bg-background">
|
||||
@php
|
||||
$allIps = collect();
|
||||
if ($server->primaryIpv4) {
|
||||
$allIps->push(['ip' => $server->primaryIpv4->ip, 'type' => 'IPv4', 'label' => 'Primary']);
|
||||
}
|
||||
if ($server->primaryIpv6) {
|
||||
$allIps->push(['ip' => $server->primaryIpv6->ip, 'type' => 'IPv6', 'label' => 'Primary']);
|
||||
}
|
||||
foreach ($server->ipAddresses as $ipAddress) {
|
||||
$allIps->push(['ip' => $ipAddress->ip, 'type' => strtoupper($ipAddress->type), 'label' => 'Assigned']);
|
||||
}
|
||||
$uniqueIps = $allIps->unique('ip');
|
||||
@endphp
|
||||
@foreach($uniqueIps as $ipData)
|
||||
@foreach($availableIps as $ipData)
|
||||
<option value="{{ $ipData['ip'] }}">{{ $ipData['ip'] }} ({{ $ipData['type'] }} - {{ $ipData['label'] }})</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user