var ZeroTierNode = React.createClass({ getInitialState: function() { return { address: '----------', online: false, version: '_._._' }; }, updateAll: function() { Ajax.call({ url: 'status?auth='+this.props.authToken, cache: false, type: 'GET', success: function(data) { if (data) this.setState(JSON.parse(data)); }.bind(this), error: function() { this.setState(this.getInitialState()); }.bind(this) }) }, componentDidMount: function() { this.updateAll(); // this.updateIntervalId = setInterval(this.updateAll,2500); }, componentWillUnmount: function() { // clearInterval(this.updateIntervalId); }, render: function() { return (
{this.state.address} {this.state.online ? 'ONLINE' : 'OFFLINE'}  {this.state.version}
); } });