diff options
author | Luji7 <lu.ji3@zte.com.cn> | 2016-11-04 10:25:10 +0800 |
---|---|---|
committer | Luji7 <lu.ji3@zte.com.cn> | 2016-11-04 10:25:10 +0800 |
commit | cf298fc4149e52135d5a712b345ac206abfc88cb (patch) | |
tree | 41c9e479aff0fdd1f243e14e7a3b683d0e8720f0 /openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js | |
parent | 140ae02914dbe36648c0d4e4c85b670f558b66b5 (diff) |
Issue ID: GSO-60 merge changes from sun release
Change-Id: I9949e242644711a07a8da7a22dfbaf19ee7d74bd
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
Diffstat (limited to 'openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js')
-rw-r--r-- | openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js | 43 |
1 files changed, 28 insertions, 15 deletions
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 d5549ebb..498a86c0 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 @@ -118,11 +118,11 @@ function initParameterTab() { ).then( function(template) { if(template.serviceType === 'GSO') { - return fetchGsoTemplateInputParameters(templateId); + return fetchGsoTemplateInputParameters(templateId, template); } else if(template.serviceType === 'NFVO') { - return fetchNfvoTemplateInputParameters(templateId); + return fetchNfvoTemplateInputParameters(templateId, template); } else if(template.serviceType === 'SDNO') { - return fetchSdnoTemplateInputParameters(templateId); + return fetchSdnoTemplateInputParameters(templateId, template); } } ).then( @@ -148,6 +148,7 @@ function fetchServiceTemplateBy(templateId) { template.name = response.templateName; template.gsarId = response.csarId; template.id = response.id; + template.nodeType = ''; return fetchCsar(template.gsarId); } ).then( @@ -174,7 +175,7 @@ function fetchCsar(csarId) { }); } -function fetchGsoTemplateInputParameters(templateId) { +function fetchGsoTemplateInputParameters(templateId, template) { var defer = $.Deferred(); $.when( fetchTemplateParameterDefinitions(templateId), @@ -185,6 +186,11 @@ function fetchGsoTemplateInputParameters(templateId) { function (templateParameterResponse, nestingTempatesParas, vimInfoResponse, sdnControllersResponse) { var inputs = templateParameterResponse[0].inputs.map(function(input) { input.showName = input.name; + if(template.nodeType === null || template.nodeType === undefined || template.nodeType.length === 0) { + input.i18nKey = input.name; + } else { + input.i18nKey = template.nodeType + '.' +input.name; + } return input; }); var inputParas = concat(inputs, nestingTempatesParas); @@ -232,6 +238,7 @@ function fetchGsoNestingTemplateParameters(templateId) { var inputs = serviceTemplate.inputs.map(function(input) { input.showName = input.name; input.name = nodeTemplate.type + '.' + input.name; + input.i18nKey = nodeTemplate.type + '.' + input.name; return input; }); $.when( @@ -244,14 +251,16 @@ function fetchGsoNestingTemplateParameters(templateId) { type: 'location', description: nodeTemplate.name + ' Location', required: 'true', - showName: nodeTemplate.name + ' Location' + showName: nodeTemplate.name + ' Location', + i18nKey: nodeTemplate.name + ' Location' }); inputs.push({ name: nodeTemplate.type + '.sdncontroller', type: 'sdncontroller', description: nodeTemplate.name + ' SDN Controller', required: 'true', - showName: nodeTemplate.name + ' SDN Controller' + showName: nodeTemplate.name + ' SDN Controller', + i18nKey: nodeTemplate.name + ' SDN Controller' }); } nodeAggregatation.notify(inputs); @@ -321,7 +330,7 @@ function translateToTemplateParameters(inputs, vims, controllers) { return {changed: false, parameters: inputParameters, vimInfos: vims, sdnControllers: controllers}; } -function fetchNfvoTemplateInputParameters(templateId) { +function fetchNfvoTemplateInputParameters(templateId, template) { var defer = $.Deferred(); $.when( fetchTemplateParameterDefinitions(templateId), @@ -334,6 +343,7 @@ function fetchNfvoTemplateInputParameters(templateId) { var inputParas = templateParameterResponse[0].inputs; inputParas = inputParas.map(function(input) { input.showName = input.name; + input.i18nKey = template.nodeType + '.' + input.name; return input; }); inputParas.push({ @@ -341,14 +351,16 @@ function fetchNfvoTemplateInputParameters(templateId) { type: 'location', description: 'Location', required: 'true', - showName: 'Location' + showName: 'Location', + i18nKey: 'Location' }); inputParas.push({ name: 'sdncontroller', type: 'sdncontroller', description: 'SDN Controller', required: 'true', - showName: 'SDN Controller' + showName: 'SDN Controller', + i18nKey: 'SDN Controller' }); templateParameters = translateToTemplateParameters(inputParas, vims, sdnControllers); defer.resolve(templateParameters); @@ -357,7 +369,7 @@ function fetchNfvoTemplateInputParameters(templateId) { return defer; } -function fetchSdnoTemplateInputParameters(templateId) { +function fetchSdnoTemplateInputParameters(templateId, template) { var defer = $.Deferred(); $.when( fetchTemplateParameterDefinitions(templateId) @@ -365,6 +377,7 @@ function fetchSdnoTemplateInputParameters(templateId) { function (templateParameterResponse) { var inputs = templateParameterResponse.inputs.map(function(input) { input.showName = input.name; + input.i18nKey = template.nodeType + '.' + input.name; return input; }) templateParameters = translateToTemplateParameters(inputs, [], []); @@ -520,7 +533,7 @@ function createGsoServiceInstance(gatewayService, serviceInstance, serviceTempla serviceInstance.serviceId = response.serviceId; var gsoServiceUri = '/openoapi/gso/v1/services/' + response.serviceId; var timerDefer = $.Deferred(); - var timeout = 600000; + var timeout = 3600000; var fun = function() { if(timeout === 0) { timerDefer.resolve({ @@ -620,7 +633,7 @@ function createServiceInstance(gatewayService, lcmUri, serviceInstance) { var jobId = response.serviceId; var jobStatusUri = lcmUri + '/jobs/' + jobId; var timerDefer = $.Deferred(); - var timeout = 600000; + var timeout = 3600000; var fun = function() { if(timeout === 0) { timerDefer.resolve({ @@ -715,7 +728,7 @@ function deleteNe(rowId, row) { } else if (serviceType === 'NFVO') { var nfvoLcmUri = '/openoapi/nslcm/v1'; deleteNonGsoServiceInstance(gatewayService, nfvoLcmUri, instanceId, remove, failFun); - } else if (serviceType === 'SDNO' || serviceType === 'SSAR') { + } else if (serviceType === 'SDNO') { var sdnoLcmUri = '/openoapi/sdnonslcm/v1'; deleteNonGsoServiceInstance(gatewayService, sdnoLcmUri, instanceId, remove, failFun); } @@ -732,7 +745,7 @@ function deleteGsoServiceInstance(gatewayService, instanceId, remove, failFun) { function(response) { var gsoServiceUri = '/openoapi/gso/v1/services/toposequence/' + instanceId; var timerDefer = $.Deferred(); - var timeout = 600000; + var timeout = 3600000; var fun = function() { if(timeout === 0) { timerDefer.resolve({ @@ -779,7 +792,7 @@ function deleteNonGsoServiceInstance(gatewayService, lcmUri, instanceId, remove, var jobId = response.jobId; var jobStatusUri = lcmUri + '/jobs/' + jobId; var timerDefer = $.Deferred(); - var timeout = 600000; + var timeout = 3600000; var fun = function() { if(timeout === 0) { timerDefer.resolve({ |