fix: add bee version (#659)
This commit is contained in:
@@ -12,7 +12,7 @@ import NodeInfoCard from './NodeInfoCard'
|
|||||||
import { WalletInfoCard } from './WalletInfoCard'
|
import { WalletInfoCard } from './WalletInfoCard'
|
||||||
|
|
||||||
export default function Status(): ReactElement {
|
export default function Status(): ReactElement {
|
||||||
const { status, topology, nodeInfo, chainId } = useContext(BeeContext)
|
const { beeVersion, status, topology, nodeInfo, chainId } = useContext(BeeContext)
|
||||||
const { isDesktop, desktopUrl } = useContext(SettingsContext)
|
const { isDesktop, desktopUrl } = useContext(SettingsContext)
|
||||||
const { beeDesktopVersion } = useBeeDesktop(isDesktop, desktopUrl)
|
const { beeDesktopVersion } = useBeeDesktop(isDesktop, desktopUrl)
|
||||||
const { newBeeDesktopVersion } = useNewBeeDesktopVersion(isDesktop, desktopUrl, false)
|
const { newBeeDesktopVersion } = useNewBeeDesktopVersion(isDesktop, desktopUrl, false)
|
||||||
@@ -52,6 +52,7 @@ export default function Status(): ReactElement {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
<ExpandableListItem label="Bee version" value={beeVersion} />
|
||||||
<ExpandableListItem label="Mode" value={nodeInfo?.beeMode} />
|
<ExpandableListItem label="Mode" value={nodeInfo?.beeMode} />
|
||||||
{chainId !== null && <ExpandableListItem label="Blockchain network" value={chainIdToName(chainId)} />}
|
{chainId !== null && <ExpandableListItem label="Blockchain network" value={chainIdToName(chainId)} />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+10
-4
@@ -41,6 +41,7 @@ interface Status {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface ContextInterface {
|
interface ContextInterface {
|
||||||
|
beeVersion: string | null
|
||||||
status: Status
|
status: Status
|
||||||
error: Error | null
|
error: Error | null
|
||||||
apiHealth: boolean
|
apiHealth: boolean
|
||||||
@@ -65,6 +66,7 @@ interface ContextInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const initialValues: ContextInterface = {
|
const initialValues: ContextInterface = {
|
||||||
|
beeVersion: null,
|
||||||
status: {
|
status: {
|
||||||
all: CheckState.ERROR,
|
all: CheckState.ERROR,
|
||||||
apiConnection: { isEnabled: false, checkState: CheckState.ERROR },
|
apiConnection: { isEnabled: false, checkState: CheckState.ERROR },
|
||||||
@@ -164,6 +166,7 @@ interface Props {
|
|||||||
|
|
||||||
export function Provider({ children }: Props): ReactElement {
|
export function Provider({ children }: Props): ReactElement {
|
||||||
const { beeApi } = useContext(SettingsContext)
|
const { beeApi } = useContext(SettingsContext)
|
||||||
|
const [beeVersion, setBeeVersion] = useState<string | null>(null)
|
||||||
const [apiHealth, setApiHealth] = useState<boolean>(false)
|
const [apiHealth, setApiHealth] = useState<boolean>(false)
|
||||||
const [nodeAddresses, setNodeAddresses] = useState<NodeAddresses | null>(null)
|
const [nodeAddresses, setNodeAddresses] = useState<NodeAddresses | null>(null)
|
||||||
const [nodeInfo, setNodeInfo] = useState<NodeInfo | null>(null)
|
const [nodeInfo, setNodeInfo] = useState<NodeInfo | null>(null)
|
||||||
@@ -262,11 +265,13 @@ export function Provider({ children }: Props): ReactElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const promises = [
|
const promises = [
|
||||||
// API health
|
|
||||||
beeApi
|
beeApi
|
||||||
.isConnected({ timeout: TIMEOUT })
|
.getHealth({ timeout: TIMEOUT })
|
||||||
.then(setApiHealth)
|
.then(response => setBeeVersion(response.version))
|
||||||
.catch(() => setApiHealth(false)),
|
.catch(() => setBeeVersion(null)),
|
||||||
|
|
||||||
|
// API health
|
||||||
|
beeApi.isConnected({ timeout: TIMEOUT }).catch(() => setApiHealth(false)),
|
||||||
|
|
||||||
// Node Addresses
|
// Node Addresses
|
||||||
beeApi
|
beeApi
|
||||||
@@ -376,6 +381,7 @@ export function Provider({ children }: Props): ReactElement {
|
|||||||
return (
|
return (
|
||||||
<Context.Provider
|
<Context.Provider
|
||||||
value={{
|
value={{
|
||||||
|
beeVersion,
|
||||||
status,
|
status,
|
||||||
error,
|
error,
|
||||||
apiHealth,
|
apiHealth,
|
||||||
|
|||||||
Reference in New Issue
Block a user