feat: added tolerance to version check and warning if not exact to what we tested (#133)

* feat: added tolerance to version check and warning if not exact to what we expect

* chore: update to bee-js 0.10.0

* chore: updated interfaces that changed in bee-js 0.10.0
This commit is contained in:
Vojtech Simetka
2021-06-02 15:59:57 +02:00
committed by GitHub
parent bec84051a9
commit 353db10080
11 changed files with 137 additions and 48 deletions
+9 -5
View File
@@ -23,17 +23,19 @@ const useStyles = makeStyles(() =>
interface Props {
nodeAddresses: NodeAddresses | null
nodeTopology: Topology | null
userBeeVersion: string | null
latestBeeVersion: string | null
userBeeVersion?: string
isLatestBeeVersion: boolean
isOk: boolean
latestUrl: string
}
function StatusCard({
userBeeVersion,
nodeAddresses,
nodeTopology,
latestBeeVersion,
isOk,
isLatestBeeVersion,
latestUrl,
}: Props): ReactElement | null {
const classes = useStyles()
@@ -72,7 +74,7 @@ function StatusCard({
Bee
</a>{' '}
<span>{userBeeVersion || '-'}</span>
{userBeeVersion && latestBeeVersion && userBeeVersion === latestBeeVersion ? (
{isLatestBeeVersion ? (
<Chip
style={{ marginLeft: '7px', color: '#2145a0' }}
size="small"
@@ -80,7 +82,9 @@ function StatusCard({
className={classes.status}
/>
) : (
<Typography variant="button">update</Typography>
<Button size="small" variant="outlined" href={latestUrl}>
update
</Button>
)}
</Typography>
<Typography component="div" variant="subtitle2" gutterBottom>
+2 -1
View File
@@ -49,9 +49,10 @@ export default function Status(): ReactElement {
<div className={classes.root}>
<StatusCard
userBeeVersion={nodeVersion.userVersion}
latestBeeVersion={nodeVersion.latestVersion}
isLatestBeeVersion={nodeVersion.isLatestBeeVersion}
isOk={checks.every(c => c.isOk)}
nodeTopology={topology.topology}
latestUrl={nodeVersion.latestUrl}
nodeAddresses={ethereumConnection.nodeAddresses}
/>
{ethereumConnection.nodeAddresses && chequebook.chequebookAddress && (