mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
UI for controls.
- 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
This commit is contained in:
committed by
Tom Wilkie
parent
8f957c4f13
commit
abcb94b1f1
23
client/app/scripts/components/node-control-button.js
Normal file
23
client/app/scripts/components/node-control-button.js
Normal file
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user