From a9868fd275791f49ff169b3bf0952a334daf2b77 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 30 Sep 2024 16:43:38 +0200 Subject: [PATCH] display energySumary only if energy data is present --- web/frontend/src/Job.root.svelte | 4 +-- web/frontend/src/job/EnergySummary.svelte | 30 +++++++++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/web/frontend/src/Job.root.svelte b/web/frontend/src/Job.root.svelte index 899d5af..9601e9c 100644 --- a/web/frontend/src/Job.root.svelte +++ b/web/frontend/src/Job.root.svelte @@ -310,10 +310,10 @@ -{#if $initq?.data} +{#if $initq?.data && $initq.data.job.energyFootprint.length != 0} - + {/if} diff --git a/web/frontend/src/job/EnergySummary.svelte b/web/frontend/src/job/EnergySummary.svelte index e614865..099cb57 100644 --- a/web/frontend/src/job/EnergySummary.svelte +++ b/web/frontend/src/job/EnergySummary.svelte @@ -1,8 +1,10 @@ - {#each job.energyFootprint as efp} - + {#each jobEnergyFootprint as efp} +
{#if efp.hardware === 'CPU'} @@ -53,20 +57,20 @@
{efp.hardware}: {efp.value} Wh ({efp.metric})
Estimated energy consumption based on metric {efp.metric} and job runtime. {/each} - +

-
Total Energy: {job?.energy? job.energy : 0} Wh
+
Total Energy: {jobEnergy? jobEnergy : 0} Wh
{#if carbonPerkWh} - +
@@ -79,14 +83,14 @@ Estimated total energy consumption of job. {#if carbonPerkWh} Estimated emission based on supplier energy mix ({carbonPerkWh} g/kWh) and total energy consumption.