暂停情报采集任务

This commit is contained in:
Codex
2026-07-10 13:27:53 +08:00
parent 0a045a0c4b
commit bc4bbe0dde
8 changed files with 45 additions and 63 deletions
-53
View File
@@ -162,30 +162,6 @@ HOME_PAGE_HTML = """
margin-top: 5px;
}
.actions {
display: flex;
justify-content: flex-end;
margin-top: 12px;
}
.action-button {
border: 1px solid oklch(25% 0.02 210);
border-radius: 8px;
padding: 9px 13px;
background: var(--ink);
color: white;
font: inherit;
font-size: 13px;
font-weight: 700;
cursor: pointer;
min-width: 96px;
}
.action-button:disabled {
cursor: wait;
opacity: 0.66;
}
.layout {
display: grid;
grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
@@ -434,9 +410,6 @@ HOME_PAGE_HTML = """
<div class="pulse">
<strong id="todayCountText">读取中</strong>
<span id="todayCountDetail">正在整理新闻与项目。</span>
<div class="actions">
<button class="action-button" id="manualRunButton" type="button">手动搜索</button>
</div>
</div>
</section>
@@ -511,7 +484,6 @@ HOME_PAGE_HTML = """
const runCountFull = document.querySelector("#runCountFull");
const todayCountText = document.querySelector("#todayCountText");
const todayCountDetail = document.querySelector("#todayCountDetail");
const manualRunButton = document.querySelector("#manualRunButton");
const stateText = {
completed: "完成",
@@ -695,34 +667,9 @@ HOME_PAGE_HTML = """
renderRuns(data.runs || []);
}
async function triggerManualRun() {
manualRunButton.disabled = true;
manualRunButton.textContent = "搜索中";
try {
const response = await fetch("/agent/runs/daily", {
method: "POST",
headers: { Accept: "application/json" }
});
if (!response.ok) throw new Error("手动搜索失败");
await loadDashboard();
} finally {
window.setTimeout(() => {
manualRunButton.disabled = false;
manualRunButton.textContent = "手动搜索";
loadDashboard().catch(() => {});
}, 3000);
}
}
navButtons.forEach((button) => {
button.addEventListener("click", () => activateView(button.dataset.viewTarget));
});
manualRunButton.addEventListener("click", () => {
triggerManualRun().catch(() => {
manualRunButton.disabled = false;
manualRunButton.textContent = "手动搜索";
});
});
const initialView = window.location.hash.replace("#", "");
if (["signals", "report", "runs"].includes(initialView)) {