{{-- resources/views/dashboard.blade.php --}} @extends('layouts.app') @section('header_actions')@endsection @section('content') @php $memPct = ($memory_total_mb ?? 0) > 0 ? round(($memory_used_mb ?? 0) / $memory_total_mb * 100, 1) : 0; $memUsedGb = ($memory_used_mb ?? 0) > 0 ? round(($memory_used_mb ?? 0) / 1024, 2) : 0; $memTotalGb = ($memory_total_mb ?? 0) > 0 ? round(($memory_total_mb ?? 0) / 1024, 2) : 0; $cpuPct = min(max(($cpu_load ?? 0) * 20, 0), 100); $diskUsedPct = 100 - ($disk_free_percent ?? 100); $acdSeconds = $today_stats['acd'] ?? 0; $acdHuman = $acdSeconds > 0 ? floor($acdSeconds / 60) . 'm ' . ($acdSeconds % 60) . 's' : '0s'; $totalCalls = $today_stats['total_calls'] ?? 0; $answered = $today_stats['answered_calls'] ?? 0; $noAnswer = $today_stats['no_answer_calls'] ?? 0; $busy = $today_stats['busy_calls'] ?? 0; $failed = $today_stats['failed_calls'] ?? 0; $answeredPct = $totalCalls > 0 ? round($answered / $totalCalls * 100) : 0; $noAnswerPct = $totalCalls > 0 ? round($noAnswer / $totalCalls * 100) : 0; $busyPct = $totalCalls > 0 ? round($busy / $totalCalls * 100) : 0; $failedPct = $totalCalls > 0 ? round($failed / $totalCalls * 100) : 0; $totalExt = ($reachable_extensions ?? 0) + ($unreachable_extensions ?? 0); $regPct = $totalExt > 0 ? round(($registered_extensions ?? 0) / $totalExt * 100, 1) : 0; $unregPct = $totalExt > 0 ? round(($unreachable_extensions ?? 0) / $totalExt * 100, 1) : 0; $trunkUp = collect($trunks ?? [])->where('status', 'Reachable')->count(); $trunkTotal = count($trunks ?? []); $trunkDown = $trunkTotal - $trunkUp; @endphp {{-- ── PAGE HEADER ── --}}
| Trunk Name | Type | Status | Registration | Calls (Active) | Calls (24h) | Avg RTT | Actions |
|---|---|---|---|---|---|---|---|
| {{ $name }} | {{ $type }} | @if($isUp) Up @elseif($isDeg) Degraded @else Down @endif | @if($isUp) Registered @else Unregistered @endif | {{ $active_calls ?? 0 }} | {{ $trunk['calls_today'] ?? 0 }} | {{ $rttMs !== null ? $rttMs . ' ms' : '—' }} | |
| No trunk data available. | |||||||