diff --git a/web/frontend/src/Analysis.root.svelte b/web/frontend/src/Analysis.root.svelte index 83c6754..0237174 100644 --- a/web/frontend/src/Analysis.root.svelte +++ b/web/frontend/src/Analysis.root.svelte @@ -562,8 +562,19 @@ + {#snippet histoGridContent(item)} + + {/snippet} + ({ metric, ...binsFromFootprint( @@ -576,17 +587,8 @@ ), }))} itemsPerRow={ccconfig.plot_view_plotsPerRow} - > - - + gridContent={histoGridContent} + />
@@ -604,9 +606,19 @@ + {#snippet metricsGridContent(item)} + + {/snippet} + ({ m1, f1: $footprintsQuery.data.footprints.metrics.find( @@ -618,18 +630,8 @@ ).data, }))} itemsPerRow={ccconfig.plot_view_plotsPerRow} - > - - + gridContent={metricsGridContent} + /> {/if} diff --git a/web/frontend/src/Job.root.svelte b/web/frontend/src/Job.root.svelte index fd49243..5ece4fc 100644 --- a/web/frontend/src/Job.root.svelte +++ b/web/frontend/src/Job.root.svelte @@ -170,7 +170,7 @@ return []; } }); - + const somethingMissing = $derived(missingMetrics?.length > 0 || missingHosts?.length > 0); /* Effects */ @@ -334,14 +334,8 @@ {:else if $initq?.data && $jobMetrics?.data?.jobMetrics} - + + {#snippet gridContent(item)} {#if item.data} {/if} - + {/snippet} + + {/if} diff --git a/web/frontend/src/Node.root.svelte b/web/frontend/src/Node.root.svelte index 62e4847..f4b1a2a 100644 --- a/web/frontend/src/Node.root.svelte +++ b/web/frontend/src/Node.root.svelte @@ -204,20 +204,7 @@ {:else if $nodeMetricsData.fetching || $initq.fetching} {:else} - ({ - ...m, - disabled: checkMetricDisabled( - m.name, - cluster, - $nodeMetricsData.data.nodeMetrics[0].subCluster, - ), - })) - .sort((a, b) => a.name.localeCompare(b.name))} - > + {#snippet gridContent(item)}

{item.name} {systemUnits[item.name] ? "(" + systemUnits[item.name] + ")" : ""} @@ -246,7 +233,22 @@ >No dataset returned for {item.name} {/if} - + {/snippet} + + ({ + ...m, + disabled: checkMetricDisabled( + m.name, + cluster, + $nodeMetricsData.data.nodeMetrics[0].subCluster, + ), + })) + .sort((a, b) => a.name.localeCompare(b.name))} + itemsPerRow={ccconfig.plot_view_plotsPerRow} + {gridContent} + /> {/if} diff --git a/web/frontend/src/Status.root.svelte b/web/frontend/src/Status.root.svelte index 613bd7f..d7ac25b 100644 --- a/web/frontend/src/Status.root.svelte +++ b/web/frontend/src/Status.root.svelte @@ -676,22 +676,24 @@ {#if selectedHistograms} + {#snippet gridContent(item)} + + {/snippet} + {#key $mainQuery.data.stats[0].histMetrics} - - + {gridContent} + /> {/key} {/if} {/if} diff --git a/web/frontend/src/User.root.svelte b/web/frontend/src/User.root.svelte index 965290e..df102cf 100644 --- a/web/frontend/src/User.root.svelte +++ b/web/frontend/src/User.root.svelte @@ -335,22 +335,24 @@ {:else}
+ {#snippet gridContent(item)} + + {/snippet} + {#key $stats.data.jobsStatistics[0].histMetrics} - - + {gridContent} + /> {/key} {/if} {:else} diff --git a/web/frontend/src/generic/PlotGrid.svelte b/web/frontend/src/generic/PlotGrid.svelte index b5cc30e..213041e 100644 --- a/web/frontend/src/generic/PlotGrid.svelte +++ b/web/frontend/src/generic/PlotGrid.svelte @@ -12,26 +12,19 @@ Col, } from "@sveltestrap/sveltestrap"; - export let itemsPerRow - export let items - - /* Migtation Notes - * Requirements - * - Parent Components must be already Migrated - * - TODO: Job.root.svelte, Node.root.svelte - * - DONE: Analysis, Status, User - * - * How-To - * - Define "Plot-Slotcode" as SV5 Snippet with argument "item" in parent (!) - * - Pass new snippet as argument/prop to here - * - @render snippet in items-loop with argument == item - */ + /* Svelte 5 Props */ + let { + items, + itemsPerRow, + gridContent + } = $props(); {#each items as item} - + + {@render gridContent(item)} {/each} diff --git a/web/frontend/src/generic/plots/Scatter.svelte b/web/frontend/src/generic/plots/Scatter.svelte index 514223b..76c1a17 100644 --- a/web/frontend/src/generic/plots/Scatter.svelte +++ b/web/frontend/src/generic/plots/Scatter.svelte @@ -182,6 +182,6 @@ -
- +
+