mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-05 03:01:11 +00:00
25 lines
663 B
JavaScript
25 lines
663 B
JavaScript
const React = require('react');
|
|
|
|
const AppActions = require('../../actions/app-actions');
|
|
|
|
const NodeDetailsControlButton = React.createClass({
|
|
|
|
render: function() {
|
|
let className = `node-control-button fa ${this.props.control.icon}`;
|
|
if (this.props.pending) {
|
|
className += ' node-control-button-pending';
|
|
}
|
|
return (
|
|
<span className={className} title={this.props.control.human} onClick={this.handleClick} />
|
|
);
|
|
},
|
|
|
|
handleClick: function(ev) {
|
|
ev.preventDefault();
|
|
AppActions.doControl(this.props.control.probeId, this.props.control.nodeId, this.props.control.id);
|
|
}
|
|
|
|
});
|
|
|
|
module.exports = NodeDetailsControlButton;
|