MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / renderReportList

Function renderReportList

deployments/desktop/static/app.js:1054–1078  ·  view source on GitHub ↗
(targetId, reports)

Source from the content-addressed store, hash-verified

1052}
1053
1054function renderReportList(targetId, reports) {
1055 const docs = reports.created_docs || [];
1056 const target = $(targetId);
1057 if (!docs.length) {
1058 target.className = "empty";
1059 target.textContent = "本次没有生成报告。";
1060 return;
1061 }
1062 target.className = "";
1063 target.innerHTML = renderFeishuNotice(reports, docs) + docs.map((doc) => {
1064 const reportPath = doc.report_path ? `<p>Markdown:<code>${escapeHtml(doc.report_path)}</code></p>` : "";
1065 const pdfPath = doc.pdf_path ? `<p>PDF:<code>${escapeHtml(doc.pdf_path)}</code></p>` : "";
1066 const url = doc.url ? `<p><a href="${doc.url}" target="_blank" rel="noreferrer">打开飞书文档</a></p>` : "";
1067 const error = doc.feishu_error ? `<p class="warning-text">飞书:发送失败,已保留本地报告。</p>` : "";
1068 return `
1069 <div class="report-item">
1070 <h4>${escapeHtml(doc.title || doc.paper?.title || "精读报告")}</h4>
1071 ${reportPath}
1072 ${pdfPath}
1073 ${url}
1074 ${error}
1075 </div>
1076 `;
1077 }).join("");
1078}
1079
1080function renderFeishuNotice(reports, docs) {
1081 const warning = reports.feishu_warning || "";

Callers 2

readArxivDirectFunction · 0.70
readPdfDirectFunction · 0.70

Calls 3

renderFeishuNoticeFunction · 0.85
$Function · 0.70
escapeHtmlFunction · 0.70

Tested by

no test coverage detected