mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
28 lines
740 B
JavaScript
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;
|