mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
- Make backend address configurable via env variable - `BACKEND_HOST=1.2.3.4:4040 npm start` points the frontend to the app on that server. Just for development - Render control icons - removed close x for details panel - added control icons in its space - closing of panel still works by clicking on same node, or background - Dont allow control while pending - Render and auto-dismiss control error - Make tests pass
24 lines
645 B
JavaScript
24 lines
645 B
JavaScript
const React = require('react');
|
|
const AppActions = require('../actions/app-actions');
|
|
|
|
const NodeControlButton = 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 = NodeControlButton;
|