diff --git a/pages/index.js b/pages/index.js index fe2cc6e..8794e79 100644 --- a/pages/index.js +++ b/pages/index.js @@ -37,6 +37,7 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; +import Head from "next/head"; // Initialize Supabase client const supabase = createClient( @@ -215,401 +216,413 @@ export default function Dashboard() { const totalPeerPages = getPageCount(displayPeerIds.length); return ( -
- {/* Header */} - -
-
- Codex -

Testnet Metrics

-
-
- - - - - - - - - Testnet Metrics -
- - The data displayed in this dashboard is collected from Codex nodes that use the{' '} - - Codex CLI - - {' '}for running a Codex alturistic node in the testnet. Users agree to a privacy - disclaimer before using the Codex CLI and the data collected will be used to - understand the testnet statistics and help troubleshooting users who face - difficulty in getting onboarded to Codex. - -
-
-

Don't wish to provide data?

-

- You can still run a Codex node without providing any data. To do this, please follow the steps mentioned in the - Codex documentation - which does not use the Codex CLI. -

-
-
-

Is there an incentive to run a Codex node?

-

- Codex is currently in testnet and it is not incentivized. However, in the future, Codex may be incentivized as per the roadmap. But please bear in mind that no incentives are promised for testnet node operators. -

-
-
-

I have a question or suggestion

-

- The best way to get in touch with us is to join the - - {" "}Codex discord - and ask your question in the #support channel. -

-
-
- - -
-
-
-
+ <> + + Codex Metrics + + + + + + + -
- {error ? ( - - ) : ( -
- {/* Top Section: Stats + Graph */} -
- {/* Left Column - Stats Cards */} -
- {[ - { - title: "Active Nodes", - value: currentActiveNodes, - Icon: Users, - delay: 0, - isLoading: componentLoading.nodes, - }, - { - title: "Average Peer Count", - value: averagePeerCount, - Icon: Network, - delay: 0.1, - isLoading: componentLoading.nodes, - }, - { - title: "Total Nodes", - value: totalNodes, - Icon: Database, - delay: 0.2, - isLoading: componentLoading.metrics, - }, - { - title: "Last Updated", - value: lastUpdated, - Icon: Clock, - delay: 0.3, - isLoading: componentLoading.nodes, - }, - ].map((stat) => ( - -

- - {stat.title} -

-
- {stat.isLoading ? ( -
- ) : stat.title === "Last Updated" ? ( -
- - {lastUpdated.time} - - - {lastUpdated.dateText} - -
- ) : ( -

- {stat.value} -

- )} -
- - ))} -
- - {/* Right Column - Chart */} - - -
- - - - Active Nodes - - - - Geographic Distribution - - -
- - - {componentLoading.metrics ? ( -
- -
- ) : metrics.length === 0 ? ( -
-

No data available for the selected timeframe

-
- ) : ( -
- - - - format(new Date(date), "MMM d")} - fontSize={12} - tickMargin={10} - /> - - [`${value} nodes`, 'Active Nodes']} - labelFormatter={(label) => format(new Date(label), "MMM d, yyyy")} - /> - - - -
- )} -
- - -
-

Geographic distribution view coming soon

-
-
-
-
+
+ {/* Header */} + +
+
+ Codex +

Testnet Metrics

- - {/* Bottom Section: Version Distribution + Active Peers */} -
- {/* Version Distribution */} - + + + + + + + + + Testnet Metrics +
+ + The data displayed in this dashboard is collected from Codex nodes that use the{' '} + + Codex CLI + + {' '}for running a Codex alturistic node in the testnet. Users agree to a privacy + disclaimer before using the Codex CLI and the data collected will be used to + understand the testnet statistics and help troubleshooting users who face + difficulty in getting onboarded to Codex. + +
+
+

Don't wish to provide data?

+

+ You can still run a Codex node without providing any data. To do this, please follow the steps mentioned in the + Codex documentation + which does not use the Codex CLI. +

+
+
+

Is there an incentive to run a Codex node?

+

+ Codex is currently in testnet and it is not incentivized. However, in the future, Codex may be incentivized as per the roadmap. But please bear in mind that no incentives are promised for testnet node operators. +

+
+
+

