From 96e4448505ed0cc959c92c3ea407723e73c6c259 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Fri, 12 May 2023 11:19:37 +0200 Subject: [PATCH] Format cleanup --- web/frontend/src/Analysis.root.svelte | 54 +++++++++++++-------------- web/frontend/src/List.root.svelte | 26 ++++++------- web/frontend/src/Status.root.svelte | 3 +- web/frontend/src/Systems.root.svelte | 40 ++++++++++---------- web/frontend/src/User.root.svelte | 23 ++++++------ web/frontend/src/joblist/Row.svelte | 12 +++--- 6 files changed, 80 insertions(+), 78 deletions(-) diff --git a/web/frontend/src/Analysis.root.svelte b/web/frontend/src/Analysis.root.svelte index d7f5895..59492fc 100644 --- a/web/frontend/src/Analysis.root.svelte +++ b/web/frontend/src/Analysis.root.svelte @@ -54,44 +54,44 @@ $: statsQuery = queryStore({ client: client, query: gql` - query($filters: [JobFilter!]!) { - stats: jobsStatistics(filter: $filters) { - totalJobs - shortJobs - totalWalltime - totalCoreHours - histDuration { count, value } - histNumNodes { count, value } - } + query($filters: [JobFilter!]!) { + stats: jobsStatistics(filter: $filters) { + totalJobs + shortJobs + totalWalltime + totalCoreHours + histDuration { count, value } + histNumNodes { count, value } + } - topUsers: jobsCount(filter: $filters, groupBy: USER, weight: NODE_HOURS, limit: 5) { name, count } - } - `, - variables: { filters } + topUsers: jobsCount(filter: $filters, groupBy: USER, weight: NODE_HOURS, limit: 5) { name, count } + } + `, + variables: { filters } }) $: footprintsQuery = queryStore({ client: client, query: gql` - query($filters: [JobFilter!]!, $metrics: [String!]!) { - footprints: jobsFootprints(filter: $filters, metrics: $metrics) { - nodehours, - metrics { metric, data } - } - }`, - variables: { filters, metrics } + query($filters: [JobFilter!]!, $metrics: [String!]!) { + footprints: jobsFootprints(filter: $filters, metrics: $metrics) { + nodehours, + metrics { metric, data } + } + }`, + variables: { filters, metrics } }) $: rooflineQuery = queryStore({ client: client, query: gql` - query($filters: [JobFilter!]!, $rows: Int!, $cols: Int!, - $minX: Float!, $minY: Float!, $maxX: Float!, $maxY: Float!) { - rooflineHeatmap(filter: $filters, rows: $rows, cols: $cols, - minX: $minX, minY: $minY, maxX: $maxX, maxY: $maxY) - } - `, - variables: { filters, rows: 50, cols: 50, minX: 0.01, minY: 1., maxX: 1000., maxY }, + query($filters: [JobFilter!]!, $rows: Int!, $cols: Int!, + $minX: Float!, $minY: Float!, $maxX: Float!, $maxY: Float!) { + rooflineHeatmap(filter: $filters, rows: $rows, cols: $cols, + minX: $minX, minY: $minY, maxX: $maxX, maxY: $maxY) + } + `, + variables: { filters, rows: 50, cols: 50, minX: 0.01, minY: 1., maxX: 1000., maxY } }) onMount(() => filters.update()) diff --git a/web/frontend/src/List.root.svelte b/web/frontend/src/List.root.svelte index fb11c0e..371c743 100644 --- a/web/frontend/src/List.root.svelte +++ b/web/frontend/src/List.root.svelte @@ -30,21 +30,19 @@ ); const client = getContextClient(); - const query = gql` - query($filters: [JobFilter!]!) { - rows: jobsStatistics(filter: $filters, groupBy: ${type}) { - id - name - totalJobs - totalWalltime - totalCoreHours - } - }` - $: stats = queryStore({ - client, - query, - variables: { filters }, + client: client, + query: gql` + query($filters: [JobFilter!]!) { + rows: jobsStatistics(filter: $filters, groupBy: ${type}) { + id + name + totalJobs + totalWalltime + totalCoreHours + } + }`, + variables: { filters } }); let filters; diff --git a/web/frontend/src/Status.root.svelte b/web/frontend/src/Status.root.svelte index 7e9d7fb..519b95e 100644 --- a/web/frontend/src/Status.root.svelte +++ b/web/frontend/src/Status.root.svelte @@ -13,8 +13,9 @@ let plotWidths = [], colWidth1 = 0, colWidth2 let from = new Date(Date.now() - 5 * 60 * 1000), to = new Date(Date.now()) + const client = getContextClient(); $: mainQuery = queryStore({ - client: getContextClient(), + client: client, query: gql`query($cluster: String!, $filter: [JobFilter!]!, $metrics: [String!], $from: Time!, $to: Time!) { nodeMetrics(cluster: $cluster, metrics: $metrics, from: $from, to: $to) { host diff --git a/web/frontend/src/Systems.root.svelte b/web/frontend/src/Systems.root.svelte index f76a60a..ed24928 100644 --- a/web/frontend/src/Systems.root.svelte +++ b/web/frontend/src/Systems.root.svelte @@ -27,31 +27,33 @@ let hostnameFilter = '' let selectedMetric = ccconfig.system_view_selectedMetric + const client = getContextClient(); $: nodesQuery = queryStore({ - client: getContextClient(), + client: client, query: gql`query($cluster: String!, $metrics: [String!], $from: Time!, $to: Time!) { - nodeMetrics(cluster: $cluster, metrics: $metrics, from: $from, to: $to) { - host - subCluster - metrics { - name - scope - metric { - timestep - unit { base, prefix } - series { - statistics { min, avg, max } - data + nodeMetrics(cluster: $cluster, metrics: $metrics, from: $from, to: $to) { + host + subCluster + metrics { + name + scope + metric { + timestep + unit { base, prefix } + series { + statistics { min, avg, max } + data + } } } } + }`, + variables: { + cluster: cluster, + metrics: [selectedMetric], + from: from.toISOString(), + to: to.toISOString() } - }`, - variables: { - cluster: cluster, - metrics: [selectedMetric], - from: from.toISOString(), - to: to.toISOString()} }) let metricUnits = {} diff --git a/web/frontend/src/User.root.svelte b/web/frontend/src/User.root.svelte index 1ab86b7..7aa6317 100644 --- a/web/frontend/src/User.root.svelte +++ b/web/frontend/src/User.root.svelte @@ -25,19 +25,20 @@ let w1, w2, histogramHeight = 250 let selectedCluster = filterPresets?.cluster ? filterPresets.cluster : null + const client = getContextClient(); $: stats = queryStore({ - client: getContextClient(), + client: client, query: gql` - query($filters: [JobFilter!]!) { - jobsStatistics(filter: $filters) { - totalJobs - shortJobs - totalWalltime - totalCoreHours - histDuration { count, value } - histNumNodes { count, value } - }}`, - variables: { filters }, + query($filters: [JobFilter!]!) { + jobsStatistics(filter: $filters) { + totalJobs + shortJobs + totalWalltime + totalCoreHours + histDuration { count, value } + histNumNodes { count, value } + }}`, + variables: { filters } }) $: selectedCluster = filters[0]?.cluster ? filters[0].cluster.eq : null diff --git a/web/frontend/src/joblist/Row.svelte b/web/frontend/src/joblist/Row.svelte index d841eb9..e7ae579 100644 --- a/web/frontend/src/joblist/Row.svelte +++ b/web/frontend/src/joblist/Row.svelte @@ -59,16 +59,16 @@ `; $: metricsQuery = queryStore({ - client, - query, - variables: { id, metrics, scopes }, + client: client, + query: query, + variables: { id, metrics, scopes } }); function refresh() { queryStore({ - client, - query, - variables: { id, metrics, scopes }, + client: client, + query: query, + variables: { id, metrics, scopes } }); }