@if(!$host->agent_token)
此主機尚未產生 Agent Token,請先至 主機設定產生 Token 後再安裝。
@else @php $installerUrl = url("/api/agent/installer/{$host->agent_token}"); $isWindows = ($host->os_type ?? 'linux') === 'windows'; if ($isWindows) { $installCmd = 'iex (New-Object Net.WebClient).DownloadString("' . $installerUrl . '")'; $osIcon = '🪟'; $osLabel = 'Windows Server'; $cmdNote = '在目標主機以系統管理員開啟 PowerShell 執行:'; } else { $installCmd = 'bash <(curl -fsSL "' . $installerUrl . '")'; $osIcon = '🐧'; $osLabel = 'Linux'; $cmdNote = '在目標主機以 root 執行以下指令(每 5 分鐘自動回報、每週六 02:00 掃毒):'; } @endphp
{{ $osIcon }} {{ $osLabel }} 如需變更請至 主機設定

{!! $cmdNote !!}

@if($isWindows)
Windows 需要 PowerShell 5.1+,且執行原則須允許腳本。若出現限制可先執行: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
@endif
@if($host->sbom_collected_at) @endif @if($host->av_last_scan_at) @endif
Token {{ substr($host->agent_token, 0, 16) }}…
最後回報 @if($host->agent_last_report_at) {{ $host->agent_last_report_at->format('Y-m-d H:i') }}({{ $host->agent_last_report_at->diffForHumans() }}) @else 尚未收到任何回報 @endif
Agent 版本 @if($host->agent_version) @php $latestVer = \App\Http\Controllers\AgentReportController::AGENT_VERSION; @endphp @if($host->agent_version === $latestVer) {{ $host->agent_version }} @else {{ $host->agent_version }} 更新中… @endif @else @endif
SBOM 收集 {{ $host->sbom_collected_at->format('Y-m-d H:i') }}
上次掃毒 @php $avSt = $host->av_last_scan['status'] ?? ''; @endphp {{ $host->av_last_scan_at->format('Y-m-d H:i') }}({{ $avSt === 'infected' ? '發現威脅' : '乾淨' }})
Agent 設定
@endif