改用Grok联网搜索并保留每轮信号
This commit is contained in:
@@ -162,6 +162,30 @@ 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);
|
||||
@@ -410,6 +434,9 @@ 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>
|
||||
|
||||
@@ -484,6 +511,7 @@ 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: "完成",
|
||||
@@ -667,9 +695,34 @@ 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)) {
|
||||
|
||||
Reference in New Issue
Block a user