Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
feat: add uptime to validator detail
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-calavera authored and sunnygleason committed Sep 20, 2019
1 parent 23f9241 commit 1d73472
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/v2/components/Validators/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useMediaQuery from '@material-ui/core/useMediaQuery/useMediaQuery';
import React, {useEffect} from 'react';
import {map, find, eq} from 'lodash/fp';
import {Match} from 'react-router-dom';
import getUptime from 'v2/utils/getUptime';

import {
ComposableMap,
Expand Down Expand Up @@ -51,6 +52,8 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
find({nodePubkey: params.id})(validators) ||
find({nodePubkey: params.id})(inactiveValidators);

const uptime = getUptime(node);

if (!node) {
return <div>Loading...</div>;
}
Expand Down Expand Up @@ -113,7 +116,7 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
{
label: 'Uptime',
hint: '',
value: 'TODO',
value: `${uptime}%`,
},
{
label: 'keybase',
Expand Down

0 comments on commit 1d73472

Please sign in to comment.