diff options
7 files changed, 112 insertions, 30 deletions
diff --git a/openo-portal/portal-auth/src/main/webapp/user/js/user.js b/openo-portal/portal-auth/src/main/webapp/user/js/user.js index 11f2326c..9a36522f 100644 --- a/openo-portal/portal-auth/src/main/webapp/user/js/user.js +++ b/openo-portal/portal-auth/src/main/webapp/user/js/user.js @@ -32,6 +32,14 @@ $(document).ready(function() { }).error(function(data) { if (data.status == 403) { $(".hw_body").html("<span style='font-size:20px;'>" + JSON.parse(data.responseText).error.message + "</span>"); + } else { + var userListHeader = [ + { title: "User", data: "User",width: "20%"}, + { title: "Description", data: "Description",width: "60%"}, + { title: "Operations", data: "Operations",width: "20%"} + ]; + Table.create("", "table_id", userListHeader); + $(".hw_body").css("visibility", "visible"); } }); diff --git a/openo-portal/portal-common/src/main/webapp/common/json/menu_list.json b/openo-portal/portal-common/src/main/webapp/common/json/menu_list.json index 148b4bab..e4b0c3ad 100644 --- a/openo-portal/portal-common/src/main/webapp/common/json/menu_list.json +++ b/openo-portal/portal-common/src/main/webapp/common/json/menu_list.json @@ -40,17 +40,11 @@ }, { "parentId":"openo_menu_resource_mgr", - "id":"openo_menu_resource_mgr_sdno", + "id":"openo_menu_resource_mgr", "url":"../resmgr-sdn/resource.html", "iconClass":"fa fa-folder-open-o" }, { - "parentId":"openo_menu_resource_mgr", - "id":"openo_menu_resource_mgr_nfvo", - "url":"../resmgr-nfv/resource.html", - "iconClass":"fa fa-folder-open-o" - }, - { "parentId":"openo_menu_user", "id":"openo_menu_user_user_management", "url":"../user/user.html", diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/brs.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/brs.js index 1c07026d..3dbc7ebd 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/brs.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/brs.js @@ -15,7 +15,7 @@ var url = "";
$.getJSON("./conf/dataconfig.json", function (jsonData){
- url = jsonData.url +":"+ jsonData.port + "/org.openo.sdno.brs";
+ url = jsonData.url +":"+ jsonData.port;
console.log("URL = " + url);
});
@@ -346,4 +346,4 @@ $(function () { });
});
-})
\ No newline at end of file +})
diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js index 37cb05f3..2bfe351a 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js @@ -81,16 +81,94 @@ function initParameterTab() { function generateTemplateParametersComponent(templateId) { var defer = $.Deferred(); $.when( - fetchTemplateParameterDefinitions(templateId) + fetchTemplateParameterDefinitions(templateId), + fetchGsoNestingTemplateParameters(templateId) ).then( - function (templateParameterResponse) { - templateParameters = translateToTemplateParameters(templateParameterResponse.inputs); + function (templateParameterResponse, nestingTempatesParas) { + var inputParas = concat(templateParameterResponse[0].inputs, nestingTempatesParas); + templateParameters = translateToTemplateParameters(inputParas); defer.resolve(transformToComponents(templateParameters.parameters)); } ); return defer; } +function fetchGsoNestingTemplateParameters(templateId) { + var defer = $.Deferred(); + var nestingParams = []; + $.when( + fetchServiceTemplateBy(templateId) + ).then( + function(template) { + if(template.serviceType === 'GSO') { + return fetchNodeTemplates(templateId); + } + // There are no nesting template parameters for non GSO. + defer.resolve([]); + } + ).then( + function(nodeTemplates) { + var count = nodeTemplates.length; + if(count ===0) { + defer.resolve([]); + return; + } + var params = $.Deferred(); + params.progress(function(inputs) { + pushAll(nestingParams, inputs); + count--; + if(count === 0) { + defer.resolve(nestingParams); + } + }); + nodeTemplates.forEach(function(nodeTemplate) { + var nestingNodeUri = '/openoapi/catalog/v1/servicetemplates/nesting?nodeTypeIds=' + nodeTemplate.type; + $.when( + $.ajax({ + type: "GET", + url: nestingNodeUri + }) + ).then( + function(serviceTemplates) { + var oneNodeParameters = [] + serviceTemplates.forEach(function(serviceTemplate) { + pushAll(oneNodeParameters, serviceTemplate.inputs.map(function(input) { + input.name = nodeTemplate.type + '.' + input.name; + return input; + })); + }) + params.notify(oneNodeParameters); + } + ); + }); + } + ); + return defer; +} + +function fetchNodeTemplates(templateId) { + var nodeTemplateUri = '/openoapi/catalog/v1/servicetemplates/'+ templateId +'/nodetemplates'; + return $.ajax({ + type: "GET", + url: nodeTemplateUri + }); +} + +function concat(array1, array2) { + var result = []; + pushAll(result, array1); + pushAll(result, array2); + return result; +} + +function pushAll(acc, array) { + var result = acc; + array.forEach(function(element) { + result.push(element) + }) + return result; +} + function generateLocationComponent(templateId) { var defer = $.Deferred(); $.when( @@ -142,7 +220,7 @@ function translateToTemplateParameters(inputs) { defaultValue: inputs[i].defaultValue, required: inputs[i].required, id: 'parameter_' + i, - value: inputs[i].defaultValue + value: inputs[i].defaultValue || '' }; } return {changed: false, parameters: inputParameters}; @@ -259,15 +337,17 @@ function createNetworkServiceInstance(template, serviceInstance, gatewayService) function createGsoServiceInstance(gatewayService, serviceInstance, serviceTemplate) { var defer = $.Deferred(); serviceInstance.inputParameters.location = serviceInstance.vimLocation; - var gsoLcmUri = '/openoapi/lifecyclemgr/v1/services'; + var gsoLcmUri = '/openoapi/gso/v1/services'; var parameter = { - 'name': serviceInstance.serviceName, - 'description': serviceInstance.description, - 'serviceDefId': serviceTemplate.gsarId, - 'templateId': serviceInstance.serviceTemplateId, - 'templateName': serviceTemplate.templateName, - 'gatewayUri': gsoLcmUri, - 'parameters': serviceInstance.inputParameters + 'service': { + 'name': serviceInstance.serviceName, + 'description': serviceInstance.description, + 'serviceDefId': serviceTemplate.gsarId, + 'templateId': serviceInstance.serviceTemplateId, + 'templateName': serviceTemplate.templateName, + 'gatewayUri': gsoLcmUri, + 'parameters': serviceInstance.inputParameters + } }; $.when($.ajax({ type: "POST", @@ -289,7 +369,7 @@ function createNfvoServiceInstance(gatewayService, serviceInstance) { } function createSdnoServiceInstance(gatewayService, serviceInstance) { - var sdnoLcmNsUri = '/openoapi/sdnonslcm/v1.0/ns'; + var sdnoLcmNsUri = '/openoapi/sdnonslcm/v1/ns'; return createServiceInstance(gatewayService, sdnoLcmNsUri, serviceInstance); } @@ -308,7 +388,7 @@ function createServiceInstance(gatewayService, nsUri, serviceInstance) { dataType: "json", data: JSON.stringify(sParameter) })).then(function(response) { - var nsInstanceId = response.nsInstanceId; + var nsInstanceId = response.serviceId; serviceInstance.serviceId = nsInstanceId; var initNsUrl = nsUri + '/' + nsInstanceId + '/Instantiate'; var parameter = { @@ -367,13 +447,13 @@ function deleteNe(rowId, row) { var nfvoNsUri = '/openoapi/nslcm/v1.0/ns'; deleteNonGsoServiceInstance(gatewayService, nfvoNsUri, instanceId, remove); } else if (serviceType === 'SDNO') { - var sdnoNsUri = '/openoapi/sdnonslcm/v1.0/ns'; + var sdnoNsUri = '/openoapi/sdnonslcm/v1/ns'; deleteNonGsoServiceInstance(gatewayService, sdnoNsUri, instanceId, remove); } } function deleteGsoServiceInstance(gatewayService, instanceId, remove) { - var gsoLcmUri = '/openoapi/lifecyclemgr/v1/services'; + var gsoLcmUri = '/openoapi/gso/v1/services'; $.when( deleteNetworkServiceInstance(gatewayService, gsoLcmUri, instanceId) ).then( diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/rest.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/rest.js index 8fce8c64..ae8a0474 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/rest.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/rest.js @@ -91,7 +91,7 @@ $(function () { var jsonobj = JSON.parse(formData);
var newJson = {"managedElement": jsonobj};
formData = JSON.stringify(newJson);
- var requestUrl = url + "/org.openo.sdno.brs/openoapi/sdnobrs/v1/managed-elements";
+ var requestUrl = url + "/openoapi/sdnobrs/v1/managed-elements";
$
.ajax({
type : "POST",
diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/vpn.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/vpn.js index f12ec533..f898e3de 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/vpn.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/vpn.js @@ -15,7 +15,7 @@ var url = "";
$.getJSON("./conf/dataconfig.json", function (jsonData){
- url = jsonData.url +":"+ jsonData.port + "/org.openo.sdno.brs";
+ url = jsonData.url +":"+ jsonData.port;
console.log("URL = " + url);
});
@@ -309,4 +309,4 @@ $(function () { });
});
-})
\ No newline at end of file +})
diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/js/brs.js b/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/js/brs.js index df28de3f..b9cace8a 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/js/brs.js +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/js/brs.js @@ -14,7 +14,7 @@ */
var url = "";
$.getJSON("./conf/dataconfig.json", function (jsonData){
- url = jsonData.url +":"+ jsonData.port + "/org.openo.sdno.brs";
+ url = jsonData.url +":"+ jsonData.port;
console.log("URL = " + url);
});
@@ -344,4 +344,4 @@ $(function () { });
});
-})
\ No newline at end of file +})
|