(reports)
| 1026 | } |
| 1027 | |
| 1028 | function renderReports(reports) { |
| 1029 | const docs = reports.created_docs || []; |
| 1030 | $("reportResults").classList.remove("hidden"); |
| 1031 | if (!docs.length) { |
| 1032 | $("reportList").className = "empty"; |
| 1033 | $("reportList").textContent = "本次没有生成报告。"; |
| 1034 | return; |
| 1035 | } |
| 1036 | $("reportList").className = ""; |
| 1037 | $("reportList").innerHTML = renderFeishuNotice(reports, docs) + docs.map((doc) => { |
| 1038 | const reportPath = doc.report_path ? `<p>Markdown:<code>${escapeHtml(doc.report_path)}</code></p>` : ""; |
| 1039 | const pdfPath = doc.pdf_path ? `<p>PDF:<code>${escapeHtml(doc.pdf_path)}</code></p>` : ""; |
| 1040 | const url = doc.url ? `<p><a href="${doc.url}" target="_blank" rel="noreferrer">打开飞书文档</a></p>` : ""; |
| 1041 | const error = doc.feishu_error ? `<p class="warning-text">飞书:发送失败,已保留本地报告。</p>` : ""; |
| 1042 | return ` |
| 1043 | <div class="report-item"> |
| 1044 | <h4>${escapeHtml(doc.title || doc.paper?.title || "精读报告")}</h4> |
| 1045 | ${reportPath} |
| 1046 | ${pdfPath} |
| 1047 | ${url} |
| 1048 | ${error} |
| 1049 | </div> |
| 1050 | `; |
| 1051 | }).join(""); |
| 1052 | } |
| 1053 | |
| 1054 | function renderReportList(targetId, reports) { |
| 1055 | const docs = reports.created_docs || []; |
no test coverage detected