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

Function renderViewer

deployments/desktop/static/reports.js:277–302  ·  view source on GitHub ↗
(report)

Source from the content-addressed store, hash-verified

275 }
276
277 function renderViewer(report) {
278 uiState.currentReport = report;
279 byId("reportViewerTitle").textContent = report.title || "精读报告";
280 byId("reportViewerMeta").textContent = [report.user_id, report.saved_at || report.updated_at, report.report_path]
281 .filter(Boolean)
282 .join(" | ");
283 byId("reportViewerBody").className = "markdown-body";
284 byId("reportViewerBody").innerHTML = renderMarkdown(report.markdown || "");
285 renderMeta(report);
286
287 const linkMap = {
288 openReportAbsBtn: report.abs_url || "",
289 openReportPdfBtn: report.pdf_url || "",
290 openReportDocBtn: report.doc_url || "",
291 };
292 Object.entries(linkMap).forEach(([id, href]) => {
293 const button = byId(id);
294 button.disabled = !href;
295 if (href) button.dataset.href = href;
296 else delete button.dataset.href;
297 });
298 const copyButton = byId("copyReportPathBtn");
299 copyButton.disabled = !report.report_path;
300 if (report.report_path) copyButton.dataset.path = report.report_path;
301 else delete copyButton.dataset.path;
302 }
303
304 function renderList(reports, activeId = "") {
305 const target = byId("reportsList");

Callers 1

loadReportContentFunction · 0.85

Calls 3

byIdFunction · 0.85
renderMetaFunction · 0.85
renderMarkdownFunction · 0.70

Tested by

no test coverage detected