()
| 96 | } |
| 97 | |
| 98 | function renderRuns() { |
| 99 | const body = document.getElementById('selfcheck-runs-body'); |
| 100 | if (!body) return; |
| 101 | const rows = selfcheckState.runs || []; |
| 102 | if (!rows.length) { |
| 103 | body.innerHTML = '<tr><td colspan="9"><div class="empty-state">暂无运行记录</div></td></tr>'; |
| 104 | return; |
| 105 | } |
| 106 | |
| 107 | body.innerHTML = rows.map((run) => { |
| 108 | const isSelected = Number(run.id) === Number(selfcheckState.selectedRunId); |
| 109 | return ` |
| 110 | <tr data-run-id="${run.id}" class="${isSelected ? 'run-row-active' : ''}"> |
| 111 | <td>#${run.id}</td> |
| 112 | <td>${escapeHtml(run.mode || '-')}</td> |
| 113 | <td>${escapeHtml(run.source || '-')}</td> |
| 114 | <td>${statusBadge(run.status)}</td> |
| 115 | <td>${Number(run.score || 0)}</td> |
| 116 | <td>${Number(run.total_checks || 0)}</td> |
| 117 | <td>${escapeHtml(run.started_at ? format.date(run.started_at) : '-')}</td> |
| 118 | <td>${escapeHtml(run.finished_at ? format.date(run.finished_at) : '-')}</td> |
| 119 | <td>${escapeHtml(run.summary || '-')}</td> |
| 120 | </tr> |
| 121 | `; |
| 122 | }).join(''); |
| 123 | } |
| 124 | |
| 125 | function renderRepairResults(repairs) { |
| 126 | const container = document.getElementById('selfcheck-repair-results'); |
no test coverage detected