X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2Finstantiate%2FinstantiateStore.js;h=e779beb16244b3246e559de2c23e18d694c09878;hp=5cf0807be3c7dce9f5284cfde30a5b77d09c3fd8;hb=d51304f9dfd018d778ed2f52fc3c4651c5bbe416;hpb=9c013ddf2d997053c1c8d8bd732275a932ff6b0a diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js index 5cf0807be..e779beb16 100644 --- a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js +++ b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js @@ -131,7 +131,13 @@ class LaunchNetworkServiceStore { } 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') { @@ -156,7 +162,7 @@ class LaunchNetworkServiceStore { let newState = { dataCenters: dataCenters || [] }; - if (this.state.ro && this.state.ro['account-type'] == 'openmano') { + if (this.ro && this.ro['account-type'] == 'openmano') { newState.dataCenterID = dataCenters[this.ro.name][0].uuid } this.setState(newState) @@ -183,7 +189,11 @@ class LaunchNetworkServiceStore { 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 @@ -474,6 +484,11 @@ class LaunchNetworkServiceStore { 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}); } },