diff --git a/src/components/NodeList.tsx b/src/components/NodeList.tsx deleted file mode 100644 index e962ced..0000000 --- a/src/components/NodeList.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as React from 'react'; -import clsx from 'clsx'; - -const SeednodeList = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes & { nodes: { [nodeId: string]: any } } - // Complains about props not being validated - // eslint-disable-next-line ->(({ className, nodes, ...props }, ref) => { - return ( -
- {nodes != null ? ( - Object.keys(nodes).map((nodeId) => ( -
- Node ID: -
{nodeId}
-
- )) - ) : ( - <> - )} -
- ); -}); - -SeednodeList.displayName = 'SeednodeList'; - -export default SeednodeList; diff --git a/src/components/ResourceChart.tsx b/src/components/ResourceChart.tsx index d4772ba..9d3fe14 100644 --- a/src/components/ResourceChart.tsx +++ b/src/components/ResourceChart.tsx @@ -100,8 +100,8 @@ function ResourceChart({ }, limits: { x: { - min: timestamps.at(-1), - max: timestamps.at(0), + min: timestamps.at(0), + max: timestamps.at(-1), }, }, }, diff --git a/src/components/SeedNodeCard.tsx b/src/components/SeedNodeCard.tsx index fdc327a..ffd6d42 100644 --- a/src/components/SeedNodeCard.tsx +++ b/src/components/SeedNodeCard.tsx @@ -11,6 +11,9 @@ const NodeCard = React.forwardRef< agentPort: number; clientHost: string; clientPort: number; + versionMetadata: { + cliAgentCommitHash: string; + } }; } // Complains about props not being validated @@ -46,6 +49,12 @@ const NodeCard = React.forwardRef<
{data.clientHost}:{data.clientPort}
+ Commit Hash: +
+ + {data.versionMetadata.cliAgentCommitHash} + +
) : ( <> diff --git a/src/pages/index.tsx b/src/pages/index.tsx index a7cd6bc..e88286b 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -46,6 +46,24 @@ export default function Home(): JSX.Element { ), refetchInterval: 60 * 1000, }); + const deploymentsQuery = useQuery>({ + queryKey: ['deployments'], + queryFn: () => + fetch(`${siteConfig.url}/api/deployments`).then((response) => + response.json(), + ), + refetchInterval: 60 * 1000, + }); + + const seedNodesCommitHashes = seedNodesQuery.data == null ? undefined : Object.values(seedNodesQuery.data).map((seedNode) => + seedNode.versionMetadata.cliAgentCommitHash + ); return ( )} -
+
{resourceCpuQuery.data != null ? ( @@ -94,6 +112,51 @@ export default function Home(): JSX.Element { )}
+
+ Deployments: + + + + + + + + + + + + + {deploymentsQuery.data != null && deploymentsQuery.data.length !== 0 ? ( + deploymentsQuery.data.map( + (deployment) => ( + + + + + + + + + ), + ) + ) : ( + + + + )} + +
IDCommit HashStarted OnFinished OnNodesProgress
{deployment.id} + + {deployment.commitHash} + + {new Date(deployment.startedOn).toISOString()}{deployment.finishedOn == null ? "" : new Date(deployment.finishedOn).toISOString()} + {seedNodesCommitHashes?.filter((commitHash) => commitHash === deployment.commitHash).length ?? 0} + + {deployment.progress * 100}% +
+ No deployments have been recorded +
+