Skip to content

Commit

Permalink
fix: show nodes count in networks page
Browse files Browse the repository at this point in the history
  • Loading branch information
Imad Tassaoui committed Oct 31, 2024
1 parent df5b1f3 commit 5efa6c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/pages/networks/NetworkDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3791,7 +3791,7 @@ export default function NetworkDetailsPage(props: PageProps) {
const tabs: TabsProps['items'] = [
{
key: 'hosts',
label: `Nodes (${networkHosts.length})`,
label: `Nodes (${networkNodes.length})`,
children: network && !isRefreshingNetwork ? getHostsContent() : <Skeleton active />,
},
{
Expand Down
20 changes: 11 additions & 9 deletions src/pages/networks/NetworksPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,18 @@ export default function NetworksPage(props: PageProps) {
),
},
{
title: 'Hosts Count',
title: 'Nodes Count',
dataIndex: 'hosts',
// render(_, network) {
// const nodeCount = store.nodes?.filter((node) => node.network === network.netid).length ?? 0;
// return (
// <div onClick={(ev) => ev.stopPropagation()}>
// <Typography.Text>{nodeCount}</Typography.Text>
// </div>
// );
// },
render(_, network) {
const nodeCount =
store.nodes?.filter((node) => node.network === network.netid || node.static_node?.network === network.netid)
.length ?? 0;
return (
<div onClick={(ev) => ev.stopPropagation()}>
<Typography.Text>{nodeCount}</Typography.Text>
</div>
);
},
},
{
title: 'Network Last Modified',
Expand Down

0 comments on commit 5efa6c1

Please sign in to comment.