fix: make daily task log header-only

This commit is contained in:
Wyndham ARR
2026-08-11 17:23:33 +08:00
parent c947230471
commit f2c1265a1c
16 changed files with 251 additions and 34 deletions

View File

@@ -410,7 +410,7 @@
: chip(job.status, jobStatus);
const canDownload = state.health.download_ready && job.status === "succeeded" && job.daily_report_sha256;
return `
<tr class="job-row${job.job_id === state.selectedJobId ? " is-selected" : ""}" data-job-id="${escapeHtml(job.job_id)}" tabindex="0" role="button" aria-selected="${job.job_id === state.selectedJobId}" aria-label="${escapeHtml(I18N?.t("task.view_job", { jobId: job.job_id }) || `查看任务 ${job.job_id} 的全流程日志`)}">
<tr>
<td><span class="filename" title="${escapeHtml(job.filename || "—")}">${escapeHtml(job.filename || "—")}</span></td>
<td>${statusMarkup}${job.failure_code ? `<code class="job-failure-code" title="${escapeHtml(job.failure_code)}">${escapeHtml(job.failure_code)}</code>` : ""}</td>
<td>${escapeHtml(job.arrival_date ? formatDate(job.arrival_date) : "—")}</td>
@@ -1009,14 +1009,13 @@
}
}
async function selectJob(jobId, { showLog = false } = {}) {
async function selectJob(jobId) {
if (!jobId) return;
clearTracePoll();
const changed = state.selectedJobId !== jobId;
state.selectedJobId = jobId;
if (changed) state.jobTrace = null;
renderJobs(state.jobs);
if (showLog) openTaskLog();
await loadJobTrace(true, !changed);
}
@@ -2611,19 +2610,7 @@
if (reviewTrigger) {
event.preventDefault();
openDailyPriceReview(reviewTrigger.dataset.openPriceReview, true);
return;
}
if (event.target.closest("a, button")) return;
const row = event.target.closest("[data-job-id]");
if (row) selectJob(row.dataset.jobId, { showLog: true });
});
$("#jobs-body").addEventListener("keydown", (event) => {
if (!["Enter", " "].includes(event.key)) return;
if (event.target.closest("a, button")) return;
const row = event.target.closest("[data-job-id]");
if (!row) return;
event.preventDefault();
selectJob(row.dataset.jobId, { showLog: true });
});
$("#daily-price-review-body").addEventListener("click", (event) => {
const save = event.target.closest("[data-daily-price-review-save]");

View File

@@ -295,10 +295,6 @@ th { color: var(--muted); background: #fbfcfe; font-size: 10px; font-weight: 750
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcff; }
.job-row { cursor: pointer; }
.job-row.is-selected td { background: #f1f6ff; }
.job-row.is-selected td:first-child { box-shadow: inset 3px 0 var(--blue); }
.job-row:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: -3px; }
.job-failure-code { max-width: 180px; margin-top: 4px; overflow: hidden; display: block; color: #b42318; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.filename { max-width: 260px; overflow: hidden; display: block; font-weight: 620; text-overflow: ellipsis; }
.cell-subtle { color: var(--muted); }