@extends('layouts.app') @section('title', 'Chi tiết sự cố - Cao Tải Server') @section('page_title', 'Chi tiết sự cố - Cao Tải Server') @section('breadcrumb') @endsection @push('styles') @endpush @section('content') @php $displayTz = config('app.display_timezone'); $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']; $breached = (array) $incident->breached_metrics; @endphp Quay lại
{{ $incident->server?->domain?->name ?? '—' }} - {{ $incident->server?->ip_address ?? '—' }} {{ $statusLabel[$incident->status] ?? $incident->status }}
{{ $incident->recorded_at->copy()->setTimezone($displayTz)->format('d/m/Y H:i:s') }} CPU {{ $incident->cpu_usage_pct }}%{{ in_array('cpu', $breached, true) ? ' ⚠️' : '' }} RAM {{ $incident->ram_usage_pct }}%{{ in_array('ram', $breached, true) ? ' ⚠️' : '' }} DISK {{ $incident->disk_usage_pct }}%{{ in_array('disk', $breached, true) ? ' ⚠️' : '' }}

Top tiến trình tốn tài nguyên ({{ $processes->count() }})

@if ($processes->isEmpty())
Không có dữ liệu tiến trình.
@else
@foreach ($processes as $process) @endforeach
PID Tên tiến trình User Command line CPU % MEM %
{{ $process->pid }} {{ $process->name }} {{ $process->username ?? '—' }} {{ $process->cmdline ?? '—' }} {{ number_format($process->cpu_pct, 1) }}% {{ number_format($process->mem_pct, 1) }}%
@endif

Log liên quan ({{ $logs->count() }} file)

@if ($logs->isEmpty())
Không có dữ liệu log.
@else @foreach ($logs as $i => $log) @php $bodyId = 'log-body-'.$i; @endphp
{{ $log->path }}
@if ($log->error) Lỗi đọc: {{ $log->error }} @else {{ $log->line_count }} dòng @if ($log->truncated) Đã cắt bớt (tail) @endif @endif
@if ($log->error)
Không đọc được file này ({{ $log->error }}).
@elseif ($log->line_count === 0)
File trống.
@else
{{ $log->content }}
@endif
@endforeach @endif
@endsection @push('scripts') @endpush