feat: implement AI city scan proxy route and add premium dark theme dashboard styling

This commit is contained in:
2569718930@qq.com
2026-04-26 04:32:46 +08:00
parent fdf001a801
commit 963b2098c0
3 changed files with 41 additions and 8 deletions
@@ -11149,9 +11149,9 @@
}
.root :global(.scan-ai-city-body) {
padding: 18px;
max-height: clamp(420px, 58vh, 760px);
overflow-y: auto;
padding: 18px 18px 36px;
max-height: none;
overflow: visible;
overscroll-behavior: contain;
}
@@ -652,7 +652,26 @@ function AiPinnedCityCard({
})
.then(async (response) => {
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
let detail = "";
try {
const errorPayload = await response.json();
const message = String(errorPayload?.error || "").trim();
const rawDetail = String(errorPayload?.detail || "").trim();
const elapsed = Number(errorPayload?.elapsed_ms);
const timeout = Number(errorPayload?.timeout_ms);
detail = [
message,
rawDetail,
Number.isFinite(elapsed) && Number.isFinite(timeout)
? `elapsed ${Math.round(elapsed / 1000)}s / timeout ${Math.round(timeout / 1000)}s`
: "",
]
.filter(Boolean)
.join(" · ");
} catch {
detail = "";
}
throw new Error(detail ? `HTTP ${response.status} · ${detail}` : `HTTP ${response.status}`);
}
return response.json() as Promise<AiCityForecastPayload>;
})