@extends('layouts.app') @section('title', '檢視程式碼審查報告') @push('styles') @endpush @section('content')

{{ $report->title }}

{{ $report->client?->name ?? '未分類' }} / {{ $report->project->name }} {{ $report->created_at->format('Y-m-d H:i') }}

{{-- ===== 頁籤卡片 ===== --}}
{{-- /report-tab-header --}}
{{-- ================================================================ --}} {{-- Tab 1: 功能規格 --}} {{-- ================================================================ --}}
@php $isPdf = !empty($report->file_path) && str_ends_with(strtolower($report->file_path), '.pdf'); @endphp @if($isPdf || $report->content)
功能規格內容
編輯
{{-- PDF 內嵌預覽 --}} @if($isPdf)
上傳的規格 PDF 下載 PDF
@endif {{-- 萃取的文字內容 --}} @if($report->content)
{{ $report->content }}
@endif @else

尚未填寫功能規格

填寫規格
@endif
{{-- ================================================================ --}} {{-- Tab 2: 程式碼(上傳 + Step 1 掃描) --}} {{-- ================================================================ --}}
{{-- 程式碼來源 --}}
程式碼來源
@if(!empty($report->code_file_paths))
    @foreach($report->code_file_paths as $cf)
  • @if(str_starts_with($cf, '[GitLab]') || str_starts_with($cf, '[Git]')) {{ $cf }} @else {{ basename($cf) }} @endif
  • @endforeach
@if($report->code_content)
{{ Str::limit($report->code_content, 50000) }}
@endif @endif
@if(!empty($report->code_file_paths))
@if(count($report->code_file_paths) === 1 && (str_starts_with($report->code_file_paths[0], '[GitLab]') || str_starts_with($report->code_file_paths[0], '[Git]'))) 已從 Git 倉庫匯入程式碼 @else 已上傳 {{ count($report->code_file_paths) }} 個檔案 @endif @if($report->code_content) @endif

重新上傳或匯入將取代現有程式碼,並清除掃描與比對結果

@else

尚未上傳程式碼,請選擇來源後上傳

@endif {{-- 上傳檔案 --}}
@csrf
{{-- GitLab --}}
{{-- Step 1: AI 初步掃描 --}} @if($report->code_content) @if($report->code_scan_result) @php $scanConverter = new \League\CommonMark\GithubFlavoredMarkdownConverter(['html_input'=>'escape','allow_unsafe_links'=>false]); @endphp
AI 程式碼掃描結果
掃描完成
{!! $scanConverter->convertToHtml($report->code_scan_result) !!}
@else
AI 程式碼掃描

點擊下方按鈕讓 AI 辨識程式碼中有哪些功能、資安問題與邏輯 Bug

@endif @else
請先上傳程式碼,才能進行 AI 掃描
@endif
{{-- /tab-code --}} {{-- ================================================================ --}} {{-- Tab 3: 規格比對結果 --}} {{-- ================================================================ --}}
@if($report->ai_code_review) @php $reviewConverter = new \League\CommonMark\GithubFlavoredMarkdownConverter(['html_input'=>'escape','allow_unsafe_links'=>false]); @endphp {{-- 工具列 --}}
AI 規格比對檢查報告
PDF DOCX 檢查完成
{{-- 目錄 + 內容 雙欄佈局 --}}
{{-- 左側:目錄 --}} {{-- 右側:報告內容 --}}
{!! $reviewConverter->convertToHtml($report->ai_code_review) !!}
{{-- /review-layout --}} @elseif($report->code_scan_result && $report->content)

程式碼已掃描完成,點擊下方讓 AI 逐項比對規格與程式碼

@elseif(!$report->code_content)

請先在「程式碼」頁籤上傳程式碼並完成掃描

@elseif(!$report->code_scan_result)

請先在「程式碼」頁籤完成 AI 掃描,再執行規格比對

@else

請先填寫功能規格,才能進行比對

@endif
{{-- /tab-review --}} {{-- ================================================================ --}} {{-- Tab 4: 測試清單 --}} {{-- ================================================================ --}}
@if($report->test_checklist) @php $checklistConverter = new \League\CommonMark\GithubFlavoredMarkdownConverter(['html_input'=>'escape','allow_unsafe_links'=>false]); @endphp
測試清單
已產生
{!! $checklistConverter->convert($report->test_checklist) !!}
@elseif($report->content)

從功能規格{{ $report->code_scan_result ? '與程式碼掃描結果' : '' }}自動產生測試案例清單

@else

請先填寫功能規格,才能產生測試清單

@endif
{{-- /tab-checklist --}}
{{-- /tab-content --}}
{{-- /tab-content-box --}}
{{-- /report-tab-card --}} 返回列表
@endsection @push('scripts') @endpush