@extends('layouts.app') @section('title', 'Device Details') @section('page-title', 'Device Details') @section('content')

{{ $ispDevice->device_name ?? 'Device #' . $ispDevice->device_id }}

Edit Back
Device Information
ID:{{ $ispDevice->device_id }}
Name:{{ $ispDevice->device_name ?? '-' }}
Type:{{ $ispDevice->device_type ?? '-' }}
Site:{{ $ispDevice->site->site_name ?? '-' }}
IP:{{ $ispDevice->ip_address ?? '-' }}
MAC:{{ $ispDevice->mac_address ?? '-' }}
Interfaces ({{ $ispDevice->interfaces->count() }})
@if($ispDevice->interfaces->count() > 0) @foreach($ispDevice->interfaces as $interface) @endforeach
NameTypeStatus
{{ $interface->interface_name }} {{ $interface->interface_type }} {{ $interface->status }}
@else

No interfaces

@endif
Ports ({{ $ispDevice->ports->count() }})
@if($ispDevice->device_type == 'Switch' || $ispDevice->ports->count() > 0)
{{ strtoupper(substr($ispDevice->device_name ?? 'SWITCH', 0, 5)) }}
@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
@endif @if($ispDevice->ports->count() > 0)
@foreach($ispDevice->ports as $port) @endforeach
Port Name Port Number Port Type Port Capacity Status Description Action
{{ $port->port_name ?? '-' }} {{ $port->port_number ?? '-' }} {{ $port->port_type ?? '-' }} {{ $port->port_capacity ?? '-' }} {{ ucfirst($port->status) }} {{ $port->description ?? '-' }}
@else

No ports configured

@endif
@push('scripts') @endpush @foreach($ispDevice->ports as $port) @endforeach @endsection