import AccountActions from './accountActions.js';
import AccountSource from './accountSource.js';
-
+var Utils = require('utils/utils.js');
var rw = require('utils/rw.js');
var altImage = rw.getSearchParams(window.location).alt_image;
+var _ = require('lodash');
let Params = {
//Config Agent
label: 'Floating IP Pool',
ref: 'floating-ip-pool',
optional: true
+ }, {
+ label: "User Domain",
+ ref: 'user-domain',
+ optional: true
+ }, {
+ label: "Project Domain",
+ ref: 'project-domain',
+ optional: true
+ }, {
+ label: "Region",
+ ref: 'region',
+ optional: true
}],
"openvim": [{
label: "Host",
}
getResourceOrchestratorSuccess = (data) => {
this.alt.actions.global.hideScreenLoader.defer();
- if(data['account-type'] == 'openmano') {
+ if(data['rw-launchpad:resource-orchestrator'] && (data['rw-launchpad:resource-orchestrator']['account-type'] == 'openmano')) {
this.setState({
showVIM: false
})
openAccountSocketSuccess = (connection) => {
let self = this;
let ws = window.multiplexer.channel(connection);
-
if (!connection) return;
this.setState({
socket: ws.ws,
ws.onmessage = (socket) => {
try {
var data = JSON.parse(socket.data);
+ Utils.checkAuthentication(data.statusCode, function() {
+ self.closeSocket();
+ });
let SdnOptions = [{
label: 'Select an SDN Account',
value: false
if(self.currentAccount) {
let Account = self.getAccountFromStream(data[self.currentAccount.type].data, self.currentAccount.name);
newState.account = self.account;
- newState.account['connection-status'] = Account['connection-status']
+ newState.account['connection-status'] = Account && Account['connection-status']
}
self.setState(newState)
} catch(error) {
}
getAccountFromStream(data, name) {
let result = null;
- data.map(function(a) {
+ data && _.isArray(data) && data.map(function(a) {
if(a.name == name) {
result = a;
}
viewAccount = ({type, name}) => {
var data = null;
var accounts = null;
- if(this && this[type].length) {
+ if(this && this[type] && this[type].length) {
accounts = this[type];
data = this.getAccountFromStream(accounts, name);
if(data) {
}
generateOptionsByName(data) {
let results = [];
- if (data.constructor.name == "Array") {
+ if (data && _.isArray(data)) {
data.map(function(d) {
results.push({
label: d.name,
}
}
-
-/**
- *Cloud
- *
- * {"name":"eng2","account-type":"openstack","openstack":{"key":"lmaultsb","secret":"mypasswd","auth_url":"http://engstack.eng.riftio.com:5000/v3/","tenant":"lmaultsb","mgmt-network":"private"}}
-Name
-Path
-
-
-SDN
-
-
- *
- *
- */