From d5ea2b4cf57517dbdadee0bfe30cfca4fcbf1989 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 23 Mar 2026 17:23:54 +0100 Subject: [PATCH] change: query node states explicitly in node view --- web/frontend/src/Node.root.svelte | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/web/frontend/src/Node.root.svelte b/web/frontend/src/Node.root.svelte index 35cfcca9..44628ba7 100644 --- a/web/frontend/src/Node.root.svelte +++ b/web/frontend/src/Node.root.svelte @@ -54,11 +54,16 @@ const paging = { itemsPerPage: 50, page: 1 }; const sorting = { field: "startTime", type: "col", order: "DESC" }; const nodeMetricsQuery = gql` - query ($cluster: String!, $nodes: [String!], $from: Time!, $to: Time!) { + query ( + $cluster: String!, + $nodes: [String!], + $from: Time!, + $to: Time!, + $nodeFilter: [NodeFilter!]!, + $sorting: OrderByInput! + ) { nodeMetrics(cluster: $cluster, nodes: $nodes, from: $from, to: $to) { host - nodeState - metricHealth subCluster metrics { name @@ -79,7 +84,14 @@ } } } - } + }, + nodeStatus: nodes(filter: $nodeFilter, order: $sorting) { + count + items { + schedulerState + healthState + } + } } `; const nodeJobsQuery = gql` @@ -146,6 +158,8 @@ nodes: [hostname], from: from?.toISOString(), to: to?.toISOString(), + nodeFilter: { hostname: { eq: hostname }}, + sorting // $sorting unused in backend: Use placeholder }, }) ); @@ -157,8 +171,8 @@ }) ); - const thisNodeState = $derived($nodeMetricsData?.data?.nodeMetrics[0]?.nodeState || 'notindb'); - const thisMetricHealth = $derived($nodeMetricsData?.data?.nodeMetrics[0]?.metricHealth || 'unknown'); + const thisNodeState = $derived($nodeMetricsData?.data?.nodeStatus?.items[0]?.schedulerState || 'notindb'); + const thisMetricHealth = $derived($nodeMetricsData?.data?.nodeStatus?.items[0]?.healthState || 'unknown');