fix(HEL-412): 刷新降级不再整次失败,并补齐准备中提示
手动刷新与自动补跑共用可用数据判定:日线推算或上一交易日快照记为部分/准备中成功,避免前端误报刷新失败。HTTP JSON 解析错误不再把请求正文写入日志。 Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
0d13066386
commit
5085cacf0d
@@ -770,11 +770,33 @@
|
||||
scroll.classList.add("m-motion-fade-in");
|
||||
}
|
||||
|
||||
function dashboardFreshnessNotice() {
|
||||
const meta = (state.dashboard && state.dashboard.meta) || {};
|
||||
if (meta.display_notice) return String(meta.display_notice);
|
||||
const requested = String(meta.requested_date || "").replace(/-/g, "");
|
||||
const actual = String(meta.trade_date || "").replace(/-/g, "");
|
||||
const compact = actual;
|
||||
const shown = /^\d{8}$/.test(compact)
|
||||
? (Number(compact.slice(4, 6)) + " 月 " + Number(compact.slice(6, 8)) + " 日")
|
||||
: "";
|
||||
if (meta.data_status === "preparing" || (meta.carried_forward && actual && requested && actual !== requested)) {
|
||||
return shown ? ("今日数据正在准备,当前展示 " + shown) : "今日数据正在准备,当前展示最近可用数据";
|
||||
}
|
||||
if (meta.data_status === "partial" || meta.limit_data_source === "derived") {
|
||||
return meta.notice || "部分正式数据尚未到齐,当前展示日线推算结果";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function renderTopArea(key) {
|
||||
const page = document.querySelector(".m-page");
|
||||
if (!page) return;
|
||||
let top = page.querySelector(".m-top");
|
||||
let html = buildStrip();
|
||||
const freshness = dashboardFreshnessNotice();
|
||||
if (freshness) {
|
||||
html = '<div class="m-phase-notice"><strong>' + escapeHtml(freshness) + "</strong></div>" + html;
|
||||
}
|
||||
if (key === "market/performance") html += performanceConclusion();
|
||||
if (!top) {
|
||||
top = document.createElement("div");
|
||||
|
||||
Reference in New Issue
Block a user