@extends('layouts.master') @section('title') {{ $statusFilter }} ONUs @endsection @section('css') @endsection @section('content')

{{ $statusFilter }} ONUs

{{-- OLT Dropdown --}}
{{-- Status --}}
{{-- Board --}}
{{-- Port --}}
{{-- Filter Button --}}
@php $total = max($stats['total'], 1); // prevent div by 0 $offlineTotal = $stats['offline'] + $stats['power_fail'] + $stats['los']; @endphp
ONU Status Overview
Online

{{ number_format($stats['online']) }}

{{ number_format(($stats['online'] / $total) * 100, 1) }}%
Total Offline

{{ number_format($offlineTotal) }}

{{ number_format(($offlineTotal / $total) * 100, 1) }}%
Offline
{{$stats['offline']}}
Power Fail
{{$stats['power_fail']}}
LOS
{{$stats['los']}}
Low Signal

{{ number_format($stats['low_signal']) }}

{{ number_format(($stats['low_signal'] / $total) * 100, 1) }}%
Status Distribution {{ number_format($stats['total']) }} Total ONUs
@if (session('status')) @endif @if (session('error'))
@endif
@if($onus->isEmpty())
No online ONUs found

There are no ONUs online currently

@else
@foreach ($onus as $key => $onu) @endforeach
Serial Number Name OLT Board Port Signal
@php $signalText = strtolower($onu['signal'] ?? ''); $status = strtolower($onu['status'] ?? ''); $color = 'text-muted'; $icon = 'ri-earth-line'; // Default icon if ($status === 'power fail') { $icon = 'ri-plug-2-fill'; $color = 'text-dark'; } elseif ($status === 'los') { $icon = 'ri-link-unlink-m'; // 🔌 Broken link icon for loss of signal $color = 'text-danger'; } elseif (str_contains($signalText, 'very good')) { $color = 'text-success'; } elseif (str_contains($signalText, 'warning')) { $color = 'text-warning'; } elseif (str_contains($signalText, 'critical')) { $color = 'text-danger'; } @endphp {{ $onu['sn'] ?? '-' }} {{ $onu['name'] ?? '-' }} {{ $onu['olt_name'] ?? '-' }} {{ $onu['board'] ?? '-' }} {{ $onu['port'] ?? '-' }} @php $color = 'text-muted'; if ($status === 'los') { $color = 'text-danger'; } elseif (str_contains($signalText, 'very good')) { $color = 'text-success'; } elseif (str_contains($signalText, 'warning')) { $color = 'text-warning'; } elseif (str_contains($signalText, 'critical')) { $color = 'text-danger'; } @endphp {{ isset($onu['signal_1310']) ? "{$onu['signal_1310']}" : '-' }}
@endif
@endsection @section('script') {{-- JS to toggle disabled state --}} @endsection