diff --git a/apps/info-dashboard/messages/en.json b/apps/info-dashboard/messages/en.json index 8fd567d..0794734 100644 --- a/apps/info-dashboard/messages/en.json +++ b/apps/info-dashboard/messages/en.json @@ -72,5 +72,8 @@ "leaderboard_incentive_program_week_title": "This week", "leaderboard_incentive_program_title": "Incentive program: Lilybit_rewards earned", "leaderboard_get_started_node_provider_button_link": "https://lilypad.tech/incentivenet", - "leaderboard_get_started_node_provider_button_text": "Get started" + "leaderboard_get_started_node_provider_button_text": "Get started", + "leaderboard_node_count_total_title": "Total", + "leaderboard_node_count_online_title": "Online", + "leaderboard_node_count_card_title": "Node count" } diff --git a/apps/info-dashboard/src/app/leaderboard/page.tsx b/apps/info-dashboard/src/app/leaderboard/page.tsx index 9e08bf8..bf0117d 100644 --- a/apps/info-dashboard/src/app/leaderboard/page.tsx +++ b/apps/info-dashboard/src/app/leaderboard/page.tsx @@ -29,6 +29,7 @@ import Tooltip from "@/components/Tooltip/Tooltip"; import { fetchNodes } from "@/lib/fetchers/nodes"; import CardWithBorder from "@/components/CardWithBorder/CardWithBorder"; import Anchor from "@/components/Anchor/Anchor"; +import RandomHexSpan from "@/components/Random/RandomHexSpan"; // `${API_HOST}metrics-dashboard/metrics` is the endpoint for the metrics dashboard @@ -107,6 +108,53 @@ export default function Leaderboard() { {/* Set max height & min height to make table scrollable & minimize layout shifts on state changes */}
+ +
+
+ + {m.leaderboard_node_count_total_title()} + + + {nodesIsLoading ? ( + + ) : nodesIsError ? ( + !err + ) : ( + {nodesData?.length} + )} + +
+
+ + {m.leaderboard_node_count_online_title()} + + + {/* Todo add api total Lilybit_rewards earned */} + + {nodesIsLoading ? ( + + ) : nodesIsError ? ( + !err + ) : ( + + { + nodesData?.filter( + (node) => node.Online + ).length + } + + )} + +
+
+
diff --git a/apps/info-dashboard/src/lib/fetchers/leaderboard.ts b/apps/info-dashboard/src/lib/fetchers/leaderboard.ts index b7bb7be..6fda427 100644 --- a/apps/info-dashboard/src/lib/fetchers/leaderboard.ts +++ b/apps/info-dashboard/src/lib/fetchers/leaderboard.ts @@ -70,12 +70,7 @@ export function toTableData({ )?.Online; return { online, - color: - online === undefined - ? "gray" - : online - ? "success" - : "error", + color: online ? "success" : "gray", translation: online === undefined ? m.leaderboard_node_provider_table_no_data_status()