}
getLaunchCloudAccountSuccess(cloudAccounts) {
let newState = {};
- newState.cloudAccounts = cloudAccounts || [];
+ newState.cloudAccounts = cloudAccounts.filter(function(v) {
+ console.log(v)
+ return v['connection-status'].status == 'success';
+ }) || [];
+ if(cloudAccounts.length != newState.cloudAccounts.length) {
+ Alt.actions.global.showNotification.defer({type: 'warning', msg: 'One or more VIM accounts have failed to connect'});
+ }
if(cloudAccounts && cloudAccounts.length > 0) {
newState.selectedCloudAccount = cloudAccounts[0];
if (cloudAccounts[0]['account-type'] == 'openstack') {
let newState = {
dataCenters: dataCenters || []
};
- if (this.ro['account-type'] == 'openmano') {
+ if (this.ro && this.ro['account-type'] == 'openmano') {
newState.dataCenterID = dataCenters[this.ro.name][0].uuid
}
this.setState(newState)
return window.location.hash = 'launchpad/' + tokenizedHash[2];
}
launchNSRError(error) {
- Alt.actions.global.showError.defer('Something went wrong while trying to instantiate. Check the error logs for more information');
+ var msg = 'Something went wrong while trying to instantiate. Check the error logs for more information';
+ if(error) {
+ msg = error;
+ }
+ Alt.actions.global.showNotification.defer(msg);
Alt.actions.global.hideScreenLoader.defer();
this.setState({
isLoading: false
if(v['vim-network-name']) {
v.type = 'vim-network-name';
} else {
- v.type = 'unknown';
+ v.type = 'none';
}
}
return v;
} else {
delete vld[i]['dns-server'];
}
- if(type == 'unknown') {
+ if(type == 'none') {
delete vld[i]['ip-profile-ref'];
delete vld[i]['vim-network-name'];
}
let value = e.target.nodeName == "SELECT" ? JSON.parse(e.target.value) : e.target.value;
self.ipProfiles[i]['ip-profile-params'][key] = value;
+ if (value == '') {
+ // Don't send this key
+ delete self.ipProfiles[i]['ip-profile-params'][key];
+ }
+
self.setState({ipProfiles:self.ipProfiles});
}
},
}
//Removing DCHP property on disable to allow instantiation
if(!value) {
- delete self.ipProfiles[i]['ip-profile-params']['dhcp-params'];
+ self.ipProfiles[i]['ip-profile-params']['dhcp-params'] = {
+ enabled: false
+ };
} else {
self.ipProfiles[i]['ip-profile-params']['dhcp-params'][property] = value;
}
let self = this;
return function(e) {
if(self.ipProfiles[i]['ip-profile-params']['dns-server']) {
- self.ipProfiles[i]['ip-profile-params']['dns-server'].unshift('')
+ self.ipProfiles[i]['ip-profile-params']['dns-server'].unshift({})
} else {
- self.ipProfiles[i]['ip-profile-params']['dns-server'] = [''];
+ self.ipProfiles[i]['ip-profile-params']['dns-server'] = [{}];
}
self.setState({ipProfiles:self.ipProfiles});
}
self.setState({ipProfiles:self.ipProfiles});
}
+ },
+ updateDNS: (i, k) => {
+ let self = this;
+ return function(e) {
+ let value = e.target.value;
+ self.ipProfiles[i]['ip-profile-params']['dns-server'][k].address = value;
+ self.setState({ipProfiles:self.ipProfiles});
+ }
}
}
}
nsdPayload['vnf-placement-groups'] && delete nsdPayload['vnf-placement-groups'];
nsdPayload.vld = this.state.vld;
nsdPayload.vld && nsdPayload.vld.map(function(v){
- delete v['unknown'];
+ delete v['none'];
delete v.type;
})
}