Revert "BUG-410 -- update RIFT platform"
[osm/UI.git] / skyquake / plugins / launchpad / src / launchpad_card / launchpadCardCloudAccount.jsx
1
2 /*
3  *
4  *   Copyright 2016 RIFT.IO Inc
5  *
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
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  *
18  */
19
20 import React from 'react';
21 import Loader from 'widgets/loading-indicator/loadingIndicator.jsx';
22
23 export default class LaunchpadCardCloudAccount extends React.Component {
24   constructor(props) {
25     super(props);
26   }
27   componentWillReceiveProps(nextProps) {
28
29   }
30   render() {
31     let html;
32     let isDisplayed = this.props.display;
33     let nsrDataCenter = this.props.nsr['resource-orchestrator'] ? this.props.nsr['resource-orchestrator'] : 'RIFT';
34     return (
35             <div className={this.props.className + (isDisplayed ? '_open':'_close')}>
36               <h2>Accounts</h2>
37               <div className={'dataCenterTable'}>
38                 <div className="dataCenterTable-header">
39                   <div>TYPE</div>
40                   <div>NAME</div>
41                   <div>RESOURCE ORCHESTRATOR</div>
42                   <div>DATACENTER</div>
43                 </div>
44                 <div>
45                   <div>NSR</div>
46                   <div>{this.props.nsr['short-name']}</div>
47                   <div>{nsrDataCenter}</div>
48                   <div>{this.props.nsr['datacenter']}</div>
49                 </div>
50                 {
51                   this.props.nsr && this.props.nsr['vnfrs'] && this.props.nsr['vnfrs'].map(function(v,i) {
52                     if(v.hasOwnProperty('datacenter')) {
53                       return  <div>
54                                 <div>VNFR</div>
55                                 <div>{v['short-name']}</div>
56                                 <div>{nsrDataCenter}</div>
57                                 <div>{v['datacenter']}</div>
58                               </div>
59                     }
60                   })
61                 }
62               </div>
63             </div>
64     );
65   }
66 }
67
68 LaunchpadCardCloudAccount.defaultProps = {
69   display: false,
70   nsr: {}
71 }
72
73