function renderStats(stats) { const container = document.getElementById('stats-container'); if (!container) return; container.innerHTML = `
活跃开发者
${stats.activeDevs}
总人数 ${stats.totalDevs}
总代码量
${formatNumber(stats.totalCodeLines)}
行代码
模块进度
${stats.modulesCompleted}/${stats.totalModules}
✅ ${stats.modulesCompleted} / ⚡ ${stats.modulesInProgress} / ⏳ ${stats.modulesPending}
最高连胜
${stats.topStreak.count}
${stats.topStreak.name} ${getStreakEmoji(stats.topStreak.count)}
`; } function renderDevCards(developers) { const container = document.getElementById('devgrid-container'); if (!container) return; const sorted = [...developers].sort((a, b) => b.streak - a.streak); let html = '
'; sorted.forEach(dev => { const pcaColor = getPCAColor(dev.totalScore); html += `
${dev.name[0]}
${dev.name}
${dev.id}
📁 ${dev.module}
${dev.streak}连胜
EL-${dev.el} ${pcaColor.level} · ${dev.totalScore}
`; }); html += '
'; container.innerHTML = html; } async function initBoard() { const devs = await getDevStatus(); const stats = await getAllStats(); renderStats(stats); renderDevCards(devs); } window.initBoard = initBoard;