Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
fix: add visual treatment for nodes that are shutting down
Browse files Browse the repository at this point in the history
mvines authored and mergify[bot] committed Apr 25, 2019
1 parent 44fa51e commit 59afb73
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -250,6 +250,7 @@ class App extends Component {
if (oldNode) {
newNode.lat = oldNode.lat;
newNode.lng = oldNode.lng;
newNode.terminated = oldNode.terminated;
} else {
const ip = newNode.gossip.split(':')[0];
const [lat, lng] = await geoip(ip);
7 changes: 5 additions & 2 deletions src/BxDialogWorldMap.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import CloseIcon from '@material-ui/icons/Close';
import ComputerIcon from '@material-ui/icons/Computer';
import PowerOffIcon from '@material-ui/icons/PowerOff';
import Dialog from '@material-ui/core/Dialog';
import DialogTitle from '@material-ui/core/DialogTitle';
import IconButton from '@material-ui/core/IconButton';
@@ -43,6 +44,8 @@ class Node extends React.Component {
const result = await connection.fullnodeExit();
if (!result) {
window.alert('Node declined to exit');
} else {
node.terminated = true;
}
}
} catch (err) {
@@ -67,7 +70,7 @@ class Node extends React.Component {
onClick={this.handleClick}
{...other}
>
<ComputerIcon />
{node.terminated ? <PowerOffIcon /> : <ComputerIcon />}
</Fab>
<Popover
id="simple-popper"
@@ -88,7 +91,7 @@ class Node extends React.Component {
<br />
<b>Gossip:</b> {node.gossip}
</Typography>
{node.rpc && (
{node.rpc && !node.terminated && (
<div style={{textAlign: 'center'}}>
<p />
<Button onClick={this.handleTerminate}>Terminate Node</Button>

0 comments on commit 59afb73

Please sign in to comment.