From 1d734724e0b94a4174894124fdf126b5e8c7e7ad Mon Sep 17 00:00:00 2001 From: Manuel Calavera Date: Fri, 20 Sep 2019 11:32:00 -0700 Subject: [PATCH] feat: add uptime to validator detail --- src/v2/components/Validators/Detail/index.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/v2/components/Validators/Detail/index.jsx b/src/v2/components/Validators/Detail/index.jsx index 0ab5ea1c..39558431 100644 --- a/src/v2/components/Validators/Detail/index.jsx +++ b/src/v2/components/Validators/Detail/index.jsx @@ -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, @@ -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
Loading...
; } @@ -113,7 +116,7 @@ const ValidatorsDetail = ({match}: {match: Match}) => { { label: 'Uptime', hint: '', - value: 'TODO', + value: `${uptime}%`, }, { label: 'keybase',