From 69519ec0401ce134a4b98e44ffeb6842683eba70 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 28 Aug 2023 10:19:26 +0200 Subject: [PATCH] Add requireField cases to resolver --- internal/graph/schema.resolvers.go | 3 ++- web/frontend/src/Analysis.root.svelte | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/graph/schema.resolvers.go b/internal/graph/schema.resolvers.go index 83aec04..684783a 100644 --- a/internal/graph/schema.resolvers.go +++ b/internal/graph/schema.resolvers.go @@ -248,7 +248,8 @@ func (r *queryResolver) JobsStatistics(ctx context.Context, filter []*model.JobF var err error var stats []*model.JobsStatistics - if requireField(ctx, "totalJobs") { + if requireField(ctx, "totalJobs") || requireField(ctx, "totalNodes") || requireField(ctx, "totalCores") || requireField(ctx, "totalAccs") || + requireField(ctx, "totalNodeHours") || requireField(ctx, "totalCoreHours") || requireField(ctx, "totalAccHours") { if groupBy == nil { stats, err = r.Repo.JobsStats(ctx, filter) } else { diff --git a/web/frontend/src/Analysis.root.svelte b/web/frontend/src/Analysis.root.svelte index 76e1813..88c3a32 100644 --- a/web/frontend/src/Analysis.root.svelte +++ b/web/frontend/src/Analysis.root.svelte @@ -77,7 +77,7 @@ client: client, query: gql` query($jobFilters: [JobFilter!]!, $paging: PageRequest!) { - jobsStatistics(filter: $jobFilters, page: $paging, sortBy: COREHOURS, groupBy: USER) { + topUser: jobsStatistics(filter: $jobFilters, page: $paging, sortBy: COREHOURS, groupBy: USER) { id totalCoreHours } @@ -177,8 +177,8 @@ tu.totalCoreHours)} - entities={$topQuery.data.jobsStatistics.map((tu) => tu.id)} + quantities={$topQuery.data.topUser.map((tu) => tu.totalCoreHours)} + entities={$topQuery.data.topUser.map((tu) => tu.id)} /> {/key} @@ -186,7 +186,7 @@ - {#each $topQuery.data.jobsStatistics as { id, totalCoreHours }, i} + {#each $topQuery.data.topUser as { id, totalCoreHours }, i}
LegendUser NameCore Hours
{id}