@extends('layouts.app') @section('title', 'Cao Tải Server') @section('page_title', 'Cao Tải Server') @push('styles') @endpush @section('content') @php $statusBadge = ['started' => 'badge-danger', 'ongoing' => 'badge-warning', 'recovered' => 'badge-success']; $statusLabel = ['started' => 'Mới xảy ra', 'ongoing' => 'Đang tiếp diễn', 'recovered' => 'Đã hồi phục']; $metricLabel = ['cpu' => 'CPU', 'ram' => 'RAM', 'disk' => 'DISK']; $displayTz = config('app.display_timezone'); $hasAnyIncident = ! empty($domainGroups); @endphp {{-- Bộ lọc --}}

Bộ lọc

{{-- Info bar --}}
Ngày {{ $date->format('d/m/Y') }}
@if ($hasAnyIncident && ! empty($topServers))

Server cao tải nhiều nhất trong ngày

@foreach ($topServers as $i => $ts)
{{ $i + 1 }}{{ $ts['label'] }}
@endforeach
@endif @if (! $hasAnyIncident)
Không có sự cố cao tải nào trong ngày này.
@else @foreach ($domainGroups as $domainGroup) @php $domain = $domainGroup['domain']; $servers = $domainGroup['servers']; $collapseId = 'domain-'.$domain->id; @endphp

{{ $domain->name }} {{ count($servers) }} IP

@foreach ($servers as $serverItem) @php $server = $serverItem['server']; $serverIncidents = $serverItem['incidents']; @endphp
{{ $server->ip_address }}
@foreach ($serverIncidents as $incident) @php $breached = (array) $incident->breached_metrics; $hasDetail = $incident->status !== 'recovered' && ($incident->processes_count > 0 || $incident->logs_count > 0); @endphp @endforeach
Thời gian Trạng thái Vượt ngưỡng CPU RAM DISK Thao tác
{{ $incident->recorded_at->copy()->setTimezone($displayTz)->format('d/m/Y H:i') }} {{ $statusLabel[$incident->status] ?? $incident->status }} @foreach ($breached as $metric) {{ $metricLabel[$metric] ?? $metric }} @endforeach {{ $incident->cpu_usage_pct }}% {{ $incident->ram_usage_pct }}% {{ $incident->disk_usage_pct }}% @if ($hasDetail) Chi tiết @else @endif
@endforeach
@endforeach @endif @endsection @push('scripts') @endpush