Files
weave-scope/client/app/scripts/components/status.js
2015-06-16 15:49:36 +02:00

28 lines
740 B
JavaScript

const React = require('react');
const Status = React.createClass({
renderConnectionState: function(errorUrl, websocketClosed) {
if (errorUrl || websocketClosed) {
const title = errorUrl ? 'Cannot reach Scope. Make sure the following URL is reachable: ' + errorUrl : '';
return (
<div className="status-connection" title={title}>
<span className="status-icon fa fa-exclamation-circle" />
<span className="status-label">Trying to reconnect...</span>
</div>
);
}
},
render: function() {
return (
<div className="status">
{this.renderConnectionState(this.props.errorUrl, this.props.websocketClosed)}
</div>
);
}
});
module.exports = Status;