Use enode RPC in UI (#3108)

* add enode rpc

* spaces -> tabs

* Added Enode to JSAPI // Use it to display in Status (#3106)

* Added enode to JSON RPC Interfaces #3108
This commit is contained in:
Nicolas Gotchac
2016-11-03 12:04:25 +01:00
committed by Gav Wood
parent d101cb5247
commit d99f1b517c
6 changed files with 62 additions and 2 deletions

View File

@@ -15,16 +15,24 @@
/* along with Parity. If not, see <http://www.gnu.org/licenses/>.
*/
.status {
clear: both;
padding: 1.5em;
text-align: right;
color: #ddd;
display: flex;
flex-direction: column;
align-items: flex-end;
}
.title {
margin: 0 0.5em 0 2em;
}
.enode {
width: 45em;
word-wrap: break-word;
margin: 0.5em 0 0.25em;
}
.block {
}

View File

@@ -26,6 +26,7 @@ class Status extends Component {
static propTypes = {
blockNumber: PropTypes.object.isRequired,
clientVersion: PropTypes.string,
enode: PropTypes.string,
netPeers: PropTypes.object,
netChain: PropTypes.string,
isTest: PropTypes.bool
@@ -44,6 +45,7 @@ class Status extends Component {
<div className={ styles.version }>
{ clientVersion }
</div>
{ this.renderEnode() }
<div className={ styles.netinfo }>
<div>
<BlockStatus />
@@ -58,14 +60,29 @@ class Status extends Component {
</div>
);
}
renderEnode () {
const { enode } = this.props;
if (!enode) {
return null;
}
return (
<div className={ styles.enode }>
{ enode }
</div>
);
}
}
function mapStateToProps (state) {
const { blockNumber, clientVersion, netPeers, netChain, isTest } = state.nodeStatus;
const { blockNumber, clientVersion, enode, netPeers, netChain, isTest } = state.nodeStatus;
return {
blockNumber,
clientVersion,
enode,
netPeers,
netChain,
isTest