@extends('layouts.app')
@section('title', 'Bandwidth usage')
@section('content')
Bandwidth usage
Aggregated consumption per subscriber for the selected period.
@include('components.kpi', ['label' => 'Total consumed', 'value' => human_bytes($totals['bytes']), 'variant' => 'info', 'href' => '#'])
@include('components.kpi', ['label' => 'Download', 'value' => human_bytes($totals['input']), 'href' => '#'])
@include('components.kpi', ['label' => 'Upload', 'value' => human_bytes($totals['output']), 'href' => '#'])
@include('components.kpi', ['label' => 'Peak day', 'value' => $totals['peak_day'], 'delta' => human_bytes($totals['peak_bytes']), 'href' => '#'])
Daily aggregate
@include('components.chart', [
'series' => collect($daily)->map(fn ($p) => [
'label' => \Carbon\Carbon::parse($p['date'])->format('d M'),
'value' => $p['total_bytes'],
])->all(),
'type' => 'bar', 'format' => 'bytes', 'height' => 210,
])
Per-subscriber consumption
{{ $from->format('d M Y') }} – {{ $to->format('d M Y') }}
| Subscriber | Plan | Sessions | Online |
Download | Upload | Total | Quota used |
@forelse ($usage as $row)
|
{{ $row['username'] }}
@if ($row['customer'])
@endif
|
{{ $row['plan'] ?? '—' }} |
{{ number_format($row['sessions']) }} |
{{ $row['hours'] }} h |
{{ human_bytes($row['input_bytes']) }} |
{{ human_bytes($row['output_bytes']) }} |
{{ human_bytes($row['total_bytes']) }} |
@if ($row['quota_gb'])
@php $pct = min(100, ($row['total_bytes'] / ($row['quota_gb'] * 1073741824)) * 100); @endphp
{{ number_format($pct, 1) }}%
@else
—
@endif
|
@empty
|
@include('components.empty-state', ['icon' => '📈', 'title' => 'No usage recorded in this period'])
|
@endforelse
@endsection