fix: hostnames

This commit is contained in:
Thomas E Lackey 2020-11-19 15:20:50 -06:00
parent 1e835be0c9
commit f54e2fac80
5 changed files with 37 additions and 15 deletions

View File

@ -11,7 +11,7 @@ app:
publicUrl: '/console'
api:
server: 'https://apollo1.kube.moon.dxos.network'
server: 'https://alpha.kube.moon.dxos.network'
path: '/api'
intervalLog: 5000
pollInterval: 10000
@ -22,19 +22,19 @@ system:
services:
app:
prefix: '/app'
server: 'https://apollo1.kube.moon.dxos.network'
server: 'https://alpha.kube.moon.dxos.network'
wns:
server: 'https://apollo1.kube.moon.dxos.network/dxos/wns/api'
webui: 'https://apollo1.kube.moon.dxos.network/dxos/wns/console'
server: 'https://alpha.kube.moon.dxos.network/dxos/wns/api'
webui: 'https://alpha.kube.moon.dxos.network/dxos/wns/console'
signal:
server: 'wss://apollo1.kube.moon.dxos.network/dxos/signal'
api: 'https://apollo1.kube.moon.dxos.network/dxos/signal/api'
server: 'wss://alpha.kube.moon.dxos.network/dxos/signal'
api: 'https://alpha.kube.moon.dxos.network/dxos/signal/api'
ipfs:
server: 'https://apollo1.kube.moon.dxos.network/dxos/ipfs/api'
gateway: 'https://apollo1.kube.moon.dxos.network/dxos/ipfs/gateway'
server: 'https://alpha.kube.moon.dxos.network/dxos/ipfs/api'
gateway: 'https://alpha.kube.moon.dxos.network/dxos/ipfs/gateway'
wellknown:
endpoint: 'https://apollo1.kube.moon.dxos.network/.well-known/dxos'
endpoint: 'https://alpha.kube.moon.dxos.network/.well-known/dxos'

View File

@ -6,6 +6,7 @@ import React, { useContext, useRef, useEffect, useState, useCallback } from 'rea
import { useQuery } from '@apollo/react-hooks';
import useComponentSize from '@rehooks/component-size';
import moment from 'moment';
import get from 'lodash.get';
import Grid from '@material-ui/core/Grid';
import TableBody from '@material-ui/core/TableBody';
@ -40,8 +41,12 @@ const buildDataGraph = (rootId, prevGraph, nodes) => {
}
}
const hostname = get(node, 'kubeStatus.system.network.hostname');
const shortId = node.id.slice(0, NODE_ID_LENGTH).toUpperCase();
const label = hostname || shortId;
const oldNode = prevGraph.nodes.find(n => n.id === node.id) || {};
const newNode = { ...oldNode, id: node.id, label: node.id.slice(0, NODE_ID_LENGTH).toUpperCase(), type, data: node };
const newNode = { ...oldNode, id: node.id, label, type, data: node };
if (type === 'root') {
newNode.fx = 0;
newNode.fy = 0;
@ -97,9 +102,9 @@ function Row (props) {
<>
<TableRow className={classes.root}>
<TableCell>{row.id.slice(0, NODE_ID_LENGTH).toUpperCase()}</TableCell>
<TableCell>{system?.network?.hostname}</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>
<TableCell align='right'>{system?.memory?.used || '-'}</TableCell>
<TableCell align='right'>{system?.memory?.total || '-'}</TableCell>
<TableCell align='right'>{system?.time?.up ? moment(system?.time?.up).format('lll') : '-'}</TableCell>
@ -154,10 +159,10 @@ function SignalServers () {
<Table>
<TableHead>
<TableRow>
<TableCell>Signal</TableCell>
<TableCell>ID</TableCell>
<TableCell>Hostname</TableCell>
<TableCell align='right'>Peers (WebRTC)</TableCell>
<TableCell align='right'>Kube version</TableCell>
<TableCell align='right'>Node.JS version</TableCell>
<TableCell align='right'>Memory usage</TableCell>
<TableCell align='right'>Memory total</TableCell>
<TableCell align='right'>Uptime</TableCell>

View File

@ -10,11 +10,17 @@ query {
id
kubeStatus {
system {
version
memory {
total
used
}
network {
hostname
}
time {
up
}

View File

@ -1,7 +1,7 @@
{
"build": {
"name": "@dxos/console-app",
"buildDate": "2020-11-16T20:04:29.098Z",
"version": "1.1.0-beta.16"
"buildDate": "2020-11-19T21:15:16.619Z",
"version": "1.2.0-alpha.5"
}
}

View File

@ -33,6 +33,14 @@ const getVersionInfo = () => {
return undefined;
};
const getCliVersionInfo = () => {
const command = 'wire';
const args = ['version'];
const child = spawnSync(command, args, { encoding: 'utf8' });
return { version: child.stdout };
};
/**
* Get system inforamtion.
* https://www.npmjs.com/package/systeminformation
@ -89,6 +97,9 @@ const getSystemInfo = async () => {
dxos: {
kube: {
version: getVersionInfo()
},
wire: {
version: getCliVersionInfo()
}
}
};