Skip to content

Commit

Permalink
fix: prevent addition of existing scopes to table
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehamster87 committed Sep 3, 2024
1 parent 4b1b34d commit 193bee5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web/frontend/src/job/StatsTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
export let job;
export let jobMetrics;
const allMetrics = [...new Set(jobMetrics.map((m) => m.name))].sort(),
scopesForMetric = (metric) =>
const allMetrics = [...new Set(jobMetrics.map((m) => m.name))].sort()
const scopesForMetric = (metric) =>
jobMetrics.filter((jm) => jm.name == metric).map((jm) => jm.scope);
let hosts = job.resources.map((r) => r.hostname).sort(),
Expand Down Expand Up @@ -87,8 +87,12 @@
}
export function moreLoaded(moreJobMetrics) {
jobMetrics = [...jobMetrics, ...moreJobMetrics]
}
moreJobMetrics.forEach(function (newMetric) {
if (!jobMetrics.some((m) => m.scope == newMetric.scope)) {
jobMetrics = [...jobMetrics, newMetric]
}
});
};
</script>
<Table>
Expand Down

0 comments on commit 193bee5

Please sign in to comment.