feat: add verdict/evidence verification model
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
<option value="all">Alle</option>
|
||||
<option value="pending">Pending</option>
|
||||
<option value="confirmed">Confirmed</option>
|
||||
<option value="rejected">Rejected</option>
|
||||
<option value="errors">Errors</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -130,6 +131,7 @@ async function loadCards() {
|
||||
if (state.search) url += `&search=${encodeURIComponent(state.search)}`;
|
||||
if (state.filter === 'confirmed') url += '&confirmed=1';
|
||||
if (state.filter === 'pending') url += '&confirmed=0';
|
||||
if (state.filter === 'rejected') url += '&verdict=confirmed_false';
|
||||
if (state.filter === 'errors') url += '&tag=error';
|
||||
|
||||
const data = await api(url);
|
||||
@@ -347,6 +349,7 @@ function renderCards() {
|
||||
<div class="card ${item.confirmed ? 'confirmed' : ''} ${item.rejections > 0 ? 'rejected' : ''}" data-id="${item.id}">
|
||||
<div class="card-header">
|
||||
<span class="conf-badge" style="background:hsl(${item.confidence*120},70%,40%)">${Math.round(item.confidence*100)}%</span>
|
||||
${renderVerdictPill(item)}
|
||||
<span class="tags">${item.tags.map(t => '<span class="tag">'+t+'</span>').join('')}</span>
|
||||
<span class="date">${fmtDate(item.created)}</span>
|
||||
</div>
|
||||
@@ -365,6 +368,19 @@ function renderCards() {
|
||||
`).join('');
|
||||
}
|
||||
|
||||
function renderVerdictPill(item) {
|
||||
const v = (item.verdict || '').toString();
|
||||
if (!v) return '';
|
||||
let cls = 'v-unknown';
|
||||
let label = v;
|
||||
if (v === 'confirmed_true') { cls = 'v-true'; label = 'TRUE'; }
|
||||
else if (v === 'confirmed_false') { cls = 'v-false'; label = 'FALSE'; }
|
||||
else if (v === 'probable_true') { cls = 'v-prob-true'; label = 'LIKELY'; }
|
||||
else if (v === 'probable_false') { cls = 'v-prob-false'; label = 'UNLIKELY'; }
|
||||
else if (v === 'unknown') { cls = 'v-unknown'; label = 'UNKNOWN'; }
|
||||
return `<span class="verdict-pill ${cls}">${label}</span>`;
|
||||
}
|
||||
|
||||
function fmtDate(iso) {
|
||||
const d = new Date(iso);
|
||||
return `${d.getDate().toString().padStart(2,'0')}.${(d.getMonth()+1).toString().padStart(2,'0')} ${d.getHours().toString().padStart(2,'0')}:${d.getMinutes().toString().padStart(2,'0')}`;
|
||||
|
||||
Reference in New Issue
Block a user