fix: correct the bee version detection (#645)
* feat: Github repository link to ethersphere/bee-dashboard * fix: correct the Bee version detection
This commit is contained in:
@@ -4,6 +4,7 @@ import { ReactElement, useContext } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import FilesIcon from 'remixicon-react/ArrowUpDownLineIcon'
|
||||
import DocsIcon from 'remixicon-react/BookOpenLineIcon'
|
||||
import GithubIcon from 'remixicon-react/GithubFillIcon'
|
||||
import ExternalLinkIcon from 'remixicon-react/ExternalLinkLineIcon'
|
||||
import HomeIcon from 'remixicon-react/Home3LineIcon'
|
||||
import SettingsIcon from 'remixicon-react/Settings2LineIcon'
|
||||
@@ -17,6 +18,7 @@ import SideBarItem from './SideBarItem'
|
||||
import SideBarStatus from './SideBarStatus'
|
||||
import { BeeModes } from '@ethersphere/bee-js'
|
||||
import { BEE_DOCS_HOST } from '../constants'
|
||||
import { GITHUB_BEE_DASHBOARD_URL } from '../constants'
|
||||
|
||||
const drawerWidth = 300
|
||||
|
||||
@@ -126,6 +128,16 @@ export default function SideBar(): ReactElement {
|
||||
/>
|
||||
</MUILink>
|
||||
</List>
|
||||
<Divider className={classes.divider} />
|
||||
<List>
|
||||
<MUILink href={GITHUB_BEE_DASHBOARD_URL} target="_blank" className={classes.link}>
|
||||
<SideBarItem
|
||||
iconStart={<GithubIcon className={classes.icon} />}
|
||||
iconEnd={<ExternalLinkIcon className={classes.icon} color="#595959" />}
|
||||
label={<span>Github repository</span>}
|
||||
/>
|
||||
</MUILink>
|
||||
</List>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<List>
|
||||
|
||||
@@ -6,6 +6,7 @@ export const BLOCKCHAIN_EXPLORER_URL = 'https://blockscout.com/xdai/mainnet'
|
||||
export const BEE_DOCS_HOST = 'https://docs.ethswarm.org/docs/'
|
||||
export const BEE_DISCORD_HOST = 'https://discord.gg/eKr9XPv7'
|
||||
export const GITHUB_REPO_URL = 'https://api.github.com/repos/ethersphere/bee'
|
||||
export const GITHUB_BEE_DASHBOARD_URL = 'https://github.com/ethersphere/bee-dashboard.git'
|
||||
export const BEE_DESKTOP_LATEST_RELEASE_PAGE = 'https://github.com/ethersphere/bee-desktop/releases/latest'
|
||||
export const BEE_DESKTOP_LATEST_RELEASE_PAGE_API =
|
||||
'https://api.github.com/repos/ethersphere/bee-desktop/releases/latest'
|
||||
|
||||
@@ -134,14 +134,17 @@ function getStatus(
|
||||
error: Error | null,
|
||||
isDesktop: boolean,
|
||||
startedAt: number,
|
||||
latestPublishedVersion: string | undefined,
|
||||
latestUserVersion: string | undefined,
|
||||
): Status {
|
||||
const status: Status = { ...initialValues.status }
|
||||
|
||||
// Version check
|
||||
status.version.isEnabled = !isDesktop
|
||||
status.version.checkState =
|
||||
debugApiHealth &&
|
||||
semver.satisfies(debugApiHealth.version, PackageJson.engines.bee, {
|
||||
latestPublishedVersion &&
|
||||
latestUserVersion &&
|
||||
semver.satisfies(latestPublishedVersion, latestUserVersion, {
|
||||
includePrerelease: true,
|
||||
})
|
||||
? CheckState.OK
|
||||
@@ -435,6 +438,8 @@ export function Provider({ children, isDesktop }: Props): ReactElement {
|
||||
error,
|
||||
Boolean(isDesktop),
|
||||
startedAt,
|
||||
latestPublishedVersion,
|
||||
latestUserVersion,
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user