mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-11-20 08:47:22 +01:00
fix old gql field name
This commit is contained in:
@@ -276,13 +276,13 @@
|
|||||||
// Nodes: Color based on Idle vs. Allocated
|
// Nodes: Color based on Idle vs. Allocated
|
||||||
} else if (nodesData) {
|
} else if (nodesData) {
|
||||||
// console.log('In Plot Handler NodesData', nodesData)
|
// console.log('In Plot Handler NodesData', nodesData)
|
||||||
if (nodesData[i]?.nodeState == "idle") {
|
if (nodesData[i]?.schedulerState == "idle") {
|
||||||
//u.ctx.strokeStyle = "rgb(0, 0, 255)";
|
//u.ctx.strokeStyle = "rgb(0, 0, 255)";
|
||||||
u.ctx.fillStyle = "rgba(0, 0, 255, 0.5)";
|
u.ctx.fillStyle = "rgba(0, 0, 255, 0.5)";
|
||||||
} else if (nodesData[i]?.nodeState == "allocated") {
|
} else if (nodesData[i]?.schedulerState == "allocated") {
|
||||||
//u.ctx.strokeStyle = "rgb(0, 255, 0)";
|
//u.ctx.strokeStyle = "rgb(0, 255, 0)";
|
||||||
u.ctx.fillStyle = "rgba(0, 255, 0, 0.5)";
|
u.ctx.fillStyle = "rgba(0, 255, 0, 0.5)";
|
||||||
} else if (nodesData[i]?.nodeState == "notindb") {
|
} else if (nodesData[i]?.schedulerState == "notindb") {
|
||||||
//u.ctx.strokeStyle = "rgb(0, 0, 0)";
|
//u.ctx.strokeStyle = "rgb(0, 0, 0)";
|
||||||
u.ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
|
u.ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
|
||||||
} else { // Fallback: All other DEFINED states
|
} else { // Fallback: All other DEFINED states
|
||||||
@@ -436,11 +436,11 @@
|
|||||||
tooltip.style.borderColor = getRGB(u.data[2][i]);
|
tooltip.style.borderColor = getRGB(u.data[2][i]);
|
||||||
// Nodes: Color based on Idle vs. Allocated
|
// Nodes: Color based on Idle vs. Allocated
|
||||||
} else if (nodesData) {
|
} else if (nodesData) {
|
||||||
if (nodesData[i]?.nodeState == "idle") {
|
if (nodesData[i]?.schedulerState == "idle") {
|
||||||
tooltip.style.borderColor = "rgb(0, 0, 255)";
|
tooltip.style.borderColor = "rgb(0, 0, 255)";
|
||||||
} else if (nodesData[i]?.nodeState == "allocated") {
|
} else if (nodesData[i]?.schedulerState == "allocated") {
|
||||||
tooltip.style.borderColor = "rgb(0, 255, 0)";
|
tooltip.style.borderColor = "rgb(0, 255, 0)";
|
||||||
} else if (nodesData[i]?.nodeState == "notindb") { // Missing from DB table
|
} else if (nodesData[i]?.schedulerState == "notindb") { // Missing from DB table
|
||||||
tooltip.style.borderColor = "rgb(0, 0, 0)";
|
tooltip.style.borderColor = "rgb(0, 0, 0)";
|
||||||
} else { // Fallback: All other DEFINED states
|
} else { // Fallback: All other DEFINED states
|
||||||
tooltip.style.borderColor = "rgb(255, 0, 0)";
|
tooltip.style.borderColor = "rgb(255, 0, 0)";
|
||||||
@@ -459,7 +459,7 @@
|
|||||||
} else if (nodesData && useColors) {
|
} else if (nodesData && useColors) {
|
||||||
tooltip.textContent = (
|
tooltip.textContent = (
|
||||||
// Tooltip Content as String for Node
|
// Tooltip Content as String for Node
|
||||||
`Host: ${getLegendData(u, i).nodeName}\nState: ${getLegendData(u, i).nodeState}\nJobs: ${getLegendData(u, i).numJobs}`
|
`Host: ${getLegendData(u, i).nodeName}\nState: ${getLegendData(u, i).schedulerState}\nJobs: ${getLegendData(u, i).numJobs}`
|
||||||
);
|
);
|
||||||
} else if (nodesData && !useColors) {
|
} else if (nodesData && !useColors) {
|
||||||
tooltip.textContent = (
|
tooltip.textContent = (
|
||||||
|
|||||||
@@ -191,7 +191,7 @@
|
|||||||
hostname
|
hostname
|
||||||
cluster
|
cluster
|
||||||
subCluster
|
subCluster
|
||||||
nodeState
|
schedulerState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# totalNodes includes multiples if shared jobs
|
# totalNodes includes multiples if shared jobs
|
||||||
@@ -362,7 +362,7 @@
|
|||||||
for (let j = 0; j < subClusterData.length; j++) {
|
for (let j = 0; j < subClusterData.length; j++) {
|
||||||
const nodeName = subClusterData[j]?.host ? subClusterData[j].host : "unknown"
|
const nodeName = subClusterData[j]?.host ? subClusterData[j].host : "unknown"
|
||||||
const nodeMatch = $statusQuery?.data?.nodes?.items?.find((n) => n.hostname == nodeName && n.subCluster == subClusterData[j].subCluster);
|
const nodeMatch = $statusQuery?.data?.nodes?.items?.find((n) => n.hostname == nodeName && n.subCluster == subClusterData[j].subCluster);
|
||||||
const nodeState = nodeMatch?.nodeState ? nodeMatch.nodeState : "notindb"
|
const schedulerState = nodeMatch?.schedulerState ? nodeMatch.schedulerState : "notindb"
|
||||||
let numJobs = 0
|
let numJobs = 0
|
||||||
|
|
||||||
if ($statusQuery?.data) {
|
if ($statusQuery?.data) {
|
||||||
@@ -370,7 +370,7 @@
|
|||||||
numJobs = nodeJobs?.length ? nodeJobs.length : 0
|
numJobs = nodeJobs?.length ? nodeJobs.length : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
result.push({nodeName: nodeName, nodeState: nodeState, numJobs: numJobs})
|
result.push({nodeName: nodeName, schedulerState: schedulerState, numJobs: numJobs})
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user