Skip to content

Commit

Permalink
chore: add cluster name column
Browse files Browse the repository at this point in the history
  • Loading branch information
amlannandy committed Dec 16, 2024
1 parent 49fbf5e commit ea32f5e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/api/infraMonitoring/getK8sNodesList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface K8sNodesData {
meta: {
k8s_node_name: string;
k8s_node_uid: string;
k8s_cluster_name: string;
};
}

Expand Down
17 changes: 17 additions & 0 deletions frontend/src/container/InfraMonitoringK8s/Nodes/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export const defaultAddedColumns: IEntityColumn[] = [
id: 'nodeStatus',
canRemove: false,
},
{
label: 'Cluster Name',
value: 'clusterStatus',
id: 'clusterStatus',
canRemove: false,
},
{
label: 'CPU Utilization (cores)',
value: 'cpuUtilization',
Expand Down Expand Up @@ -43,6 +49,7 @@ export interface K8sNodesRowData {
key: string;
nodeUID: string;
nodeName: string;
clusterName: string;
cpuUtilization: React.ReactNode;
cpuAllocatable: React.ReactNode;
memoryUtilization: React.ReactNode;
Expand All @@ -67,6 +74,15 @@ const columnsConfig = [
sorter: true,
align: 'left',
},
{
title: <div className="column-header-left">Cluster Name</div>,
dataIndex: 'clusterName',
key: 'clusterName',
ellipsis: true,
width: 150,
sorter: true,
align: 'left',
},
{
title: <div className="column-header-left">CPU Utilization (cores)</div>,
dataIndex: 'cpuUtilization',
Expand Down Expand Up @@ -109,6 +125,7 @@ export const formatDataForTable = (data: K8sNodesData[]): K8sNodesRowData[] =>
key: `${node.nodeUID}-${index}`,
nodeUID: node.nodeUID || '',
nodeName: node.meta.k8s_node_name,
clusterName: node.meta.k8s_cluster_name,
cpuUtilization: node.nodeCPUUsage,
memoryUtilization: node.nodeMemoryUsage,
cpuAllocatable: node.nodeCPUAllocatable,
Expand Down

0 comments on commit ea32f5e

Please sign in to comment.