@php
// Port type colors - more vibrant and distinct
$portTypeColors = [
'GigabitEthernet' => '#0066ff',
'FastEthernet' => '#9933ff',
'SFP' => '#ff3333',
'SFP+' => '#ff6600',
'QSFP' => '#ffcc00',
'QSFP+' => '#00cccc',
'XFP' => '#666666',
'Combo Ports' => '#00cc99',
'1G/10G' => '#00ff66',
'40G/100G' => '#cc0000',
'1G/10G/25G' => '#cc00cc',
'400G' => '#ff3300',
'Other' => '#999999',
];
// Port type sizes - larger for higher capacity ports
$portTypeSizes = [
'GigabitEthernet' => ['padding' => '6px', 'minHeight' => '18px', 'borderWidth' => '2px'],
'FastEthernet' => ['padding' => '5px', 'minHeight' => '16px', 'borderWidth' => '2px'],
'SFP' => ['padding' => '7px', 'minHeight' => '20px', 'borderWidth' => '2.5px'],
'SFP+' => ['padding' => '8px', 'minHeight' => '22px', 'borderWidth' => '3px'],
'QSFP' => ['padding' => '9px', 'minHeight' => '24px', 'borderWidth' => '3px'],
'QSFP+' => ['padding' => '10px', 'minHeight' => '26px', 'borderWidth' => '3.5px'],
'XFP' => ['padding' => '7px', 'minHeight' => '20px', 'borderWidth' => '2.5px'],
'Combo Ports' => ['padding' => '8px', 'minHeight' => '22px', 'borderWidth' => '3px'],
'1G/10G' => ['padding' => '7px', 'minHeight' => '20px', 'borderWidth' => '2.5px'],
'40G/100G' => ['padding' => '10px', 'minHeight' => '26px', 'borderWidth' => '3.5px'],
'1G/10G/25G' => ['padding' => '8px', 'minHeight' => '22px', 'borderWidth' => '3px'],
'400G' => ['padding' => '12px', 'minHeight' => '30px', 'borderWidth' => '4px'],
'Other' => ['padding' => '6px', 'minHeight' => '18px', 'borderWidth' => '2px'],
];
// Group ports by port_type
$portsByType = $ispDevice->ports->groupBy('port_type');
@endphp
@php
$totalBlocks = $portsByType->count();
@endphp
@foreach($portsByType as $portType => $typePorts)
@php
$typeLabel = $portType ?: 'Unspecified';
$typeColor = $portTypeColors[$portType] ?? '#999999';
$portSize = $portTypeSizes[$portType] ?? ['padding' => '6px', 'minHeight' => '18px', 'borderWidth' => '2px'];
$typePortsArray = $typePorts->values()->all();
$portsPerRowForType = ceil(count($typePortsArray) / 2);
$row1TypePorts = array_slice($typePortsArray, 0, $portsPerRowForType);
$row2TypePorts = array_slice($typePortsArray, $portsPerRowForType);
@endphp
{{ $typeLabel }} ({{ count($typePortsArray) }})
@foreach($row1TypePorts as $port)
@if($port->status == 'active' || $port->status == 'used')
@endif
@endforeach
@if(count($row2TypePorts) > 0)
@foreach($row2TypePorts as $port)
@if($port->status == 'active' || $port->status == 'used')
@endif
@endforeach
@endif
@endforeach
{{ $ispDevice->device_name ?? 'Switch' }} - {{ $ispDevice->ports->count() }} Ports