Merging master to master_vca_intg
authorKiran Kashalkar <kiran.kashalkar@riftio.com>
Thu, 23 Feb 2017 10:48:18 +0000 (10:48 +0000)
committerKiran Kashalkar <kiran.kashalkar@riftio.com>
Thu, 23 Feb 2017 10:48:18 +0000 (10:48 +0000)
Signed-off-by: Kiran Kashalkar <kiran.kashalkar@riftio.com>
29 files changed:
Makefile
skyquake/framework/utils/utils.js
skyquake/framework/widgets/JSONViewer/JSONViewer.scss
skyquake/framework/widgets/skyquake_container/skyquakeContainerSource.js
skyquake/plugins/accounts/src/account/accountSource.js
skyquake/plugins/accounts/src/account/accountStore.js
skyquake/plugins/composer/api/composer.js
skyquake/plugins/composer/src/src/components/CanvasPanel.js
skyquake/plugins/composer/src/src/components/ComposerApp.js
skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js
skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx
skyquake/plugins/composer/src/src/components/filemanager/FileManagerActions.js
skyquake/plugins/composer/src/src/components/filemanager/FileManagerSource.js
skyquake/plugins/composer/src/src/libraries/PackageManagerApi.js
skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaProperty.js
skyquake/plugins/composer/src/src/libraries/utils.js
skyquake/plugins/composer/src/src/sources/RiftHeaderSource.js
skyquake/plugins/composer/src/src/stores/ComposerAppStore.js
skyquake/plugins/launchpad/api/launchpad.js
skyquake/plugins/launchpad/src/createSource.js
skyquake/plugins/launchpad/src/launchpadFleetSource.js
skyquake/plugins/launchpad/src/recordViewer/recordViewSource.js
skyquake/plugins/launchpad/src/topologyL2View/topologyL2Source.js
skyquake/plugins/launchpad/src/topologyView/topologySource.js
skyquake/plugins/launchpad/src/virtual_links/nsVirtualLinkCreate.jsx
skyquake/plugins/launchpad/src/virtual_links/nsVirtualLinkCreateStore.js
skyquake/plugins/launchpad/src/virtual_links/nsVirtualLinks.jsx
skyquake/plugins/launchpad/src/vnfr/vnfrSource.js
skyquake/skyquake.js

index 5c9d864..db2cda9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,9 @@ RIFT_BUILD = $(TOP_SRC_PATH)/.build
 RIFT_ARTIFACTS = $(TOP_ROOT_PATH)/artifacts
 RIFT_INSTALL = $(TOP_ROOT_PATH)
 RIFT_SHELL_EXE = $(TOP_ROOT_PATH)/rift-shell -b $(RIFT_BUILD) -i $(RIFT_INSTALL) -a $(RIFT_ARTIFACTS) --
+RELEASE_NUMBER = $(shell git describe | cut -d. -f1 | sed -e 's/^v//')
+BUILD_NUMBER = $(shell git describe | cut -d. -f2-)
+
 
 CONFD = XML_ONLY
 
@@ -44,11 +47,14 @@ cmake::
        mkdir -p $(RIFT_BUILD)
        mkdir -p $(RIFT_ARTIFACTS)
        mkdir -p $(RIFT_INSTALL)
-       cd $(RIFT_BUILD) && $(RIFT_SHELL_EXE) cmake $(TOP_SRC_PATH) -DCMAKE_INSTALL_PREFIX=$(TOP_ROOT_PATH) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DNOT_DEVELOPER_BUILD=$(NOT_DEVELOPER_TYPE) -DCOVERAGE_BUILD=$(COVERAGE_TYPE) -DRIFT_AGENT_BUILD=$(RIFT_AGENT_BUILD) -DPROJECT_TOP_DIR=$(PROJECT_TOP_DIR) -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DRIFT_SUBMODULE_NAME=$(PROJECT_TOP_DIR)
+       cd $(RIFT_BUILD) && $(RIFT_SHELL_EXE) cmake $(TOP_SRC_PATH) -DCMAKE_INSTALL_PREFIX=$(TOP_ROOT_PATH) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DNOT_DEVELOPER_BUILD=$(NOT_DEVELOPER_TYPE) -DCOVERAGE_BUILD=$(COVERAGE_TYPE) -DRIFT_AGENT_BUILD=$(RIFT_AGENT_BUILD) -DPROJECT_TOP_DIR=$(PROJECT_TOP_DIR) -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DRIFT_SUBMODULE_NAME=$(PROJECT_TOP_DIR) -DRIFT_PACKAGE_GENERATOR=DEB -DRELEASE_NUMBER=$(RELEASE_NUMBER) -DBUILD_NUMBER=$(BUILD_NUMBER)
 
 rw: cmake
        $(RIFT_SHELL_EXE) $(MAKE) -C $(RIFT_BUILD)
 
