import React from 'react'; import FontAwesome from 'react-fontawesome'; import i18n from 'nfvo-utils/i18n/i18n.js'; import ValidationForm from 'nfvo-components/input/validation/ValidationForm.jsx'; import ValidationInput from'nfvo-components/input/validation/ValidationInput.jsx'; const prefix = '/highAvailabilityAndLoadBalancing/'; const pointers = [ { key: 'failureLoadDistribution', description: 'How is load distributed across live vms in the event of a vm/host failure? please describe' }, { key: 'nkModelImplementation', description: 'Does each VM implement the N+K model for redundancy and failure protection? Please describe.' }, { key: 'architectureChoice', description: 'What architecture is being implemented: ACTIVE-ACTIVE and/or ACTIVE-PASSIVE. ', added: 'Will the arrangement be 1-1 or N-M? Please describe.' }, {key: 'slaRequirements', description: 'Specify application SLA requirements on Cloud platform.'}, { key: 'horizontalScaling', description: 'Is horizontal scaling the preferred solution for HA and resiliency? Please describe.' }, { key: 'loadDistributionMechanism', description: 'Can load be distributed across VMs? If so, are special mechanisms needed to re-balance data across VMs?', added: 'Please describe.' } ]; class SoftwareProductComponentLoadBalancingView extends React.Component { static propTypes = { componentId: React.PropTypes.string.isRequired, softwareProductId: React.PropTypes.string.isRequired, qdata: React.PropTypes.object, qschema: React.PropTypes.object, currentSoftwareProduct: React.PropTypes.object }; state = { expanded: {} }; renderTextAreaItem(item) { return (
this.toggle(item.key)}> {i18n(item.description)} {item.added &&
{i18n(item.added)}
}
); } render() { let {qdata, qschema, onQDataChanged, isReadOnlyMode} = this.props; return (
{i18n('High Availability & Load Balancing')}
{pointers.map(pointer => this.renderTextAreaItem(pointer))}
); } toggle(name) { let st = this.state.expanded[name] ? true : false; let newState = {...this.state}; newState.expanded[name] = !st; this.setState(newState); } save() { let {onSubmit, qdata} = this.props; return onSubmit({qdata}); } } export default SoftwareProductComponentLoadBalancingView;