@extends('layouts.app') @section('content')
| @php $sortUrl = fn($f) => route('host-alerts.index', array_merge(request()->except(['sort','dir','page']), [ 'sort' => $f, 'dir' => ($sortField === $f && $sortDir === 'asc') ? 'desc' : 'asc', ])); $sortIcon = fn($f) => $sortField === $f ? ($sortDir === 'asc' ? '' : '') : ''; @endphp | 案件編號 | 等級{!! $sortIcon('level') !!} | 問題種類 | 客戶{!! $sortIcon('client') !!} | 主機{!! $sortIcon('host') !!} | 摘要 | 時間{!! $sortIcon('time') !!} | ||
|---|---|---|---|---|---|---|---|---|---|
| {{-- 未讀紅點 --}} | @if(!$isRead) @endif | {{-- 案件編號 --}}{{ $caseNo }} | {{-- 等級(只顯示一次) --}}{{ $levelBadge['label'] }} | {{-- 問題種類(類別標籤,緊接等級後) --}}
@foreach($byCategory as $catKey => $catItems)
@php $catDef = \App\Models\HostAlert::CATEGORIES[$catKey] ?? ['label'=>$catKey,'color'=>'secondary','icon'=>'bi-bell']; @endphp
{{ $catDef['label'] }}
@endforeach
|
{{-- 客戶(獨立欄) --}}
@if($client) {{ $client->name }} @else — @endif | {{-- 主機(獨立欄) --}}@if($host) {{ $host->name }} @if($host->ip_address) {{ $host->ip_address }} @endif @else 已刪除 @endif | {{-- 摘要(最多 2 行,其餘點進去看) --}}
@foreach($normalizedAlerts->take(2) as $ai)
@endforeach
@if($normalizedAlerts->count() > 2)
… 還有 {{ $normalizedAlerts->count()-2 }} 項
@endif
|
{{-- 時間 --}}
{{ $alert->created_at->format('Y/m/d H:i') }} {{ $alert->created_at->diffForHumans() }} | {{-- 操作 --}}
@if(!$isRead)
@endif
|
| 沒有符合條件的告警記錄 | |||||||||