I have a question or suggestion

+

+ The best way to get in touch with us is to join the + + {" "}Codex discord + and ask your question in the #support channel. +

+
+
+ + +
+
+
+
+ +
+ {error ? ( + + ) : ( +
+ {/* Top Section: Stats + Graph */} +
+ {/* Left Column - Stats Cards */} +
+ {[ + { + title: "Active Nodes", + value: currentActiveNodes, + Icon: Users, + delay: 0, + isLoading: componentLoading.nodes, + }, + { + title: "Average Peer Count", + value: averagePeerCount, + Icon: Network, + delay: 0.1, + isLoading: componentLoading.nodes, + }, + { + title: "Total Nodes", + value: totalNodes, + Icon: Database, + delay: 0.2, + isLoading: componentLoading.metrics, + }, + { + title: "Last Updated", + value: lastUpdated, + Icon: Clock, + delay: 0.3, + isLoading: componentLoading.nodes, + }, + ].map((stat) => ( + +

+ + {stat.title} +

+
+ {stat.isLoading ? ( +
+ ) : stat.title === "Last Updated" ? ( +
+ + {lastUpdated.time} + + + {lastUpdated.dateText}
-
- -
-
- ))} -
- - - )} -
- - {/* Active Peer IDs List */} - -
-

- - Active Peer IDs -

-
- setSearchQuery(e.target.value)} - className="w-full bg-neutral-800 border border-neutral-700 rounded-lg px-4 py-2 - text-sm placeholder-neutral-500 focus:border-[#7afbaf] focus:ring-1 - focus:ring-[#7afbaf] transition-colors outline-none" - /> - -
+ ) : ( +

+ {stat.value} +

+ )} +
+
+ ))}
- {componentLoading.peers ? ( - - ) : activePeerIds.length === 0 ? ( -
-

No active peers available

-
- ) : isSearching ? ( -
- -
- ) : searchQuery && searchResults.length === 0 ? ( -
-

No matching peer IDs found

-
- ) : ( - <> -
- {paginatedPeerIds.map((peerId, index) => ( - - {peerId} - - ))} + + {/* Right Column - Chart */} + + +
+ + + + Active Nodes + + + + Geographic Distribution + +
- - - )} -
+ + + {componentLoading.metrics ? ( +
+ +
+ ) : metrics.length === 0 ? ( +
+

No data available for the selected timeframe

+
+ ) : ( +
+ + + + format(new Date(date), "MMM d")} + fontSize={12} + tickMargin={10} + /> + + [`${value} nodes`, 'Active Nodes']} + labelFormatter={(label) => format(new Date(label), "MMM d, yyyy")} + /> + + + +
+ )} +
+ + +
+

Geographic distribution view coming soon

+
+
+ + +
+ + {/* Bottom Section: Version Distribution + Active Peers */} +
+ {/* Version Distribution */} + +

+ + Version Distribution +

+ {componentLoading.versions ? ( + + ) : Object.keys(versionDistribution).length === 0 ? ( +
+

No version data available

+
+ ) : ( + <> +
+ {paginatedVersions.map(([version, count]) => ( +
+
+ {version} + + {count} + +
+
+ +
+
+ ))} +
+ + + )} +
+ + {/* Active Peer IDs List */} + +
+

+ + Active Peer IDs +

+
+ setSearchQuery(e.target.value)} + className="w-full bg-neutral-800 border border-neutral-700 rounded-lg px-4 py-2 + text-sm placeholder-neutral-500 focus:border-[#7afbaf] focus:ring-1 + focus:ring-[#7afbaf] transition-colors outline-none" + /> + +
+
+ {componentLoading.peers ? ( + + ) : activePeerIds.length === 0 ? ( +
+

No active peers available

+
+ ) : isSearching ? ( +
+ +
+ ) : searchQuery && searchResults.length === 0 ? ( +
+

No matching peer IDs found

+
+ ) : ( + <> +
+ {paginatedPeerIds.map((peerId, index) => ( + + {peerId} + + ))} +
+ + + )} +
+
-
- )} -
-
+ )} +
+
+ ); } diff --git a/public/favicon.ico b/public/favicon.ico index 718d6fe..096e2b4 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