pond: Stopping storage nodes
This commit is contained in:
parent
9353cdb537
commit
215f95aa5b
@ -27,11 +27,15 @@ class Address extends React.Component {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.refresh()
|
this.refresh()
|
||||||
if(!this.props.ts) {
|
if(!this.props.ts) {
|
||||||
let updates = setInterval(this.refresh, 2050)
|
this.updates = setInterval(this.refresh, 2050)
|
||||||
this.props.client.on('close', () => clearInterval(updates))
|
this.props.client.on('close', () => clearInterval(this.updates))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
clearInterval(this.updates)
|
||||||
|
}
|
||||||
|
|
||||||
async refresh() {
|
async refresh() {
|
||||||
let balance = 0
|
let balance = 0
|
||||||
let actor = {}
|
let actor = {}
|
||||||
|
@ -65,6 +65,7 @@ class NodeList extends React.Component {
|
|||||||
pondClient={this.props.client}
|
pondClient={this.props.client}
|
||||||
fullConn={this.state.nodes[fullId].conn}
|
fullConn={this.state.nodes[fullId].conn}
|
||||||
mountWindow={this.props.mountWindow}
|
mountWindow={this.props.mountWindow}
|
||||||
|
stop={this.stopNode(node.ID, onClose)}
|
||||||
/>)
|
/>)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -29,6 +29,7 @@ class StorageNode extends React.Component {
|
|||||||
|
|
||||||
this.loadInfo = this.loadInfo.bind(this)
|
this.loadInfo = this.loadInfo.bind(this)
|
||||||
this.sealGarbage = this.sealGarbage.bind(this)
|
this.sealGarbage = this.sealGarbage.bind(this)
|
||||||
|
this.stop = this.stop.bind(this)
|
||||||
|
|
||||||
this.connect()
|
this.connect()
|
||||||
}
|
}
|
||||||
@ -59,7 +60,8 @@ class StorageNode extends React.Component {
|
|||||||
// this.props.onConnect(client, id) // TODO: dedupe connecting part
|
// this.props.onConnect(client, id) // TODO: dedupe connecting part
|
||||||
|
|
||||||
this.loadInfo()
|
this.loadInfo()
|
||||||
setInterval(this.loadInfo, 1050)
|
let updates = setInterval(this.loadInfo, 1050)
|
||||||
|
client.on('close', () => clearInterval(updates))
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(token) // todo: use
|
console.log(token) // todo: use
|
||||||
@ -89,6 +91,10 @@ class StorageNode extends React.Component {
|
|||||||
await this.state.client.call("Filecoin.StoreGarbageData", [])
|
await this.state.client.call("Filecoin.StoreGarbageData", [])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async stop() {
|
||||||
|
await this.props.stop()
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let runtime = <div></div>
|
let runtime = <div></div>
|
||||||
if (this.state.actor) {
|
if (this.state.actor) {
|
||||||
@ -117,7 +123,8 @@ class StorageNode extends React.Component {
|
|||||||
|
|
||||||
return <Cristal
|
return <Cristal
|
||||||
title={"Storage Miner Node " + this.props.node.ID}
|
title={"Storage Miner Node " + this.props.node.ID}
|
||||||
initialPosition={{x: this.props.node.ID*30, y: this.props.node.ID * 30}}>
|
initialPosition={{x: this.props.node.ID*30, y: this.props.node.ID * 30}}
|
||||||
|
onClose={this.stop} >
|
||||||
<div className="CristalScroll">
|
<div className="CristalScroll">
|
||||||
<div className="StorageNode">
|
<div className="StorageNode">
|
||||||
{runtime}
|
{runtime}
|
||||||
|
Loading…
Reference in New Issue
Block a user