Files
weave-scope/client/app/scripts/components/node-details/node-details-control-button.js
Simon Howe 5b390994b8 Fix node controls so they behave independently across nodes
If one node was busy performing an action, any other nodes controls
would also be in a 'blocked and waiting' state.
2016-01-05 19:17:10 +01:00

26 lines
672 B
JavaScript

import React from 'react';
import { doControl } from '../../actions/app-actions';
export default class NodeDetailsControlButton extends React.Component {
constructor(props, context) {
super(props, context);
this.handleClick = this.handleClick.bind(this);
}
render() {
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(ev) {
ev.preventDefault();
doControl(this.props.nodeId, this.props.control);
}
}