(node)
| 3345 | $("reportViewerBody").innerHTML = ""; |
| 3346 | $("clearReportAnnotationsBtn").disabled = true; |
| 3347 | hideReportAnnotationToolbar(); |
| 3348 | setReportLinks({}); |
| 3349 | } |
| 3350 | |
| 3351 | async function refreshReports(options = {}) { |
| 3352 | const scopedUser = $("reportsCurrentOnly").checked ? currentUser() : ""; |
| 3353 | const query = $("reportQuery").value.trim(); |
| 3354 | const days = $("reportDays").value || "30"; |
| 3355 | const date = $("reportDate").value || ""; |
| 3356 | const data = await api(`/api/reports?user_id=${encodeURIComponent(scopedUser)}&q=${encodeURIComponent(query)}&days=${days}&date=${encodeURIComponent(date)}&limit=${REPORT_LIST_LIMIT}`); |
| 3357 | state.reports = data.reports || []; |
| 3358 | const count = data.count || state.reports.length; |
| 3359 | $("reportSources").textContent = (data.source_dirs || []).length |
| 3360 | ? ui().reports.directory(data.source_dirs || [], count) |
| 3361 | : ui().reports.count(count); |
| 3362 | const activeId = options.activeReportId || (options.keepSelection && state.currentReport ? state.currentReport.report_id : state.reports[0]?.report_id || ""); |
| 3363 | renderReportList(state.reports, activeId); |
| 3364 | if (activeId) await loadReportContent(activeId, true); |
| 3365 | else clearReportViewer(); |
| 3366 | } |
| 3367 |
no test coverage detected