*/
import React from 'react';
import RecordViewStore from '../recordViewer/recordViewStore.js';
+import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx';
import Button from 'widgets/button/rw.button.js';
import Utils from 'utils/utils.js';
import UpTime from 'widgets/uptime/uptime.jsx';
import './nsrScalingGroups.scss';
-export default class NsrScalingGroups extends React.Component {
+class NsrScalingGroups extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
- handleExecuteClick = (nsr_id, scaling_group_id, event) => {
+ handleExecuteClick = (nsr_id, scaling_group_id, max_instance_count, event) => {
+ let self = this;
+ if (this.getInstancesForScalingGroup(scaling_group_id) == max_instance_count) {
+ self.props.flux.actions.global.showNotification("Maximum allowed scaling instances created for this group. Cannot create any more");
+ return;
+ }
RecordViewStore.createScalingGroupInstance({
nsr_id: nsr_id,
scaling_group_id: scaling_group_id
);
}
}) : trows.push(
- <tr key={sgrInstanceIndex}>
+ <tr key={sgri}>
<td colSpan="5" style={{textAlign: 'center'}}>No network services scaled in this group</td>
</tr>
);
let sgInstanceTable = this.createScalingGroupTable(sgd.name);
- let sgCreateInstanceButton = <Button label='Create Scaling Group Instance' className="dark" isDisabled={this.getInstancesForScalingGroup(sgd.name) == sgd["max-instance-count"]} isLoading={false} onClick={this.handleExecuteClick.bind(this, this.props.data.id, sgd.name)} />
+ let sgCreateInstanceButton = <Button label='Create Scaling Group Instance' className="dark" isDisabled={this.getInstancesForScalingGroup(sgd.name) == sgd["max-instance-count"]} isLoading={false} onClick={this.handleExecuteClick.bind(this, this.props.data.id, sgd.name, sgd['max-instance-count'])} />
let scalingGroup =
<div>
}
}
+
+export default SkyquakeComponent(NsrScalingGroups);