()
| 1113 | } |
| 1114 | |
| 1115 | async function readPdfDirect() { |
| 1116 | const userId = ensureUser(); |
| 1117 | const pdfPath = $("directPdfPath").value.trim(); |
| 1118 | if (!pdfPath) throw new Error("请输入 PDF 路径。"); |
| 1119 | setStatus("生成 PDF 精读报告", true); |
| 1120 | const data = await api("/api/read/pdf", { |
| 1121 | method: "POST", |
| 1122 | body: JSON.stringify({ |
| 1123 | user_id: userId, |
| 1124 | pdf_path: pdfPath, |
| 1125 | title: $("directPdfTitle").value.trim(), |
| 1126 | write_feishu: isChecked("directPdfWriteFeishu"), |
| 1127 | }), |
| 1128 | }); |
| 1129 | $("directReportResults").classList.remove("hidden"); |
| 1130 | renderReportList("directReportList", data); |
| 1131 | await Promise.allSettled([refreshDashboard(), refreshWikiStats()]); |
| 1132 | setStatus("精读报告已生成"); |
| 1133 | } |
| 1134 | |
| 1135 | async function refreshDashboard() { |
| 1136 | const userId = activeUser(); |
nothing calls this directly
no test coverage detected