feat(ui): add full table CSV download on database stats card
Each table row in the stats card now has a download button that exports the entire table as CSV with proper column headers, generated server-side. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -527,17 +527,22 @@ function loadDbStats() {
|
||||
html += '<th data-i18n="database.statsCount">Entrées</th>';
|
||||
html += '<th data-i18n="database.statsOldest">Plus ancienne</th>';
|
||||
html += '<th data-i18n="database.statsNewest">Plus récente</th>';
|
||||
html += '<th data-i18n="database.statsDownload">CSV</th>';
|
||||
html += '</tr></thead><tbody>';
|
||||
|
||||
response.tables.forEach(function(t) {
|
||||
const displayName = tableDisplayNames[t.name] || t.name;
|
||||
const oldest = t.oldest ? t.oldest.substring(0, 16) : '-';
|
||||
const newest = t.newest ? t.newest.substring(0, 16) : '-';
|
||||
const downloadBtn = t.count > 0
|
||||
? '<a href="launcher.php?type=download_full_table&table=' + t.name + '" class="btn btn-outline-primary btn-sm py-0 px-1" title="Download CSV"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 16 16"><path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/><path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/></svg></a>'
|
||||
: '-';
|
||||
html += '<tr>';
|
||||
html += '<td>' + displayName + '</td>';
|
||||
html += '<td>' + t.count.toLocaleString() + '</td>';
|
||||
html += '<td><small>' + oldest + '</small></td>';
|
||||
html += '<td><small>' + newest + '</small></td>';
|
||||
html += '<td class="text-center">' + downloadBtn + '</td>';
|
||||
html += '</tr>';
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user