refactor: replaced topology axios call with bee-js

This commit is contained in:
Vojtech Simetka
2021-04-02 10:44:44 +02:00
parent d711b4cd85
commit 53dd4e1741
8 changed files with 70 additions and 79 deletions
+4 -31
View File
@@ -1,15 +1,12 @@
import React from 'react'
import { Grid, Container, CircularProgress } from '@material-ui/core/';
import StatCard from '../../components/StatCard';
import { Container, CircularProgress } from '@material-ui/core/';
import PeerTable from './PeerTable';
import TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard';
import { useApiNodeTopology, useApiNodePeers, useDebugApiHealth } from '../../hooks/apiHooks';
import TopologyStats from '../../components/TopologyStats';
export default function Peers() {
const { nodeTopology, isLoadingNodeTopology } = useApiNodeTopology()
const topology = useApiNodeTopology()
const debugHealth = useDebugApiHealth()
const peers = useApiNodePeers()
@@ -27,31 +24,7 @@ export default function Peers() {
return (
<>
<Grid style={{ marginBottom: '20px', flexGrow: 1 }}>
<Grid container spacing={3}>
<Grid key={1} item xs={12} sm={12} md={6} lg={4} xl={4}>
<StatCard
label='Connected Peers'
statistic={nodeTopology.connected.toString()}
loading={isLoadingNodeTopology}
/>
</Grid>
<Grid key={2} item xs={12} sm={12} md={6} lg={4} xl={4}>
<StatCard
label='Population'
statistic={nodeTopology.population.toString()}
loading={isLoadingNodeTopology}
/>
</Grid>
<Grid key={3} item xs={12} sm={12} md={6} lg={4} xl={4}>
<StatCard
label='Depth'
statistic={nodeTopology.depth.toString()}
loading={isLoadingNodeTopology}
/>
</Grid>
</Grid>
</Grid>
<TopologyStats {...topology} />
<PeerTable {...peers} />
</>
)