update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b third try
[osm/UI.git] / skyquake / plugins / launchpad / src / instantiate / instantiateParameters.jsx
1 /*
2  *
3  *   Copyright 2016 RIFT.IO Inc
4  *
5  *   Licensed under the Apache License, Version 2.0 (the "License");
6  *   you may not use this file except in compliance with the License.
7  *   You may obtain a copy of the License at
8  *
9  *       http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *   Unless required by applicable law or agreed to in writing, software
12  *   distributed under the License is distributed on an "AS IS" BASIS,
13  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *   See the License for the specific language governing permissions and
15  *   limitations under the License.
16  *
17  */
18 import React, {Component} from 'react';
19 import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx';
20 import {Panel, PanelWrapper} from 'widgets/panel/panel';
21 import InstantiateDescriptorPanel from './instantiateDescriptorPanel.jsx';
22 import InstantiateInputParams from './instantiateInputParams.jsx';
23 class Instantiate extends Component {
24     constructor(props) {
25     super(props);
26   }
27     handleSelectVNFConfigAgent = (vnfid) => {
28         let self = this;
29         return function(e) {
30           let configAgentRef = JSON.parse(e.target.value);
31           self.Store.updateSelectedVNFConfigAgent(vnfid, configAgentRef);
32         }
33     }
34   render(){
35     //temporary
36     let selectedNSD = {};
37     let self = this;
38     this.props.nsd[0] && this.props.nsd[0].descriptors && this.props.nsd[0].descriptors.map(function(d) {
39         if(self.props.params.nsd == d.id) {
40             selectedNSD = d;
41         }
42     });
43     return (
44             <PanelWrapper>
45             <InstantiateDescriptorPanel descriptor={selectedNSD} />
46             <Panel title="Input Parameters">
47                 <InstantiateInputParams
48
49                     nsFn={this.props.nsFn()}
50                     vnfFn={this.props.vnfFn()}
51                     vldFn={this.props.vldFn()}
52                     ipProfileFn={this.props.ipProfileFn()}
53                     dnsFn={this.props.dnsFn()}
54                     usersFn={this.props.usersFn()}
55                     sshFn={this.props.sshFn()}
56                     updateName={this.props.nameUpdated}
57                     updateInputParam={this.props.updateInputParam}
58                     updateVnfInputParam={this.props.updateVnfInputParam}
59                     nsd={selectedNSD}
60                     selectedNSDid={this.props.selectedNSDid}
61                     name={this.props.name}
62
63                     cloudAccounts={this.props.cloudAccounts}
64                     selectedCloudAccount={this.props.selectedCloudAccount}
65                     vnfdCloudAccounts={this.props.vnfdCloudAccounts}
66                     ro={this.props.ro}
67                     dataCenters={this.props.dataCenters}
68                     configAgentAccounts={this.props.configAgentAccounts}
69                     inputParameters={this.props['input-parameters']}
70                     vnfInputParams={this.props['vnf-input-parameter']}
71
72                     displayPlacementGroups={this.props.displayPlacementGroups}
73
74
75                     nsPlacementGroups={this.props['ns-placement-groups']}
76                     vnfPlacementGroups={this.props['vnf-placement-groups']}
77
78                     vlds={this.props.vld}
79
80                     ipProfileList={this.props.ipProfiles}
81
82                     sshKeysList={this.props.sshKeysList}
83                     sshKeysRef={this.props.sshKeysRef}
84
85                     dnsServers={this.props.dnsServers}
86
87                     usersList = {this.props.usersList}
88                     selectedID={this.props.selectedNSDid}
89                     selectedNSD={selectedNSD}
90
91                     isOpenMano={this.props.isOpenMano}
92
93                     displayVIMAccounts={this.props.displayVIMAccounts}
94                     resourceOrchestrators={this.props.resourceOrchestrators}
95
96                     selectedResourceOrchestrator={this.props.selectedResourceOrchestrator}
97                     selectedDataCenterID={this.props.dataCenterID}
98
99                     vnfDataCenters={this.props.vnfDataCenters}
100                 />
101             </Panel>
102         </PanelWrapper>
103     )
104   }
105 }
106
107 Instantiate.defaultProps = {
108     nsd: [{}]
109 }
110
111 export default SkyquakeComponent(Instantiate);
112
113
114 /*
115
116
117
118
119     ipProfiles={this.state.ipProfiles}
120     dnsServers={this.state.dnsServers}
121     vld={this.state.vld}
122     nsd={this.state.nsd[0]}
123     selectedID={this.state.selectedNSDid}
124     selectedNSD={this.state.selectedNSD}
125
126     vldFn={this.Store.vldFn()}
127     ipProfileFn={this.Store.ipProfileFn()}
128     dnsFn={this.Store.dnsFn()}
129     usersFn={this.Store.usersFn()}
130     sshFn={this.Store.sshFn()}
131  */