feat: F健康三层改造step3——自检体系加三层架构健康卡片(采集/加工/使用各层数据新鲜度+覆盖+任务状态)
This commit is contained in:
@@ -84,6 +84,37 @@ function renderSelfCheck(sc) {
|
||||
let html = '';
|
||||
const icon = s => s === 'ok' ? '✅' : s === 'warn' ? '🟡' : s === 'fail' ? '❌' : '⏭';
|
||||
|
||||
// 2026-08-12 三层架构健康(采集/加工/使用三层各自健康,老莫定)
|
||||
if (sc.layers_health) {
|
||||
const lh = sc.layers_health;
|
||||
const tasks = lh.tasks || {};
|
||||
const layerMeta = [
|
||||
['collect', '📥 数据采集层', '#3fb950', lh.collect || {}],
|
||||
['process', '⚙️ 数据加工层', '#d29922', lh.process || {}],
|
||||
['use', '📊 数据使用层', '#58a6ff', lh.use || {}],
|
||||
];
|
||||
html += `<div style="background:#161b22;border:1px solid #58a6ff;border-radius:6px;padding:10px;margin-bottom:10px">`;
|
||||
html += `<div style="font-weight:bold;color:#58a6ff;margin-bottom:6px">🏗️ 三层架构健康(采集→加工→使用)</div>`;
|
||||
layerMeta.forEach(([layer, title, color, data]) => {
|
||||
const t = tasks[layer] || {ok:0, error:0, total:0};
|
||||
const tstatus = t.error > 0 ? '❌' : t.ok === t.total ? '✅' : '🟡';
|
||||
html += `<div style="margin:6px 0;padding:8px;background:#0d1117;border-left:3px solid ${color};border-radius:4px">`;
|
||||
html += `<strong style="color:${color}">${title}</strong> <span style="font-size:11px;color:#8b949e">任务 ${tstatus} ✅${t.ok} ❌${t.error} 共${t.total}</span>`;
|
||||
html += '<table style="margin-top:4px"><thead><tr><th>数据</th><th>最新</th><th>覆盖/数量</th></tr></thead><tbody>';
|
||||
Object.entries(data).forEach(([k, v]) => {
|
||||
if (k === 'candidates' || k === 'active_strategies') return;
|
||||
const latest = (v.latest || '无').toString().slice(0, 16);
|
||||
const cnt = v.count !== undefined ? v.count : (typeof v === 'number' ? v : '-');
|
||||
html += `<tr><td style="font-size:11px">${k}</td><td style="font-size:11px;color:#8b949e">${latest}</td><td style="font-size:11px">${cnt}</td></tr>`;
|
||||
});
|
||||
if (layer === 'use' && data.candidates) {
|
||||
html += `<tr><td style="font-size:11px">candidates</td><td style="font-size:11px;color:#8b949e">${(data.candidates.latest||'').toString().slice(0,16)}</td><td style="font-size:11px">${data.candidates.count}(持仓策略${data.active_strategies||0})</td></tr>`;
|
||||
}
|
||||
html += '</tbody></table></div>';
|
||||
});
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
// L4 元监控(自检系统的自检)
|
||||
if (sc.meta_watchdog) {
|
||||
const mw = sc.meta_watchdog;
|
||||
|
||||
Reference in New Issue
Block a user