Improve redraw speed of build allocation table (#3831)

- Reload table data in one go, rather than one row at a time
- Reduces redraw time (in one example) from ~4s to ~0.05s
This commit is contained in:
Oliver 2022-10-22 14:16:55 +11:00 committed by GitHub
parent 0fd1390fe0
commit 9d39d5b00f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1471,13 +1471,16 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
// How many rows are fully allocated?
var allocated_rows = 0;
bom_items.forEach(function(row) {
$(table).bootstrapTable('updateByUniqueId', row.pk, row, true);
for (var idx = 0; idx < bom_items.length; idx++) {
var row = bom_items[idx];
if (isRowFullyAllocated(row)) {
allocated_rows += 1;
allocated_rows++;
}
});
}
// Reload table data
$(table).bootstrapTable('load', bom_items);
// Find the top-level progess bar for this build output
var output_progress_bar = $(`#output-progress-${outputId}`);