fix error on metric selection change if continuous

This commit is contained in:
Christoph Kluge 2025-01-13 11:13:06 +01:00
parent e55798944e
commit 91e73450cf

View File

@ -161,6 +161,12 @@
}
}
$: if (!usePaging && selectedMetrics) {
// Continous Scroll: Reset list and paging if sleectedMetrics change: Existing entries will not match new metric selection
nodes = [];
paging = { itemsPerPage, page: 1 };
}
$: matchedNodes = $nodesQuery.data?.nodeMetricsList.totalNodes || matchedNodes;
</script>
@ -208,7 +214,13 @@
<tr>
<td colspan={selectedMetrics.length + 1}>
<div style="text-align:center;">
<p><b>Loading nodes {nodes.length + 1} to {nodes.length + paging.itemsPerPage} {matchedNodes ? `of ${matchedNodes} total` : ``}</b></p>
<p><b>
Loading nodes {nodes.length + 1} to
{ matchedNodes
? `${(nodes.length + paging.itemsPerPage) > matchedNodes ? matchedNodes : (nodes.length + paging.itemsPerPage)} of ${matchedNodes} total`
: (nodes.length + paging.itemsPerPage)
}
</b></p>
<Spinner secondary />
</div>
</td>