mirror of
https://github.com/biersoeckli/QuickStack.git
synced 2026-01-01 17:20:14 -06:00
added more information for cluster nodes
This commit is contained in:
@@ -19,22 +19,24 @@ export default async function NodeInfo({ nodeInfos }: { nodeInfos: NodeInfoModel
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Cluster Info</CardTitle>
|
||||
<CardDescription>View the components fo yout</CardDescription>
|
||||
<CardDescription>Overview of all nodes and capacities in the cluster.</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="flex gap-4">
|
||||
<CardContent className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
|
||||
{nodeInfos.map((nodeInfo, index) => (
|
||||
<div key={index} className="space-y-4 rounded-lg border p-4">
|
||||
<h3 className="font-semibold text-xl text-center">Node {index + 1}</h3>
|
||||
<h3 className="font-semibold text-xl text-center">Node {index + 1}
|
||||
<span className={nodeInfo.status ? 'text-green-400' : 'text-red-400'}> ({nodeInfo.status ? 'online' : 'offline'})</span>
|
||||
</h3>
|
||||
<div className="space-y-2">
|
||||
<div>
|
||||
<span className="font-semibold">Name:</span> {nodeInfo.name}
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-semibold">IP:</span>
|
||||
<span className="font-semibold">IP:</span> {nodeInfo.ip}
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-semibold">CPU:</span> {nodeInfo.cpuCapacity}
|
||||
<span className="font-semibold">CPU Cores:</span> {nodeInfo.cpuCapacity}
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-semibold">Memory:</span> {nodeInfo.ramCapacity}
|
||||
|
||||
@@ -8,6 +8,8 @@ export const nodeInfoZodModel = z.object({
|
||||
architecture: z.string(),
|
||||
cpuCapacity: z.string(),
|
||||
ramCapacity: z.string(),
|
||||
ip: z.string(),
|
||||
diskCapacity: z.string(),
|
||||
})
|
||||
|
||||
export type NodeInfoModel = z.infer<typeof nodeInfoZodModel>;
|
||||
@@ -13,6 +13,8 @@ class ClusterService {
|
||||
architecture: node.status?.nodeInfo?.architecture!,
|
||||
cpuCapacity: node.status?.capacity?.cpu!,
|
||||
ramCapacity: node.status?.capacity?.memory!,
|
||||
ip: node.status?.addresses?.filter((address) => address.type === 'InternalIP')[0].address!,
|
||||
diskCapacity: node.status?.capacity?.ephemeralStorage!,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user