{{-- CVE 最新資安通報(分類頁籤 + 前端分頁) --}} @php $cveData = $latestCves ?? []; $hasCves = collect($cveData)->flatten(1)->isNotEmpty(); $tabConfig = [ 'all' => ['label' => '全部', 'icon' => 'bi-shield-exclamation', 'color' => 'danger'], 'Linux OS' => ['label' => 'Linux', 'icon' => 'bi-ubuntu', 'color' => 'dark'], 'Apache' => ['label' => 'Apache', 'icon' => 'bi-server', 'color' => 'danger'], 'MySQL' => ['label' => 'MySQL', 'icon' => 'bi-database', 'color' => 'primary'], 'PHP' => ['label' => 'PHP', 'icon' => 'bi-filetype-php', 'color' => 'indigo'], 'MSSQL' => ['label' => 'MSSQL', 'icon' => 'bi-database-gear', 'color' => 'info'], 'Oracle' => ['label' => 'Oracle', 'icon' => 'bi-database-fill', 'color' => 'warning'], 'Chrome' => ['label' => 'Chrome', 'icon' => 'bi-browser-chrome', 'color' => 'success'], ]; // 組合「全部」頁籤的資料 $allCves = collect($cveData)->flatten(1)->unique('id')->sortByDesc('published')->values()->toArray(); @endphp @if ($hasCves)
最新 CVE 資安通報
{{-- 頁籤 --}}
{{-- 頁籤內容 --}}
@foreach ($tabConfig as $tabKey => $tab) @php $items = $tabKey === 'all' ? $allCves : ($cveData[$tabKey] ?? []); $slug = Str::slug($tabKey); @endphp @if ($tabKey === 'all' || count($items) > 0)
@foreach ($items as $idx => $cve) @php $severityColors = [ 'CRITICAL' => 'danger', 'HIGH' => 'warning', 'MEDIUM' => 'info', 'LOW' => 'secondary', ]; $severityLabels = [ 'CRITICAL' => '嚴重', 'HIGH' => '高', 'MEDIUM' => '中', 'LOW' => '低', ]; $sColor = $severityColors[$cve['severity'] ?? ''] ?? 'secondary'; $sLabel = $severityLabels[$cve['severity'] ?? ''] ?? ($cve['severity'] ?? 'N/A'); $tagColors = [ 'Linux OS' => 'dark', 'Apache' => 'danger', 'MySQL' => 'primary', 'PHP' => 'indigo', 'MSSQL' => 'info', 'Oracle' => 'warning', 'Chrome' => 'success', ]; @endphp @endforeach
CVE 編號 嚴重性 分數 產品 描述 發布日期
{{ $cve['id'] }} {{ $sLabel }} @if ($cve['score']) {{ $cve['score'] }} @else - @endif @foreach ($cve['tags'] ?? [] as $tag) {{ $tag }} @endforeach {{ Str::limit($cve['description'], 90) }} {{ $cve['published'] ? \Carbon\Carbon::parse($cve['published'])->format('Y-m-d') : '-' }}
{{-- 分頁按鈕 --}} @if (count($items) > 10) @php $totalPages = (int) ceil(count($items) / 10); @endphp @endif
@endif @endforeach
{{-- 分頁 JS --}} @endif