主站行情管理并入数据中枢
- 数据中枢数据源配置页新增「主站行情任务」卡:交易时段后台刷新开关、
手动后台刷新、历史区间回补(任务提交 + 轮询主站 job 记录亮灯),
数据与调度仍归主站,控制台只经桥接代操作
- 新增桥接端点 /api/hub-admin/market/{refresh,backfill};回补改为
market.backfill 后台任务(jobs.config.json 注册,锁独立,超时 30 分钟),
桥接调用秒回,不再阻塞
- 主站桌面端删除顶栏「行情管理」按钮与整个行情管理对话框,清理随之
失效的 CSS;移动端删除 system/admin 页与入口,管理员专区只留数据中枢
- Tushare Token / iFinD 凭证编辑沿用数据源页既有凭证区,无功能缺失
模型池收起修复
- 拉出模型清单后按钮切换为「收起列表」,收起只留一行摘要;再次点击
重新拉取并展开;勾选添加完成后清单自动收起(原逻辑保留)
- 交互全部沿用 HEL-558 已确认样式的既有按钮与提示组件,未新增视觉
自测
- verify_baseline 通过;pytest 492 项通过;数据中枢 240 项通过
- verify_datahub_console 新增 [11b] 行情任务桥接端到端段;UI 自测新增
行情任务卡开关往返、模型清单展开/收起/再展开/添加自动收起,日夜主题
与 1030 窄屏复验通过
- Playwright e2e 102/103:唯一失败项在基线提交上同样失败(本机字体度量
导致的头部溢出,与本卡无关)
Co-authored-by: multica-agent <github@multica.ai>
92 lines
3.0 KiB
JavaScript
92 lines
3.0 KiB
JavaScript
async function initialize() {
|
|
syncThemeControl();
|
|
refreshIcons();
|
|
applicationShell.initialize();
|
|
elements.tradeDate.value = todayString();
|
|
const initialUrl = new URL(window.location.href);
|
|
if (initialUrl.searchParams.has("date")) {
|
|
initialUrl.searchParams.delete("date");
|
|
history.replaceState(null, "", initialUrl);
|
|
}
|
|
elements.tradeDate.max = todayString();
|
|
document.querySelector("#journalDate").value = elements.tradeDate.value;
|
|
document.querySelector("#journalDate").max = todayString();
|
|
document.querySelector("#tradeLogDate").value = elements.tradeDate.value;
|
|
document.querySelector("#tradeLogDate").max = todayString();
|
|
document.querySelector("#qiObservationDate").value = elements.tradeDate.value;
|
|
document.querySelector("#qiObservationDate").max = todayString();
|
|
document.querySelector("#accountBirthDate").max = todayString();
|
|
document.querySelector("#alertDate").value = todayString();
|
|
bindEvents();
|
|
try {
|
|
const session = await apiRequest("/api/auth/me");
|
|
if (!session.authenticated) {
|
|
const params = new URLSearchParams();
|
|
if (session.registration_required) params.set("mode", "register");
|
|
const query = params.toString();
|
|
window.location.replace("/login/" + (query ? `?${query}` : ""));
|
|
return;
|
|
}
|
|
await applyAuthenticatedSession(session);
|
|
} catch (error) {
|
|
showAuthGate(error.message || "无法连接本地服务");
|
|
}
|
|
}
|
|
|
|
async function startAuthenticatedApp() {
|
|
if (state.started) return;
|
|
state.started = true;
|
|
const searchParams = new URLSearchParams(window.location.search);
|
|
const requestedHeavenPanel = searchParams.get("heaven");
|
|
if (["trend", "fortune", "heart"].includes(requestedHeavenPanel)) {
|
|
state.heavenPanel = requestedHeavenPanel;
|
|
}
|
|
const requestedView = window.XiaobaiPages.resolve(searchParams.get("view"));
|
|
if (
|
|
requestedView
|
|
&& window.XiaobaiPages.has(requestedView)
|
|
&& document.getElementById(requestedView)?.classList.contains("workspace-view")
|
|
) {
|
|
openView(requestedView, false);
|
|
if (requestedView !== searchParams.get("view")) {
|
|
const url = new URL(window.location.href);
|
|
url.searchParams.set("view", requestedView);
|
|
history.replaceState(null, "", url);
|
|
}
|
|
}
|
|
loadDashboard();
|
|
loadAlerts();
|
|
if (new URLSearchParams(window.location.search).get("settings") === "1") {
|
|
setTimeout(openSettings, 0);
|
|
}
|
|
}
|
|
|
|
|
|
function openView(viewId, updateHash = true) {
|
|
if (!applicationShell.page(viewId) || !pageModules.has(viewId)) return;
|
|
const previousView = state.activeView;
|
|
pageModules.beforeMount(viewId, previousView);
|
|
if (!applicationShell.mount(viewId, { updateUrl: updateHash })) return;
|
|
pageModules.afterMount(viewId, previousView);
|
|
}
|
|
|
|
|
|
if (document.readyState === "loading") {
|
|
document.addEventListener("DOMContentLoaded", initialize, { once: true });
|
|
} else {
|
|
initialize();
|
|
}
|
|
|
|
|
|
|
|
|
|
function bindEvents() {
|
|
bindDashboardEvents();
|
|
bindSessionEvents();
|
|
bindMarketEvents();
|
|
bindThemeEvents();
|
|
pageModules.bind();
|
|
bindAdminEvents();
|
|
bindSharedTableEvents();
|
|
}
|