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
+1 -1
View File
@@ -98,7 +98,7 @@ export default function NodeSetupWorkflow(props: any) {
setActiveStep(5)
}
if (nodeTopology.connected && nodeTopology.connected > 0) {
if (nodeTopology?.connected && nodeTopology?.connected > 0) {
handleComplete(5)
setActiveStep(6)
}
+2 -21
View File
@@ -5,7 +5,7 @@ import { Theme, createStyles, makeStyles } from '@material-ui/core/styles';
import { Card, CardContent, Typography, Chip, Button } from '@material-ui/core/';
import { CheckCircle, Error, ArrowRight, ArrowDropUp } from '@material-ui/icons/';
import { Skeleton } from '@material-ui/lab';
import { Health } from '@ethersphere/bee-js';
import type { Health, NodeAddresses, Topology } from '@ethersphere/bee-js';
const useStyles = makeStyles((theme: Theme) =>
createStyles({
@@ -28,32 +28,13 @@ const useStyles = makeStyles((theme: Theme) =>
}),
);
interface NodeAddresses {
overlay: string,
underlay: string[],
ethereum: string,
public_key: string,
pss_public_key: string
}
interface NodeTopology {
baseAddr: string,
bins: string[],
connected: number,
depth: number,
nnLowWatermark: number,
population: number,
timestamp: string,
}
interface IProps{
nodeHealth: Health,
loadingNodeHealth: boolean,
beeRelease: any,
loadingBeeRelease: boolean,
nodeAddresses: NodeAddresses,
nodeTopology: NodeTopology,
nodeTopology: Topology,
loadingNodeTopology: boolean,
setStatusChecksVisible: any,
}
+2 -2
View File
@@ -20,7 +20,7 @@ export default function Status() {
const { nodeHealth, isLoadingNodeHealth } = useDebugApiHealth()
const { nodeAddresses, isLoadingNodeAddresses } = useApiNodeAddresses()
const { chequebookAddress, isLoadingChequebookAddress } = useApiChequebookAddress()
const { nodeTopology, isLoadingNodeTopology } = useApiNodeTopology()
const { topology: nodeTopology, isLoading: isLoadingNodeTopology } = useApiNodeTopology()
const { chequebookBalance, isLoadingChequebookBalance } = useApiChequebookBalance()
@@ -74,7 +74,7 @@ export default function Status() {
beeRelease.name === `v${nodeHealth?.version?.split('-')[0]}` &&
nodeAddresses?.ethereum &&
chequebookAddress?.chequebookaddress && chequebookBalance && chequebookBalance?.totalBalance > 0 &&
nodeTopology.connected && nodeTopology.connected > 0 &&
nodeTopology?.connected && nodeTopology?.connected > 0 &&
!statusChecksVisible ?
<div>
<StatusCard