+package: rw
+       $(RIFT_SHELL_EXE) $(MAKE) -C $(RIFT_BUILD) rw.package
+
 install:
        $(RIFT_SHELL_EXE) $(MAKE) -C $(RIFT_BUILD) install
 
index 8a54ff3..e8e9ad1 100644 (file)
@@ -189,7 +189,7 @@ Utils.setAuthentication = function(username, password, cb) {
     window.sessionStorage.setItem("auth", AuthBase64);
     self.detectInactivity();
     $.ajax({
-            url: '//' + window.location.hostname + ':' + NODE_PORT + '/check-auth?api_server=' + API_SERVER,
+            url: '//' + window.location.hostname + ':' + window.location.port + '/check-auth?api_server=' + API_SERVER,
             type: 'GET',
             beforeSend: Utils.addAuthorizationStub,
             success: function(data) {
index 08fcefd..62495b2 100644 (file)
@@ -1,4 +1,5 @@
 .JSONViewer {
+       max-width: 640px;
        /*
        copied from node_modules/prismjs/themes/prismjs.css
 */
index 49356a4..ae2147a 100644 (file)
@@ -55,7 +55,7 @@ export default {
             remote: function(state, recordID) {
                 return new Promise(function(resolve, reject) {
                     $.ajax({
-                        url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/operational/restconf-state/streams?api_server=' + API_SERVER,
+                        url: '//' + window.location.hostname + ':' + window.location.port + '/api/operational/restconf-state/streams?api_server=' + API_SERVER,
                         type: 'GET',
                         beforeSend: Utils.addAuthorizationStub,
                         success: function(data) {
@@ -78,7 +78,7 @@ export default {
             remote: function(state, location, streamSource) {
                 return new Promise((resolve, reject) => {
                     $.ajax({
-                        url: '//' + window.location.hostname + ':' + NODE_PORT + '/socket-polling?api_server=' + API_SERVER,
+                        url: '//' + window.location.hostname + ':' + window.location.port + '/socket-polling',
                         type: 'POST',
                         beforeSend: Utils.addAuthorizationStub,
                         data: {
index b17af40..08fb9f3 100644 (file)
@@ -38,7 +38,7 @@ module.exports = function(Alt) {
                 return resolve(false);
               }
                $.ajax({
-                url: '/socket-polling?api_server=' + API_SERVER ,
+                url: '/socket-polling',
                 type: 'POST',
                 beforeSend: Utils.addAuthorizationStub,
                 data: {
index dee59f2..aeb5f48 100644 (file)
@@ -115,14 +115,6 @@ let AccountMeta = {
             }, {
                 label: "Authentication URL",
                 ref: 'auth_url'
-            },{
-                label: "User Domain",
-                ref: 'user-domain',
-                optional: true
-            },{
-                label: "Project Domain",
-                ref: 'project-domain',
-                optional: true
             }, {
                 label: "Tenant",
                 ref: 'tenant'
@@ -133,6 +125,18 @@ let AccountMeta = {
                 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",
@@ -245,7 +249,7 @@ export default class AccountStore {
     }
     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
             })
index 23345f5..eaf5059 100644 (file)
@@ -312,7 +312,7 @@ Composer.update = function(req) {
     var download_host = req.query['dev_download_server'];
 
     if (!download_host) {
-        download_host = api_server + ':' + utils.getPortForProtocol(req.protocol);
+        download_host = req.protocol + '://' + req.get('host');//api_server + ':' + utils.getPortForProtocol(req.protocol);
     }
     var input = {
         'external-url': download_host + '/composer/update/' + req.file.filename,
@@ -368,7 +368,7 @@ Composer.upload = function(req) {
     var download_host = req.query['dev_download_server'];
 
     if (!download_host) {
-        download_host = api_server + ':' + utils.getPortForProtocol(req.protocol);
+        download_host = req.protocol + '://' + req.get('host');//req.api_server + ':' + utils.getPortForProtocol(req.protocol);
     }
 
     return new Promise(function(resolve, reject) {
@@ -425,9 +425,14 @@ Composer.addFile = function(req) {
     var package_type = req.query['package_type'].toUpperCase();
     var package_path = req.query['package_path'];
     if (!download_host) {
-        download_host = api_server + ':' + utils.getPortForProtocol(req.protocol);
+        download_host = req.protocol + '://' + req.get('host');//api_server + ':' + utils.getPortForProtocol(req.protocol);
+    }
+    var input = {
+        'external-url': download_host + '/composer/upload/' + req.query['package_id'] + '/' + req.file.filename,
+        'package-type': package_type,
+        'package-id': package_id,
+        'package-path': package_path + '/' + req.file.filename
     }
-
     return new Promise(function(resolve, reject) {
         Promise.all([
             rp({
@@ -441,12 +446,7 @@ Composer.addFile = function(req) {
                 resolveWithFullResponse: true,
                 json: true,
                 body: {
-                    input: {
-                        'external-url': download_host + '/composer/upload/' + req.query['package_id'] + '/' + req.file.filename,
-                        'package-type': package_type,
-                        'package-id': package_id,
-                        'package-path': package_path + '/' + req.file.filename
-                    }
+                    input: input
                 }
             })
         ]).then(function(result) {
index df4af5b..86afd56 100644 (file)
@@ -108,7 +108,7 @@ const CanvasPanel = React.createClass({
                                </div>
                                {viewButtonTabs}
                                <div className="CanvasPanelBody panel-body" style={{marginRight: this.props.layout.right, bottom: this.props.layout.bottom}} >
-                                       {hasNoCatalogs ? null : viewFiles ? <FileManager files={this.props.files} type={this.props.type} item={this.props.item} filesState={this.props.filesState} /> : bodyComponent}
+                                       {hasNoCatalogs ? null : viewFiles ? <FileManager files={this.props.files} type={this.props.type} item={this.props.item} filesState={this.props.filesState} newPathName={this.props.newPathName} /> : bodyComponent}
                                </div>
                                {
                                        isDescriptorView ?
index 6507b34..861c38b 100644 (file)
@@ -205,6 +205,7 @@ const ComposerApp = React.createClass({
                                                                                 panelTabShown={self.state.panelTabShown}
                                                                                 files={self.state.files}
                                                                                 filesState={self.state.filesState}
+                                         newPathName={self.state.newPathName}
                                                                                 item={self.state.item}
                                                                                 type={self.state.filterCatalogByTypeValue}
                                                                                  />
index 2a5da21..19af539 100644 (file)
@@ -173,6 +173,7 @@ function startEditing() {
                const name = path.join('.');
                const isEditable = true;
                const isGuid = Property.isGuid(property);
+               const isBoolean = Property.isBoolean(property);
                const onChange = onFormFieldValueChanged.bind(container);
                const isEnumeration = Property.isEnumeration(property);
                const isLeafRef = Property.isLeafRef(property);
@@ -217,6 +218,31 @@ function startEditing() {
                        return <select key={fieldKey.toString()} id={fieldKey.toString()} className={ClassNames({'-value-not-set': !isValueSet})} name={name} value={value} title={name} onChange={onChange} onFocus={onFocus} onBlur={endEditing} onMouseDown={startEditing} onMouseOver={startEditing} readOnly={!isEditable}>{options}</select>;
                }
 
+               if (isBoolean) {
+                       let fullFieldKey = _.isArray(fieldKey) ? fieldKey.join(':') : fieldKey;
+                       let containerRef = container;
+                       while (containerRef.parent) {
+                               fullFieldKey = containerRef.parent.key + ':' + fullFieldKey;
+                               containerRef = containerRef.parent;
+                       }
+
+                       const options = [
+                               <option key={fieldKey.toString() + '-true'} value="TRUE">TRUE</option>,
+                               <option key={fieldKey.toString() + '-false'} value="FALSE">FALSE</option>
+                       ]
+
+                       // if (!isValueSet) {
+                               const noValueDisplayText = changeCase.title(property.name);
+                               options.unshift(<option key={'(value-not-in-leafref)' + fieldKey.toString()} value="" placeholder={placeholder}></option>);
+                       // }
+                       let val = value;
+                       if(typeof(val) == 'number') {
+                               val = value ? "TRUE" : "FALSE"
+                       }
+                       const isValueSet = (val != '' && val)
+                       return <select key={fieldKey.toString()} id={fieldKey.toString()} className={ClassNames({'-value-not-set': !isValueSet})} name={name} value={val && val.toUpperCase()} title={name} onChange={onChange} onFocus={onFocus} onBlur={endEditing} onMouseDown={startEditing} onMouseOver={startEditing} readOnly={!isEditable}>{options}</select>;
+               }
+
                if (property['preserve-line-breaks']) {
                        return <textarea key={fieldKey.toString()} cols="5" id={fieldKey.toString()} name={name} value={value} placeholder={placeholder} onChange={onChange} onFocus={onFocus} onBlur={endEditing} onMouseDown={startEditing} onMouseOver={startEditing} onMouseOut={endEditing} onMouseLeave={endEditing} readOnly={!isEditable} />;
                }
index ce490a0..3833ab4 100644 (file)
@@ -105,7 +105,13 @@ class FileManager extends React.Component {
         let html = (
             <div className="FileManager">
                 <PanelWrapper style={{flexDirection: 'column'}}>
-                    {self.props.files && self.props.files.id && buildList(self, self.props.files) }
+                <Panel className="addFileSection" style={{backgroundColor: 'transparent'}} no-corners>
+                    <div className="inputSection">
+                        <TextInput placeholder="some/path" value={this.props.newPathName} label="create a new directory" onChange={FileManagerActions.newPathNameUpdated} />
+                        <Button label="Create" onClick={FileManagerActions.createDirectory} />
+                    </div>
+                </Panel>
+                {self.props.files && self.props.files.id && buildList(self, self.props.files) }
                 </PanelWrapper>
             </div>
         )
@@ -125,7 +131,7 @@ function buildList(self, data) {
 function contentFolder(context, folder, path, key, inputState, updateFn, sendDownloadFileRequst, deleteFn) {
     let type = context.props.type;
     let id = context.props.item.id;
-    const onboardDropZone = createDropZone.bind(this, FileManagerUploadDropZone.ACTIONS.onboard, '.ComposerAppAddFile.' + path.replace('/', '-'), type, id, path);
+    const onboardDropZone = createDropZone.bind(this, FileManagerUploadDropZone.ACTIONS.onboard, '.ComposerAppAddFile.' + path.replace(/\//g, '-'), type, id, path);
     return (
         <Panel title={path} key={key} itemClassName="nested" no-corners>
         <div className="folder">
@@ -167,7 +173,7 @@ class ItemUpload extends React.Component {
             <div className="inputSection">
                 <label className="sqTextInput" style={{flexDirection: 'row', alignItems:'center'}}>
                     <span>Upload File</span>
-                    <Button className={'ComposerAppAddFile ' + path.replace('/', '-')} label="BROWSE"/>
+                    <Button className={'ComposerAppAddFile ' + path.replace(/\//g, '-')} label="BROWSE"/>
                 </label>
             </div>
         )
@@ -177,6 +183,7 @@ function contentFile(context, file, path, key, deleteFn) {
     const name = stripPath(file.name, path);
     const id = context.props.item.id;
     const type = context.props.type;
+    const downloadHost = API_SERVER.match('localhost') || API_SERVER.match('127.0.0.1') ? `${window.location.protocol}//${window.location.hostname}` : API_SERVER;
     //{`${window.location.protocol}//${API_SERVER}:4567/api/package${type}/${id}/${path}/${name}`}
     return (
         <div className="file" key={key}>
@@ -186,7 +193,7 @@ function contentFile(context, file, path, key, deleteFn) {
                         {file.status && (file.status == 'IN_PROGRESS' || file.status == 'DOWNLOADING'  )  ? <LoadingIndicator size={2} /> : file.status }
                     </div>
                     <div className="file-name">
-                        <a target="_blank" href={`${API_SERVER}:4567/api/package/${type}/${id}/${path}/${name}`}>{name}</a>
+                        <a target="_blank" href={`${downloadHost}:4567/api/package/${type}/${id}/${path}/${name}`}>{name}</a>
                     </div>
                 </div>
                 <div className="file-action" style={{display: (!file.status || (file && file.status.toLowerCase() != 'loading...')) ? 'inherit' : 'none', cursor: 'pointer'}} onClick={deleteFn(file.name)}>X</div>
index f39c2a9..93e1e5e 100644 (file)
@@ -23,7 +23,7 @@ class FileManagerActions {
     constructor() {
         this.generateActions('getFilelistSuccess', 'getFilelistError', 'updateFileLocationInput','sendDownloadFileRequst', 'addFileSuccess', 'addFileError','deletePackageFile','deleteFileSuccess','deleteFileError','openDownloadMonitoringSocketSuccess', 'openDownloadMonitoringSocketError',
                              'getFilelistSocketSuccess',
-                             'openFileManagerSockets', 'closeFileManagerSockets');
+                             'openFileManagerSockets', 'closeFileManagerSockets','newPathNameUpdated', 'createDirectory');
     }
 
 }
index d2d9765..325d026 100644 (file)
@@ -58,20 +58,22 @@ const FileManagerSource = {
     },
     addFile: function() {
         return {
-            remote: function(state, id, type, path, url) {
+            remote: function(state, id, type, path, url, refresh) {
                 return new Promise(function(resolve, reject) {
                     console.log('Adding file');
                     console.log(id, type, path, url);
                     let splitUrl = url.split('/');
                     let fileName = splitUrl[splitUrl.length -1];
+                    let packagePath = refresh ? path + ((path[path.length - 1] == '/') ? '' : '/') : path + '/' + fileName;
                     $.ajax({
                         beforeSend: Utils.addAuthorizationStub,
-                        url: 'api/file-manager?api_server=' + utils.getSearchParams(window.location).api_server +'&package_type=' + type + '&package_id=' + id + '&package_path=' + path + '/' + fileName + '&url=' + url,
+                        url: 'api/file-manager?api_server=' + utils.getSearchParams(window.location).api_server +'&package_type=' + type + '&package_id=' + id + '&package_path=' + packagePath + '&url=' + url,
                         success: function(data) {
                             resolve({
                                 data:data,
                                 path: path,
-                                fileName: fileName
+                                fileName: fileName,
+                                refresh: refresh
                             });
                         },
                         error: function(error) {
@@ -144,7 +146,7 @@ const FileManagerSource = {
                 return new Promise(function(resolve, reject) {
                     //api/operational/download-jobs/job/
                    $.ajax({
-                    url: '/socket-polling?api_server=' + API_SERVER ,
+                    url: '/socket-polling',
                     type: 'POST',
                     beforeSend: Utils.addAuthorizationStub,
                     data: {
@@ -169,7 +171,7 @@ const FileManagerSource = {
                 return new Promise(function(resolve, reject) {
                     //api/operational/download-jobs/job/
                    $.ajax({
-                    url: '/socket-polling?api_server=' + API_SERVER ,
+                    url: '/socket-polling',
                     type: 'POST',
                     beforeSend: Utils.addAuthorizationStub,
                     data: {
index 6b8862c..69fa4d6 100644 (file)
@@ -76,7 +76,7 @@ export default class PackageManager {
         }
         new Promise(function(resolve, reject) {
             $.ajax({
-                url: '/socket-polling?api_server=' + API_SERVER ,
+                url: '/socket-polling',
                 type: 'POST',
                 beforeSend: Utils.addAuthorizationStub,
                 data: {
index 5b066cf..6fe1112 100644 (file)
@@ -32,6 +32,9 @@ import DescriptorTemplateFactory from './DescriptorTemplateFactory'
 import utils from '../utils'
 
 export default {
+       isBoolean(property = {}) {
+               return (typeof(property['data-type']) == 'string') && (property['data-type'].toLowerCase() == 'boolean')
+       },
        isLeaf(property = {}) {
                return /leaf|choice/.test(property.type);
        },
index d2a7535..be55d23 100644 (file)
@@ -212,9 +212,27 @@ export default {
                                                let key = fragment.split('[')[0];
                                                let searchObject = {};
                                                searchObject[predicateKey] = predicateValue;
-                                               objectCopy = _.find(objectCopy[key], searchObject);
-                                               if (!objectCopy) {
-                                                       return [];
+                                               let found = _.find(objectCopy[key], searchObject);
+                                               if (found) {
+                                                       objectCopy = found;
+                                               } else {
+                                                       // check for numerical value
+                                                       if (predicateValue != "" &&
+                                                               predicateValue != null &&
+                                                               predicateValue != NaN &&
+                                                               predicateValue != Infinity &&
+                                                               predicateValue != -Infinity) {
+                                                               let numericalPredicateValue = _.toNumber(predicateValue);
+                                                               if (_.isNumber(numericalPredicateValue)) {
+                                                                       searchObject[predicateKey] = numericalPredicateValue;
+                                                                       found = _.find(objectCopy[key], searchObject);
+                                                               }
+                                                       }
+                                                       if (found) {
+                                                               objectCopy = found;
+                                                       } else {
+                                                               return [];
+                                                       }
                                                }
                                        } else {
                                                // contains no predicate
index e479d33..3e61387 100644 (file)
@@ -31,7 +31,7 @@ function getApiServerOrigin() {
 }
 function ajaxRequest(path, catalogPackage, resolve, reject, method = 'GET') {
        $.ajax({
-               url: '//' + window.location.hostname + ':' + getApiServerOrigin() + path,
+               url: '//' + window.location.hostname + ':' + window.location.port + path,
                type: method,
                beforeSend: utils.addAuthorizationStub,
                dataType: 'json',
index 75276d2..ff24cbb 100644 (file)
@@ -41,6 +41,9 @@ import React from 'react';
 //Hack for crouton fix. Should eventually put composer in skyquake alt context
 import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx';
 let NotificationError = null;
+
+import utils from '../libraries/utils';
+
 class ComponentBridge extends React.Component {
     constructor(props) {
         super(props);
@@ -126,6 +129,7 @@ class ComposerAppStore {
                this.filesState = {};
                this.downloadJobs = {};
                this.containers = [];
+               this.newPathName = '';
                //End File  manager values
                this.bindListeners({
                        onResize: PanelResizeAction.RESIZE,
@@ -164,7 +168,9 @@ class ComposerAppStore {
                        closeFileManagerSockets: FileManagerActions.closeFileManagerSockets,
                        openFileManagerSockets: FileManagerActions.openFileManagerSockets,
                        openDownloadMonitoringSocketSuccess: FileManagerActions.openDownloadMonitoringSocketSuccess,
-                       getFilelistSocketSuccess: FileManagerActions.getFilelistSocketSuccess
+                       getFilelistSocketSuccess: FileManagerActions.getFilelistSocketSuccess,
+                       newPathNameUpdated: FileManagerActions.newPathNameUpdated,
+                       createDirectory: FileManagerActions.createDirectory
                });
         this.exportPublicMethods({
             closeFileManagerSockets: this.closeFileManagerSockets.bind(this)
@@ -477,7 +483,7 @@ class ComposerAppStore {
                                                data: _.mergeWith(normalizedData.data, self.files.data, function(obj, src) {
                                                        return _.uniqBy(obj? obj.concat(src) : src, 'name');
                                                }),
-                                               id: self.files.id || normalizedData.id
+                                               id: normalizedData.id
                                        },
                                        filesState: filesState
                                }
@@ -527,7 +533,7 @@ class ComposerAppStore {
                let type = data.type || this.item.uiState.type;
                let path = data.path;
                let url = data.url;
-               this.getInstance().addFile(id, type, path, url);
+               this.getInstance().addFile(id, type, path, url, data.refresh);
        }
        updateFileLocationInput = (data) => {
                let name = data.name;
@@ -539,14 +545,16 @@ class ComposerAppStore {
                });
        }
        addFileSuccess = (data) => {
-               let path = data.path;
-               let fileName = data.fileName;
-               let files = _.cloneDeep(this.files);
-               let loadingIndex = files.data[path].push({
-                       status: 'DOWNLOADING',
-                       name: path + '/' + fileName
-               }) - 1;
-               this.setState({files: files});
+               if(!data.refresh) {
+                       let path = data.path;
+                       let fileName = data.fileName;
+                       let files = _.cloneDeep(this.files);
+                       let loadingIndex = files.data[path].push({
+                               status: 'DOWNLOADING',
+                               name: path + '/' + fileName
+                       }) - 1;
+                       this.setState({files: files});
+               }
 
        }
        startWatchingJob = () => {
@@ -663,6 +671,25 @@ class ComposerAppStore {
                        files: files
                })
        }
+       newPathNameUpdated = (event) => {
+               const value = event.target.value;
+               this.setState({
+                       newPathName: value
+               })
+       }
+       createDirectory = () => {
+               console.log(this.newPathName);
+               this.sendDownloadFileRequst({
+                       id: this.item.id,
+                       type: this.item.uiState.type,
+                       path: this.item.name + '/' + this.newPathName,
+                       url: utils.getSearchParams(window.location).dev_download_server || window.location.protocol + '//' + window.location.host,
+                       refresh: true
+               });
+               this.setState({
+                       newPathName: ''
+               })
+       }
 }
 
 export default alt.createStore(ComposerAppStore, 'ComposerAppStore');
index 509ff77..6fb0170 100644 (file)
@@ -813,7 +813,7 @@ NSR.addVnfrDataPromise = function(req, nsrs) {
             vdur['console-url'] = 'api/vnfr/' + vnfr.id + '/vdur/' + vdur.id + '/console-url';
             nsr['console-urls'].push({
                 id: vdur.id,
-                name: vdur.name,
+                name: vnfr.name,
                 'console-url': vdur['console-url']
             });
         });
index d9271d6..6c837a7 100644 (file)
@@ -29,7 +29,7 @@ module.exports = {
       remote: function() {
         return new Promise(function(resolve, reject) {
           $.ajax({
-            url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/launchpad/network-service?api_server=' + API_SERVER,
+            url: '//' + window.location.hostname + ':' + window.location.port + '/api/launchpad/network-service?api_server=' + API_SERVER,
             type: 'GET',
             beforeSend: Utils.addAuthorizationStub,
             success: function(data) {
@@ -46,7 +46,7 @@ module.exports = {
     return {
       remote: function(state, environment) {
         return $.ajax({
-          url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/launchpad/environment?api_server=' + API_SERVER,
+          url: '//' + window.location.hostname + ':' + window.location.port + '/api/launchpad/environment?api_server=' + API_SERVER,
           type: 'POST',
           beforeSend: Utils.addAuthorizationStub,
           dataType: 'json',
@@ -65,7 +65,7 @@ module.exports = {
       remote: function() {
         return new Promise(function(resolve, reject) {
           $.ajax({
-            url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/launchpad/pools?api_server=' + API_SERVER,
+            url: '//' + window.location.hostname + ':' + window.location.port + '/api/launchpad/pools?api_server=' + API_SERVER,
             type: 'GET',
             beforeSend: Utils.addAuthorizationStub,
             success: function(data) {
@@ -83,7 +83,7 @@ module.exports = {
       remote: function() {
         return new Promise(function(resolve, reject) {
           $.ajax({
-            url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/launchpad/sla-params?api_server=' + API_SERVER,
+            url: '//' + window.location.hostname + ':' + window.location.port + '/api/launchpad/sla-params?api_server=' + API_SERVER,
             type: 'GET',
             beforeSend: Utils.addAuthorizationStub,
             success: function(data) {
index 0e9b34e..cde7116 100644 (file)
@@ -106,7 +106,7 @@ module.exports = function(Alt) {
             return resolve(false);
           }
            $.ajax({
-            url: '/socket-polling?api_server=' + API_SERVER ,
+            url: '/socket-polling',
             type: 'POST',
             beforeSend: Utils.addAuthorizationStub,
             data: {
index 49c3122..a3b2d67 100644 (file)
@@ -94,7 +94,7 @@ export default {
                 return new Promise(function(resolve, reject) {
                     console.log('Getting NSR Socket');
                     $.ajax({
-                        url: '/socket-polling?api_server=' + API_SERVER,
+                        url: '/socket-polling',
                         type: 'POST',
                         beforeSend: Utils.addAuthorizationStub,
                         data: {
@@ -117,7 +117,7 @@ export default {
                 return new Promise(function(resolve, reject) {
                     console.log('Getting Job Socket');
                     $.ajax({
-                        url: '/socket-polling?api_server=' + API_SERVER,
+                        url: '/socket-polling',
                         type: 'POST',
                         beforeSend: Utils.addAuthorizationStub,
                         data: {
@@ -139,7 +139,7 @@ export default {
                 return new Promise(function(resolve, reject) {
                     console.log('Getting VNFR Socket for: ' + state.recordID);
                     $.ajax({
-                        url: '/socket-polling?api_server=' + API_SERVER,
+                        url: '/socket-polling',
                         type: 'POST',
                         beforeSend: Utils.addAuthorizationStub,
                         data: {
index e927984..fd38d84 100644 (file)
@@ -41,7 +41,7 @@ export default {
             return resolve(false);
           }
            $.ajax({
-            url: '/socket-polling?api_server=' + API_SERVER ,
+            url: '/socket-polling',
             type: 'POST',
             beforeSend: Utils.addAuthorizationStub,
             data: {
index 23db982..04e1c66 100644 (file)
@@ -42,7 +42,7 @@ export default {
             return resolve(false);
           }
            $.ajax({
-            url: '/socket-polling?api_server=' + API_SERVER ,
+            url: '/socket-polling',
             type: 'POST',
             beforeSend: Utils.addAuthorizationStub,
             data: {
index 30f7694..d3dc011 100644 (file)
@@ -39,6 +39,7 @@ class NsVirtualLinkCreate extends React.Component {
        componentWillMount() {
                (!this.state.nsrId && this.props.nsrId) && this.Store.saveNSRId(this.props.nsrId);
                this.Store.saveMode(this.props.mode);
+               this.Store.saveOnSuccess(this.props.onSuccess);
                switch (this.props.mode) {
                        case 'creating':
                                if (!this.state.vld) {
index 61ebe3d..dbd7f58 100644 (file)
@@ -84,7 +84,8 @@ class NSVirtualLinkCreateStore {
             saveVnfdIdRefs: this.saveVnfdIdRefs,
             saveIpProfileNames: this.saveIpProfileNames,
             removeVirtualLink: this.removeVirtualLink,
-            saveMode: this.saveMode
+            saveMode: this.saveMode,
+            saveOnSuccess: this.saveOnSuccess
         });
        }
 
@@ -97,6 +98,12 @@ class NSVirtualLinkCreateStore {
                });
        }
 
+       saveOnSuccess = (onSuccess) => {
+               this.setState({
+                       onSuccess: onSuccess
+               })
+       }
+
        saveMode = (mode) => {
                this.setState({
                        mode: mode
@@ -240,22 +247,13 @@ class NSVirtualLinkCreateStore {
        }
 
        createVirtualLinkSuccess(data) {
-               this.setState({
-                       // vld: this.vld,
-                       mode: 'editing',
-                       isLoading: false
-               });
+               this.onSuccess();
        }
        editVirtualLinkSuccess(data) {
-               this.setState({
-                       mode: 'editing',
-                       isLoading: false
-               });
+               this.onSuccess();
        }
        deleteVirtualLinkSuccess(data) {
-               this.setState({
-                       deleteState: 'success'
-               });
+               this.onSuccess();
        }
 
        cleanupPayload = (mode, vld) => {
index 8870dfc..fa09d9f 100644 (file)
@@ -137,7 +137,7 @@ class NsVirtualLinks extends React.Component {
                let nsd = nsr.nsd && nsr.nsd;
 
                nsr['decorated-vlrs'] && nsr['decorated-vlrs'].map((vlr, vlrIndex) => {
-                       let name = vlr.name || 'New virtual link being created';
+                       let name = vlr.name || 'Undergoing virtual link operation';
                        let operationalStatus = vlr['operational-status'];
                        let vlrId = vlr['id'];
                        let vldId = vlr['vld-ref'];
@@ -208,7 +208,7 @@ class NsVirtualLinks extends React.Component {
                        <div className="launchpadCard_title" style={{textAlign:'right'}}><span style={{float:'left'}}>VLD DETAILS</span>
                                        </div>
                        {
-                               <NSVirtualLinkCreate vld={this.state.editingVirtualLink} mode={this.state.mode} nsd={this.state.nsd} nsrId={this.state.nsrId} onCancel={this.handleCancelCreate}/>
+                               <NSVirtualLinkCreate vld={this.state.editingVirtualLink} mode={this.state.mode} nsd={this.state.nsd} nsrId={this.state.nsrId} onSuccess={this.resetState.bind(this)} onCancel={this.handleCancelCreate}/>
                        }
                 </div>
             );
index bcb8252..782f322 100644 (file)
@@ -42,7 +42,7 @@ export default {
           }
           console.log(nsr_id)
           $.ajax({
-            url: '//' + window.location.hostname + ':' + NODE_PORT + '/socket-polling?api_server=' + API_SERVER,
+            url: '//' + window.location.hostname + ':' + window.location.port + '/socket-polling',
             type: 'POST',
             beforeSend: Utils.addAuthorizationStub,
             data: {
index b9af78a..726757f 100644 (file)
@@ -83,6 +83,9 @@ if (cluster.isMaster && clusteredLaunch) {
 
        var sslOptions = null;
 
+       var apiServer = argv['api-server'] ? argv['api-server'] : 'localhost';
+       var uploadServer = argv['upload-server'] ? argv['upload-server'] : null;
+
        try {
                if (argv['enable-https']) {
                        var keyFilePath = argv['keyfile-path'];
@@ -194,9 +197,16 @@ if (cluster.isMaster && clusteredLaunch) {
                app.use(inactivity_routes);
 
                // Configure global config with ssl enabled/disabled
-               configurationAPI.globalConfiguration.update({
-                       ssl_enabled: httpsConfigured
-               });
+               var globalConfig = {
+                       ssl_enabled: httpsConfigured,
+                       api_server: apiServer
+               };
+
+               if (uploadServer) {
+                       globalConfig.upload_server = uploadServer;
+               }
+
+               configurationAPI.globalConfiguration.update(globalConfig);
 
                // Configure configuration route(s)
                app.use(configuration_routes);