()
| 982 | } |
| 983 | |
| 984 | async function runDaily() { |
| 985 | const userId = ensureUser(); |
| 986 | const days = Number($("daysInput").value || 1); |
| 987 | await loadSourceOptions(); |
| 988 | const sourceOptions = collectDailyOptions(); |
| 989 | const selectedSourceCount = |
| 990 | sourceOptions.arxiv_categories.length + sourceOptions.conferences.length + sourceOptions.journals.length; |
| 991 | if (!selectedSourceCount) { |
| 992 | throw new Error("请至少选择一个论文来源。"); |
| 993 | } |
| 994 | setStatus("启动每日推送", true); |
| 995 | const data = await api("/api/daily/start", { |
| 996 | method: "POST", |
| 997 | body: JSON.stringify({ user_id: userId, days, ...sourceOptions }), |
| 998 | }); |
| 999 | await handleDailyTask(data.task); |
| 1000 | } |
| 1001 | |
| 1002 | async function submit(generateReports) { |
| 1003 | if (!state.push) throw new Error("请先加载一轮推送。"); |
nothing calls this directly
no test coverage detected