diff --git a/src/v2/components/Dashboard/NetworkOverview/NodesMap/index.jsx b/src/v2/components/Dashboard/NetworkOverview/NodesMap/index.jsx
index 342c4a1f..b117fdd7 100644
--- a/src/v2/components/Dashboard/NetworkOverview/NodesMap/index.jsx
+++ b/src/v2/components/Dashboard/NetworkOverview/NodesMap/index.jsx
@@ -10,7 +10,7 @@ import useStyles from './styles';
const NodesMap = () => {
const classes = useStyles();
- const {mapMarkers} = NodesStore;
+ const {validators} = NodesStore;
const {isLoading} = Socket;
if (isLoading) {
return ;
@@ -21,7 +21,7 @@ const NodesMap = () => {
Active Validators Map
-
+
);
};
diff --git a/src/v2/components/Validators/Detail/index.jsx b/src/v2/components/Validators/Detail/index.jsx
index 61161c34..191d1963 100644
--- a/src/v2/components/Validators/Detail/index.jsx
+++ b/src/v2/components/Validators/Detail/index.jsx
@@ -5,7 +5,6 @@ import useMediaQuery from '@material-ui/core/useMediaQuery/useMediaQuery';
import React, {useEffect} from 'react';
import {map, find} from 'lodash/fp';
import {Match} from 'react-router-dom';
-import getUptime from 'v2/utils/getUptime';
import SectionHeader from 'v2/components/UI/SectionHeader';
import NodesStore from 'v2/stores/nodes';
import HelpLink from 'v2/components/HelpLink';
@@ -33,8 +32,6 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
find({nodePubkey: params.id})(validators) ||
find({nodePubkey: params.id})(inactiveValidators);
- const uptime = getUptime(node);
-
if (!node) {
return
Loading...
;
}
@@ -47,6 +44,7 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
coordinates,
stakedSol,
stakedSolPercent,
+ calcUptime,
} = node;
const markers = [{gossip, coordinates, name: nodePubkey}];
@@ -66,7 +64,7 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
{
label: 'Staked SOL',
hint: '',
- value: `${stakedSol} (${stakedSolPercent}%)`,
+ value: stakedSol ? `${stakedSol} (${stakedSolPercent}%)` : 'N/A',
},
{
label: 'Website',
@@ -84,7 +82,7 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
{
label: 'Uptime',
hint: '',
- value: `${uptime}%`,
+ value: `${calcUptime}%`,
},
{
label: 'keybase',
diff --git a/src/v2/components/Validators/Table/index.jsx b/src/v2/components/Validators/Table/index.jsx
index 752d6f6d..505499ed 100644
--- a/src/v2/components/Validators/Table/index.jsx
+++ b/src/v2/components/Validators/Table/index.jsx
@@ -15,7 +15,6 @@ import {observer} from 'mobx-react-lite';
import {Link} from 'react-router-dom';
import {eq, map, concat} from 'lodash/fp';
import NodesStore from 'v2/stores/nodes';
-import getUptime from 'v2/utils/getUptime';
import Table from 'v2/components/UI/Table';
import Socket from 'v2/stores/socket';
import Loader from 'v2/components/UI/Loader';
@@ -71,13 +70,13 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => {
}
const renderRow = ({data: row}) => {
- const uptime = row.uptime && getUptime(row);
const {
identity = {},
nodePubkey,
stakedSol,
stakedSolPercent,
- commission,
+ calcCommission,
+ calcUptime,
} = row;
return (
- {commission || 'N/A'}
- {Boolean(commission) &&
- ` (${(100 * (commission / 0xff)).toFixed(3)}%)`}
-
- ),
+ value: (
- <>
- NODE: {marker.name}
- Gossip: {marker.gossip}
- >
+
+
+
+
+ Total Sol:{' '}
+ {stakedSol ? `${stakedSol} (${stakedSolPercent}%)` : 'N/A'}
+
+
+ Commission: {calcCommission ? `${calcCommission}%` : 'N/A'}
+
+
Uptime: {calcUptime ? `${calcUptime}%` : 'Unavailable'}
+
+
)}
>
map(marker => {
return (
({
tooltip: {
background: '#fff',
color: getColor('dark')(theme),
- padding: 10,
+ padding: `10px 18px`,
borderRadius: 0,
+ maxWidth: 300,
+ zIndex: 1000,
},
tooltipTitle: {
fontSize: 15,
@@ -25,4 +27,20 @@ export default makeStyles(theme => ({
transform: 'scale(2)',
},
},
+ inner: {
+ '& a': {
+ color: getColor('greenDark')(theme),
+ fontSize: 21,
+ },
+ },
+ info: {
+ marginTop: 10,
+ fontSize: 17,
+ lineHeight: '30px',
+ '& > div': {
+ whiteSpace: 'nowrap',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ },
+ },
}));
diff --git a/src/v2/stores/nodes.js b/src/v2/stores/nodes.js
index 136737b2..ec6f2ccd 100644
--- a/src/v2/stores/nodes.js
+++ b/src/v2/stores/nodes.js
@@ -1,6 +1,7 @@
-import {filter, reject, map, getOr} from 'lodash/fp';
+import {filter, reject, map} from 'lodash/fp';
import {action, computed, decorate, observable, flow} from 'mobx';
import * as API from 'v2/api/stats';
+import getUptime from 'v2/utils/getUptime';
import {LAMPORT_SOL_RATIO} from '../constants';
@@ -8,6 +9,8 @@ const addNetworkSolInfo = totalStaked => node => ({
...node,
stakedSol: (node.activatedStake * LAMPORT_SOL_RATIO).toFixed(8),
stakedSolPercent: (100 * (node.activatedStake / totalStaked)).toFixed(3),
+ calcCommission: (100 * (node.commission / 0xff)).toFixed(3),
+ calcUptime: getUptime(node.uptime),
});
class Store {
@@ -36,32 +39,6 @@ class Store {
}
});
- get mapMarkers() {
- if (!this.network.length) {
- return [];
- }
-
- try {
- return map(
- ({nodePubkey: pubkey = '', tpu: gossip, coordinates, identity}) => ({
- pubkey,
- gossip,
- coordinates:
- -180 < coordinates[0] &&
- coordinates[0] < 180 &&
- (-90 < coordinates[1] && coordinates[1] < 90)
- ? coordinates
- : [0, 0],
- name: getOr(pubkey, 'name')(identity),
- avatarUrl: getOr('', 'avatarUrl')(identity),
- }),
- )(this.validators);
- } catch (e) {
- console.error('mapMarkers()', e);
- return [];
- }
- }
-
get validators() {
return filter({what: 'Validator'})(this.network);
}
@@ -80,7 +57,6 @@ decorate(Store, {
supply: observable,
stakedTokens: observable,
updateClusterInfo: action.bound,
- mapMarkers: computed,
validators: computed,
activeValidators: computed,
inactiveValidators: computed,