mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 12:59:06 +01:00
fix: prevent addition of existing scopes to table
This commit is contained in:
parent
4b1b34d8a7
commit
193bee5ac8
@ -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(),
|
||||
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user