Skip to content

Commit 8fde320

Browse files
committed
Feature: Add confidence scores to Reports export
Enhanced the Rapports d'Opérations tab with detailed confidence metrics: Backend (app.py line 272): - Added AVG(similarity) to attendance report SQL query Frontend updates: - dashboard.html: Added "Confiance" column header to report table - dashboard.js generateReport(): Display confidence as percentage (e.g., "92.3%") - dashboard.js exportReport(): Include avg_similarity in CSV export Reports now show complete details: ✅ Bataillon (department) ✅ Compagnie (sub_department) ✅ Confiance score (avg_similarity as %) ✅ Statut d'autorisation (is_authorized) Addresses user request for "confidence score for each entry" in reports.
1 parent 75c4ab3 commit 8fde320

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

dashboard-service/src/static/js/dashboard.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ async function generateReport() {
574574
<td>${formatTime(record.first_entry)}</td>
575575
<td>${formatTime(record.last_entry)}</td>
576576
<td>${record.entries_count}</td>
577+
<td><strong>${record.avg_similarity ? (record.avg_similarity * 100).toFixed(1) + '%' : '-'}</strong></td>
577578
<td>${statusBadge}</td>
578579
</tr>
579580
`;
@@ -588,7 +589,7 @@ async function generateReport() {
588589

589590
} catch (error) {
590591
console.error('Error generating report:', error);
591-
tableBody.innerHTML = '<tr><td colspan="8" class="empty">Erreur lors de la génération du rapport</td></tr>';
592+
tableBody.innerHTML = '<tr><td colspan="9" class="empty">Erreur lors de la génération du rapport</td></tr>';
592593
}
593594
}
594595

@@ -621,7 +622,7 @@ function exportReport() {
621622
.then(data => {
622623
const csv = convertToCSV(data, [
623624
'date', 'subject_name', 'department', 'sub_department',
624-
'first_entry', 'last_entry', 'entries_count', 'is_authorized'
625+
'first_entry', 'last_entry', 'entries_count', 'avg_similarity', 'is_authorized'
625626
]);
626627
downloadCSV(csv, `rapport_1bip_${startDate}_to_${endDate}.csv`);
627628
})

dashboard-service/src/templates/dashboard.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ <h3>Rapport de Présence et Activité</h3>
439439
<th>Première Entrée</th>
440440
<th>Dernière Entrée</th>
441441
<th>Nb Entrées</th>
442+
<th>Confiance</th>
442443
<th>Statut</th>
443444
</tr>
444445
</thead>

0 commit comments

Comments
 (0)