4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 //THIS SHOULD BE REMOVED ONCE EPA PARAMS ARE MOVED OVER
21 import React from 'react';
22 let ReactCSSTransitionGroup = require('react-addons-css-transition-group');
23 class LaunchpadNSInfo extends React.Component {
26 // this.state = {metrics: props.data};
31 this.props.data.map((metric, index)=> {
32 if (metric.hasOwnProperty('label') && this.props.name != "NFVI-METRICS") {
34 let displayValue = '';
35 if (metric.hasOwnProperty('vm')) {
36 displayValue = metric.vm + ' ' + metric.unit;
38 if (metric.hasOwnProperty('active-vm')) {
39 displayValue = metric["active-vm"] + ' of ' + (parseInt(metric["active-vm"]) + parseInt(metric["inactive-vm"])) + ' Active';
41 if (metric.hasOwnProperty('used')) {
42 displayValue = metric.used.value + ' / ' + metric.total.value + metric.total.unit;
48 <dt>{metric.label}:</dt>
49 <dd>{displayValue}</dd>
54 if(this.props.name == "NFVI-METRICS") {
55 toDisplay = <NfviMetricBars metrics={this.props.data} />
68 // style={infoClass[this.props.name]}
69 if (!metricSet.length) {
73 if(this.props.name == "NFVI-METRICS") {
74 toDisplay = <NfviMetricBars metrics={this.props.data} />
76 toDisplay = (<div className="empty">{ msgString }</div>);
89 <div style={{overflow: 'hidden'}}>
90 <div className="launchpadCard_title">
93 <div className={"launchpadCard_data-list" + ' ' + this.props.name}>
100 LaunchpadNSInfo.propTypes = {
101 data: React.PropTypes.array,
102 name: React.PropTypes.string
104 LaunchpadNSInfo.defaultProps = {
109 export default LaunchpadNSInfo;