/* index page: 小说列表 dashboard. */ import { escapeHtml, fetchJson } from "../utils.js"; import { statusBadge } from "../components/status-badge.js"; function renderCard(n) { const target = n.target_words || 0; const current = n.current_words || 0; const pct = target > 0 ? Math.min(100, Math.round((current / target) * 100)) : 0; return '' + '
' + ' ' + escapeHtml(n.genre || "未分类") + ' ' + statusBadge(n.status) + '
' + '' + escapeHtml(n.style || "") + '
' + '' + current + ' / ' + target + ' 字
' + ' 打开' + '