pond: List nodes in NodeList

This commit is contained in:
Łukasz Magiera 2019-07-31 01:53:24 +02:00
parent b61ed0858f
commit df56afe44c
2 changed files with 32 additions and 11 deletions

View File

@ -4,6 +4,14 @@
font-family: monospace;
}
.NodeList {
background: #f9be77;
user-select: text;
font-family: monospace;
min-width: 40em;
display: inline-block;
}
.FullNode {
background: #f9be77;
user-select: text;

View File

@ -84,17 +84,30 @@ class NodeList extends React.Component {
return (
<Cristal title={"Node List"} initialPosition="bottom-left">
<div>
<button onClick={this.spawnNode} disabled={!this.state.existingLoaded}>Spawn Node</button>
<button onClick={this.connMgr} disabled={!this.state.existingLoaded && !this.state.showConnMgr}>Connections</button>
<button onClick={this.consensus} disabled={!this.state.existingLoaded && !this.state.showConsensus}>Consensus</button>
</div>
<div>
{Object.keys(this.state.nodes).map(n => {
return <div key={n}>
{n}
</div>
})}
<div className={'NodeList'}>
<div>
<button onClick={this.spawnNode} disabled={!this.state.existingLoaded}>Spawn Node</button>
<button onClick={this.connMgr} disabled={!this.state.existingLoaded && !this.state.showConnMgr}>Connections</button>
<button onClick={this.consensus} disabled={!this.state.existingLoaded && !this.state.showConsensus}>Consensus</button>
</div>
<div>
{Object.keys(this.state.nodes).map(n => {
const nd = this.state.nodes[n]
let type = "FULL"
if (nd.Storage) {
type = "STOR"
}
let info = "[CONNECTING..]"
if (nd.conn) {
info = <span>{nd.peerid}</span>
}
return <div key={n}>
{n} {type} {info}
</div>
})}
</div>
</div>
<div>
{connMgr}