mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-24 00:27:29 +01:00
change: query node states explicitly in node view
This commit is contained in:
@@ -54,11 +54,16 @@
|
|||||||
const paging = { itemsPerPage: 50, page: 1 };
|
const paging = { itemsPerPage: 50, page: 1 };
|
||||||
const sorting = { field: "startTime", type: "col", order: "DESC" };
|
const sorting = { field: "startTime", type: "col", order: "DESC" };
|
||||||
const nodeMetricsQuery = gql`
|
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) {
|
nodeMetrics(cluster: $cluster, nodes: $nodes, from: $from, to: $to) {
|
||||||
host
|
host
|
||||||
nodeState
|
|
||||||
metricHealth
|
|
||||||
subCluster
|
subCluster
|
||||||
metrics {
|
metrics {
|
||||||
name
|
name
|
||||||
@@ -79,7 +84,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
nodeStatus: nodes(filter: $nodeFilter, order: $sorting) {
|
||||||
|
count
|
||||||
|
items {
|
||||||
|
schedulerState
|
||||||
|
healthState
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
const nodeJobsQuery = gql`
|
const nodeJobsQuery = gql`
|
||||||
@@ -146,6 +158,8 @@
|
|||||||
nodes: [hostname],
|
nodes: [hostname],
|
||||||
from: from?.toISOString(),
|
from: from?.toISOString(),
|
||||||
to: to?.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 thisNodeState = $derived($nodeMetricsData?.data?.nodeStatus?.items[0]?.schedulerState || 'notindb');
|
||||||
const thisMetricHealth = $derived($nodeMetricsData?.data?.nodeMetrics[0]?.metricHealth || 'unknown');
|
const thisMetricHealth = $derived($nodeMetricsData?.data?.nodeStatus?.items[0]?.healthState || 'unknown');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Row cols={{ xs: 2, lg: 3}}>
|
<Row cols={{ xs: 2, lg: 3}}>
|
||||||
|
|||||||
Reference in New Issue
Block a user