mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 13:29:05 +01:00
fix: add additionally loaded scopes to statsTable again
This commit is contained in:
parent
01845a0cb7
commit
95fe369648
@ -348,6 +348,7 @@
|
|||||||
{#if item.data}
|
{#if item.data}
|
||||||
<Metric
|
<Metric
|
||||||
bind:this={plots[item.metric]}
|
bind:this={plots[item.metric]}
|
||||||
|
on:more-loaded={({ detail }) => statsTable.moreLoaded(detail)}
|
||||||
job={$initq.data.job}
|
job={$initq.data.job}
|
||||||
metricName={item.metric}
|
metricName={item.metric}
|
||||||
metricUnit={$initq.data.globalMetrics.find((gm) => gm.name == item.metric)?.unit}
|
metricUnit={$initq.data.globalMetrics.find((gm) => gm.name == item.metric)?.unit}
|
||||||
|
@ -13,6 +13,9 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
createEventDispatcher
|
||||||
|
} from "svelte";
|
||||||
import {
|
import {
|
||||||
queryStore,
|
queryStore,
|
||||||
gql,
|
gql,
|
||||||
@ -46,6 +49,7 @@
|
|||||||
let patternMatches = false;
|
let patternMatches = false;
|
||||||
let statsSeries = rawData.map((data) => data?.statisticsSeries ? data.statisticsSeries : null);
|
let statsSeries = rawData.map((data) => data?.statisticsSeries ? data.statisticsSeries : null);
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher();
|
||||||
const statsPattern = /(.*)-stat$/;
|
const statsPattern = /(.*)-stat$/;
|
||||||
const unit = (metricUnit?.prefix ? metricUnit.prefix : "") + (metricUnit?.base ? metricUnit.base : "");
|
const unit = (metricUnit?.prefix ? metricUnit.prefix : "") + (metricUnit?.base ? metricUnit.base : "");
|
||||||
const resolutions = [600, 240, 60] // DEV: Make configable
|
const resolutions = [600, 240, 60] // DEV: Make configable
|
||||||
@ -117,13 +121,18 @@
|
|||||||
|
|
||||||
rawData = $metricData.data.singleUpdate.map((x) => x.metric)
|
rawData = $metricData.data.singleUpdate.map((x) => x.metric)
|
||||||
scopes = $metricData.data.singleUpdate.map((x) => x.scope)
|
scopes = $metricData.data.singleUpdate.map((x) => x.scope)
|
||||||
statsSeries = rawData.map((data) => data?.statisticsSeries ? data.statisticsSeries : null)
|
statsSeries = rawData.map((data) => data?.statisticsSeries ? data.statisticsSeries : null)
|
||||||
|
|
||||||
// Set selected scope to min of returned scopes
|
// Set selected scope to min of returned scopes
|
||||||
if (selectedScope == "load-all") {
|
if (selectedScope == "load-all") {
|
||||||
selectedScope = minScope(scopes)
|
selectedScope = minScope(scopes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const statsTableData = $metricData.data.singleUpdate.filter((x) => x.scope !== "node")
|
||||||
|
if (statsTableData.length > 0) {
|
||||||
|
dispatch("more-loaded", statsTableData);
|
||||||
|
}
|
||||||
|
|
||||||
patternMatches = statsPattern.exec(selectedScope)
|
patternMatches = statsPattern.exec(selectedScope)
|
||||||
|
|
||||||
if (!patternMatches) {
|
if (!patternMatches) {
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
Properties:
|
Properties:
|
||||||
- `job Object`: The job object
|
- `job Object`: The job object
|
||||||
- `jobMetrics [Object]`: The jobs metricdata
|
- `jobMetrics [Object]`: The jobs metricdata
|
||||||
|
|
||||||
|
Exported:
|
||||||
|
- `moreLoaded`: Adds additional scopes requested from Metric.svelte in Job-View
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -82,6 +85,10 @@
|
|||||||
return s.dir != "up" ? s1[stat] - s2[stat] : s2[stat] - s1[stat];
|
return s.dir != "up" ? s1[stat] - s2[stat] : s2[stat] - s1[stat];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function moreLoaded(moreJobMetrics) {
|
||||||
|
jobMetrics = [...jobMetrics, ...moreJobMetrics]
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Table>
|
<Table>
|
||||||
|
Loading…
Reference in New Issue
Block a user