@extends('layouts.app') @section('title', '無障礙掃描結果') @section('content')
返回清單
{{-- 標題列 --}}
{{ $accessibilityScan->project?->name ?? parse_url($accessibilityScan->target_url, PHP_URL_HOST) }}
{{ $accessibilityScan->target_url }}
@if($accessibilityScan->status==='running') @endif @if($accessibilityScan->status==='done') 匯出 PDF @endif WCAG {{ $accessibilityScan->standardLabel() }} Pa11y + {{ $accessibilityScan->runnerLabel() }}  ·  @if($accessibilityScan->max_pages > 1) 多頁掃描(最多 {{ $accessibilityScan->max_pages }} 頁,實際掃描 {{ $accessibilityScan->pages_scanned ?? '—' }} 頁) @else 單頁掃描 @endif
{{-- 狀態 / 摘要卡片 --}} @if($accessibilityScan->status==='running' || $accessibilityScan->status==='pending')
掃描執行中,請稍候…

    
@elseif($accessibilityScan->status==='failed')
掃描失敗:{{ $accessibilityScan->error_log }}
@else {{-- 摘要數字 --}} @php $bt = $summary['by_type'] ?? []; @endphp
@if($accessibilityScan->runner === 'lighthouse' && isset($summary['lh_score'])) @php $lhScore = $summary['lh_score']; $lhColor = $lhScore >= 90 ? 'success' : ($lhScore >= 50 ? 'warning' : 'danger'); @endphp
{{ $lhScore }}
Lighthouse 分數
/100
@endif @foreach([ ['label'=>'錯誤', 'key'=>'error', 'color'=>'danger', 'icon'=>'bi-x-circle-fill'], ['label'=>'警告', 'key'=>'warning', 'color'=>'warning', 'icon'=>'bi-exclamation-triangle-fill'], ['label'=>'注意', 'key'=>'notice', 'color'=>'secondary','icon'=>'bi-info-circle-fill'], ['label'=>'總計', 'key'=>'_total', 'color'=>'primary', 'icon'=>'bi-bar-chart-fill'], ] as $s)
{{ $s['key']==='_total' ? ($summary['total']??0) : ($bt[$s['key']]??0) }}
{{ $s['label'] }}
@endforeach
{{-- 結果列表 --}} @if(count($findings)===0)
恭喜!未發現無障礙問題。
@else {{-- 多頁:先顯示各頁摘要 --}} @if($accessibilityScan->max_pages > 1) @php $byPage = []; foreach ($findings as $f) { $byPage[$f['page_url'] ?? '—'][] = $f; } @endphp
各頁面摘要
@foreach($byPage as $pageUrl => $pageFindings) @php $pe = count(array_filter($pageFindings, fn($f) => $f['type']==='error')); $pw = count(array_filter($pageFindings, fn($f) => $f['type']==='warning')); $pn = count(array_filter($pageFindings, fn($f) => $f['type']==='notice')); @endphp @endforeach
頁面網址 錯誤 警告 注意 合計
{{ $pageUrl }} {{ $pe ?: '·' }} {{ $pw ?: '·' }} {{ $pn ?: '·' }} {{ count($pageFindings) }}
@endif {{-- 搜尋 / 篩選工具列 --}}
{{-- findings 資料(hidden,由 JS 渲染)--}} {{-- 結果卡片容器 --}}
{{-- 分頁 --}}
@endif @endif
@endsection @push('scripts') @if($accessibilityScan->status === 'done') @endif @if(in_array($accessibilityScan->status, ['running','pending'])) @endif @endpush