weed admin UI dynamically show columns (#6939)

* show counts for rack and disk type

* dynamically display columns if more than one value

* adjust ui
This commit is contained in:
Chris Lu
2025-07-02 21:49:37 -07:00
committed by GitHub
parent ac82dd7c07
commit 080dce80eb
6 changed files with 696 additions and 507 deletions

View File

@@ -698,22 +698,20 @@ function exportCollections() {
return;
}
const headers = ['Collection Name', 'Data Center', 'Volumes', 'Files', 'Size', 'Disk Types', 'Status'];
const headers = ['Collection Name', 'Volumes', 'Files', 'Size', 'Disk Types'];
const rows = [];
// Get table rows
const tableRows = table.querySelectorAll('tbody tr');
tableRows.forEach(row => {
const cells = row.querySelectorAll('td');
if (cells.length >= 7) {
if (cells.length >= 5) {
rows.push([
cells[0].textContent.trim(),
cells[1].textContent.trim(),
cells[2].textContent.trim(),
cells[3].textContent.trim(),
cells[4].textContent.trim(),
formatDiskTypes(cells[5].textContent.trim()),
cells[6].textContent.trim()
formatDiskTypes(cells[4].textContent.trim())
]);
}
});