mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 10:11:03 +00:00
If one node was busy performing an action, any other nodes controls would also be in a 'blocked and waiting' state.
26 lines
672 B
JavaScript
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);
|
|
}
|
|
}
|