Normalize the node IDs.

This commit is contained in:
Thomas E Lackey 2020-10-08 00:15:06 -05:00
parent 04a62512ca
commit e0f5c80751
2 changed files with 6 additions and 6 deletions

View File

@ -22,6 +22,8 @@ import SIGNAL_STATUS from '../../../gql/signal_status.graphql';
import { ConsoleContext, useQueryStatusReducer } from '../../../hooks';
const NODE_ID_LENGTH = 8;
const buildDataGraph = (rootId, prevGraph, nodes) => {
const newGraph = { nodes: [], links: [] };
@ -39,7 +41,7 @@ const buildDataGraph = (rootId, prevGraph, nodes) => {
}
const oldNode = prevGraph.nodes.find(n => n.id === node.id) || {};
const newNode = { ...oldNode, id: node.id, label: node.id.slice(0, 6), type, data: node };
const newNode = { ...oldNode, id: node.id, label: node.id.slice(0, NODE_ID_LENGTH).toUpperCase(), type, data: node };
if (type === 'root') {
newNode.fx = 0;
newNode.fy = 0;
@ -94,9 +96,7 @@ function Row (props) {
return (
<>
<TableRow className={classes.root}>
<TableCell component='th' scope='row'>
{row.id}
</TableCell>
<TableCell>{row.id.slice(0, NODE_ID_LENGTH).toUpperCase()}</TableCell>
<TableCell align='right'>{row.signal.topics.reduce((prev, curr) => prev + curr.peers.length, 0)}</TableCell>
<TableCell align='right'>{system?.version || '-'}</TableCell>
<TableCell align='right'>{system?.nodejs?.version || '-'}</TableCell>

View File

@ -1,7 +1,7 @@
{
"build": {
"name": "@dxos/console-app",
"buildDate": "2020-10-07T16:33:05.270Z",
"version": "1.1.0-beta.6"
"buildDate": "2020-10-08T05:13:10.720Z",
"version": "1.1.0-beta.8"
}
}