diff options
Diffstat (limited to 'vid-app-common/src/main/webapp')
10 files changed, 165 insertions, 52 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js index 716a99c0..84cb5ad7 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js @@ -107,7 +107,7 @@ appDS2.constant("VIDCONFIGURATION", (function() { var SCHEDULER_PORTAL_URL = "";
- var SCALE_OUT_CONTROLLERS = ["", "SDN-C", "APP-C"];
+ var SCALE_OUT_CONTROLLERS = ["", "SDNC", "APPC"];
return {
ASDC_MODEL_STATUS : ASDC_MODEL_STATUS,
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js index cbb93571..b52b463b 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js @@ -111,14 +111,29 @@ $scope.createType = COMPONENT.A_LA_CARTE;
$scope.deployService = function(service) {
-
-
+
+
console.log("Instantiating SDC service " + service.uuid);
$http.get(COMPONENT.SERVICES_PATH + service.uuid)
.then(function successCallback(getServiceResponse) {
var serviceModel = getServiceResponse.data;
+
+ //VID-233 bug fix when models doesn't exists
+ if(typeof(serviceModel)==="string"){ //not an object
+ $scope.status = FIELD.STATUS.FAILED_SERVICE_MODELS_ASDC;
+ $scope.error = true;
+ $scope.isSpinnerVisible = false;
+ $scope.isProgressVisible = true;
+ return;
+ } else{ //clean error message
+ $scope.status = "";
+ $scope.error = false;
+ $scope.isSpinnerVisible = false;
+ $scope.isProgressVisible = false;
+ }
+
DataService.setServiceName(serviceModel.service.name);
//VOLTE services need input list generated and macro style
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js index 9715484d..cdda3a14 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js @@ -21,7 +21,7 @@ "use strict"; var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log, - DeleteResumeService, CreationService, UtilityService) { + DeleteResumeService, CreationService, DataService, UtilityService) { $scope.isDialogVisible = false; $scope.summaryControl = {}; @@ -32,6 +32,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t $scope.$on(COMPONENT.DELETE_RESUME_COMPONENT, function(event, request) { + $scope.isE2EService = false; $scope.isDataVisible = false; $scope.isSpinnerVisible = false; $scope.isErrorVisible = false; @@ -41,6 +42,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t $scope.dialogMethod = request.dialogMethod; callbackFunction = request.callbackFunction; componentId = request.componentId; + $scope.isServiceInstance = componentId === "service"; DeleteResumeService.initializeComponent(request.componentId); @@ -69,6 +71,8 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t } $scope.confirm = function() { + DataService.setE2EService($scope.isE2EService); //VoLTE support + var requiredFields = $scope.userProvidedControl.getRequiredFields(); if (requiredFields === "") { $scope.isErrorVisible = false; @@ -96,7 +100,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t var requestDetails = DeleteResumeService.getMsoRequestDetails($scope.userProvidedControl.getList()); - if(DeleteResumeService.isMacro === true){ + if(!DataService.getE2EService() && DeleteResumeService.isMacro === true){ requestDetails.requestParameters.aLaCarte = false; } @@ -144,5 +148,5 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t } appDS2.controller("deleteResumeDialogController", [ "COMPONENT", "FIELD", "$scope", "$http", - "$timeout", "$log", "DeleteResumeService","CreationService", "UtilityService", + "$timeout", "$log", "DeleteResumeService","CreationService", "DataService", "UtilityService", deleteResumeDialogController]); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js index 26b1819b..e4ff1a06 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js @@ -14,11 +14,11 @@ vm.wizardStep = 1; vm.nextStep = function(){ vm.wizardStep++; - $(".modal-dialog").animate({"width":"1000px"},400,'linear'); + $(".modal-dialog").animate({"width":"1200px"},400,'linear'); }; vm.prevStep = function(){ vm.wizardStep--; - $(".modal-dialog").animate({"width":"6000px"},400,'linear'); + $(".modal-dialog").animate({"width":"600px"},400,'linear'); }; vm.softwareVersionRegex = "[-a-zA-Z0-9\.]+"; @@ -60,11 +60,35 @@ _.each(response.data.vnfs, function (vnf) { if (newVNFName["invariant-id"] === vnf.invariantUuid) { availableVersions.push(extractVNFModel(vnf, response.data.service, newVNFName)); - newVNFName.vfModules = vnf.vfModules; //for scale out screen - newVNFName.category = response.data.service.category; - newVNFName.groupModules = _.groupBy(newVNFName.vfModules, "customizationUuid"); + if(service.uuid === newVNFName["service-instance-node"][0].properties["model-version-id"]) { + newVNFName.vfModules = vnf.vfModules; + newVNFName.category = response.data.service.category; + newVNFName.groupModules = _.groupBy(newVNFName.vfModules, "customizationUuid"); + + //list vfmodules ids in AAI that belong to that vnf instance + var modulesAaiIds = _.filter(newVNFName.relatedTo, function(item){ + return item["node-type"] === "vf-module"; + }).map(function(item){ + return item.id; + }); + + _.forEach(newVNFName.vfModules, function (mdl, key) { + mdl.scale = false; //defaults to not scale unless user changes it + if(mdl.properties && mdl.properties.max_vf_module_instances) { + + //how many vf modules of the same customizationId belong to that vnf instance + mdl.currentCount = _.filter(vm.vfModules, function(item){ + return modulesAaiIds.indexOf(item.id) > -1 && item.properties["model-customization-id"] === mdl.customizationUuid; + }).length; + + mdl.scalable = mdl.properties.max_vf_module_instances.value - mdl.currentCount > 0; + }else{ + mdl.scalable = false; + } + }); + } } }); var versions = _.uniqBy(availableVersions, 'modelInfo.modelVersion'); @@ -194,18 +218,19 @@ payload: changeManagement.configUpdateFile } }else if(workflowType=="VNF Scale Out"){ + if(!moduleToScale) return null; if(moduleToScale.userParams) { requestParametersData = { controllerType: changeManagement.controllerType, - userParams: moduleToScale.userParams, - usePreload: true + userParams: moduleToScale.userParams + //,usePreload: true } }else{ requestParametersData = { controllerType: changeManagement.controllerType, - userParams: [], - usePreload: false + userParams: [] + //,usePreload: false } } } @@ -230,22 +255,20 @@ var data; if(workflowType=="VNF Scale Out") { - var name = moduleToScale.modelCustomizationName.split('-')[0]; //example: vSAMP12..base..module-0 - name = name + "-" + vnf.groupModules[moduleToScale.customizationUuid].length; - data = { modelInfo: { modelType: 'vfModule', modelInvariantId: moduleToScale.invariantUuid, - modelName: name, + modelName: moduleToScale.modelCustomizationName, modelVersion: moduleToScale.version, - modelCustomizationId: moduleToScale.customizationUuid + modelVersionId: moduleToScale.uuid }, cloudConfiguration: vnf.cloudConfiguration, requestInfo: requestInfoData, relatedInstanceList: [], requestParameters:requestParametersData - } + }; + requestInfoData.instanceName = vnf.name + "_" + (moduleToScale.currentCount + 1); }else{ data = { vnfName: vnf.name, @@ -263,7 +286,7 @@ requestInfo: requestInfoData, relatedInstanceList: [], requestParameters:requestParametersData - } + }; } var serviceInstanceId = ''; @@ -293,7 +316,22 @@ data.relatedInstanceList.push({relatedInstance: relatedInstance}); }); - } + if(workflowType=="VNF Scale Out") { + //push vnf to related as well as the service instance + var relatedInstance = { + instanceId: vnf.id, + modelInfo: { + modelCustomizationName: vnf.availableVersions[0].modelInfo.modelCustomizationName, + modelInvariantId: vnf.availableVersions[0].modelInfo.modelInvariantId, + modelName: vnf.availableVersions[0].modelInfo.modelName, + modelType: vnf.availableVersions[0].modelInfo.modelType, + modelVersion: vnf.availableVersions[0].modelInfo.modelVersion, + modelVersionId: vnf.availableVersions[0].modelInfo.modelVersionId + } + }; + data.relatedInstanceList.push({relatedInstance: relatedInstance}); + } + } }catch(err){ $log.error('SchedulerCtrl::extractChangeManagementCallbackDataStr error: ' + err); } @@ -322,9 +360,18 @@ } else { //no scheduling support var dataToSo = extractChangeManagementCallbackDataStr(vm.changeManagement); - //TODO: foreach - var vnfName = vm.changeManagement.vnfNames[0].name; - changeManagementService.postChangeManagementNow(dataToSo, vnfName); + if(dataToSo) { + + if(vm.changeManagement.workflow==="VNF Scale Out") { + dataToSo = JSON.parse(dataToSo); + dataToSo = {requestDetails: dataToSo.requestDetails[0]}; + changeManagementService.postChangeManagementScaleOutNow(dataToSo, vm.changeManagement.vnfNames[0]["service-instance-node"][0].properties["service-instance-id"], vm.changeManagement.vnfNames[0].id); + }else{ + //TODO: foreach + var vnfName = vm.changeManagement.vnfNames[0].name; + changeManagementService.postChangeManagementNow(dataToSo, vnfName); + } + } } }; @@ -356,6 +403,7 @@ // var promiseArrOfGetVnfs = preparePromiseArrOfGetVnfs(instances); vm.vnfs = []; + vm.vfModules = []; AaiService.getVnfsByCustomerIdAndServiceType( vm.changeManagement.subscriberId, @@ -374,6 +422,8 @@ } } else if (nodeType === "service-instance") { vm.serviceInstances.push(vnfsData[i]); + } else if (nodeType === "vf-module") { + vm.vfModules.push(vnfsData[i]); } } } diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css index 34a6af45..1f743ab7 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css @@ -3,7 +3,7 @@ display: flex; } .scale-out-modules .table-row > div { - text-indent: 12px; + padding: 0 12px; color: #5A5A5A; font-size: 13px; border-right: 1px solid #D2D2D2; @@ -17,16 +17,16 @@ font-size: 22px; } .scale-out-modules .table-row > div:nth-child(2) { - flex: 220px 1 0; + flex: 200px 1 0; } .scale-out-modules .table-row > div:nth-child(3) { flex: 200px 1 0; } .scale-out-modules .table-row > div:nth-child(4), .scale-out-modules .table-row > div:nth-child(5) { - flex: 150px 0 0; + flex: 110px 0 0; } .scale-out-modules .table-row > div:nth-child(6), .scale-out-modules .table-row > div:nth-child(7) { - flex: 120px 0 0; + flex: 130px 0 0; } .scale-out-modules .table-row.open > div { line-height: 29px; @@ -62,7 +62,7 @@ margin-left: 60px; } .scale-out-modules .modules-table .table-row > div:nth-child(1) { - flex: 539px 0 0; + flex: 300px 1 0; font-size: 13px; } .scale-out-modules .modules-table .table-row > div:nth-child(2) { @@ -71,11 +71,15 @@ .scale-out-modules .modules-table .table-row > div:nth-child(3) { flex: 90px 0 0; } +.scale-out-modules .modules-table .table-row > div:nth-child(3) input { + width: 60px; + margin-top: 10px; +} .scale-out-modules .modules-table .table-row > div:nth-child(4) { flex: 180px 0 0; } .scale-out-modules .modules-table .table-row > div:nth-child(5) { - flex: 110px 0 0; + flex: 280px 0 0; } .scale-out-modules .modules-table.open { display: block; @@ -93,7 +97,7 @@ display:flex; > div { - text-indent:12px; + padding: 0 12px; color: #5A5A5A; font-size:13px; border-right:1px solid #D2D2D2; @@ -108,16 +112,16 @@ font-size:22px; } &:nth-child(2){ - flex:220px 1 0; + flex:200px 1 0; } &:nth-child(3){ flex:200px 1 0; } &:nth-child(4), &:nth-child(5){ - flex:150px 0 0; + flex:110px 0 0; } &:nth-child(6), &:nth-child(7){ - flex:120px 0 0; + flex:130px 0 0; } } @@ -162,7 +166,7 @@ & > div{ &:nth-child(1){ - flex:539px 0 0; + flex:300px 1 0; font-size:13px; } &:nth-child(2){ @@ -170,12 +174,17 @@ } &:nth-child(3){ flex:90px 0 0; + + input { + width: 60px; + margin-top: 10px; + } } &:nth-child(4){ flex:180px 0 0; } &:nth-child(5){ - flex:110px 0 0; + flex:280px 0 0; } } } diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html index bf3579ea..9954d5ae 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html @@ -106,9 +106,9 @@ <div>Invariant UUID</div> </div> - <div class="table-row" ng-repeat-start="vnf in vm.changeManagement.vnfNames" ng-if="vnf['prov-status'] === 'PROV'" ng-click="vnf.isOpen=!!!vnf.isOpen"> - <div>+</div> - <div>{{vnf['service-instance-node'].properties['service-instance-name']}}</div> + <div class="table-row" ng-repeat-start="vnf in vm.changeManagement.vnfNames" ng-click="vnf.isOpen=!!!vnf.isOpen"> + <div>{{vnf.isOpen ? '-' : '+'}}</div> + <div>{{vnf['service-instance-node'][0].properties['service-instance-name']}}</div> <div>{{vnf.name}}</div> <div>{{vnf['availableVersions'][0].modelInfo.modelVersion}}</div> <div>{{vnf.category}}</div> @@ -127,13 +127,13 @@ <div class="table-row" ng-repeat="(custUUID, moduleArr) in vnf.groupModules"> <div>{{moduleArr[0].modelCustomizationName}}</div> <div>{{moduleArr.length}}</div> - <div ng-if="moduleArr[0].properties.minCountInstances == moduleArr[0].properties.maxCountInstances">N/A</div> - <div ng-if="moduleArr[0].properties.minCountInstances != moduleArr[0].properties.maxCountInstances"> - <input type="number" ng-model="moduleArr[0].scale" step="1" - ng-min="moduleArr[0].properties.minCountInstances" ng-max="moduleArr[0].properties.maxCountInstances - moduleArr.length" /> + <div ng-if="!moduleArr[0].scalable">N/A</div> + <div ng-if="moduleArr[0].scalable"> + <input type="checkbox" ng-model="moduleArr[0].scale" /> </div> <div>{{moduleArr[0].uuid}}</div> - <div> + <div ng-if="!moduleArr[0].scalable">N/A</div> + <div ng-if="moduleArr[0].scalable"> <input type="file" accept="application/json" onchange="angular.element(this).scope().setPreload(this)" /> </div> </div> @@ -142,10 +142,13 @@ </div> <div class="modal-footer"> + <div class="pull-left"> + <button ng-if="vm.wizardStep === 2" ng-click="vm.prevStep();" type="button" id="back" name="back" class="btn btn-primary">Back</button> + </div> <div class="pull-right"> + <button type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button> <button ng-if="!vm.isScaleOut() || (vm.isScaleOut() && vm.wizardStep === 2)" type="submit" id="submit" name="submit" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">{{vm.hasScheduler ? "Schedule" : "Confirm"}}</button> <button ng-if="vm.isScaleOut() && vm.wizardStep === 1" ng-click="vm.nextStep();" type="button" id="next" name="next" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">Next</button> - <button type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button> </div> </div> </form> diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js index f170c418..03e41b2c 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js @@ -87,5 +87,16 @@ return {data: []}; }); }; + + this.postChangeManagementScaleOutNow = function (requestData, serviceInstanceId, vnfId) { + var url = "mso/mso_create_vfmodule_instance/"+serviceInstanceId+"/vnfs/"+vnfId; + return $http.post(url, requestData) + .success(function (response) { + return {data: response}; + }) + .catch(function (err) { + return {data: []}; + }); + }; } })(); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js index 90daf355..3255bc9a 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js @@ -266,8 +266,10 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService, + DataService.getServiceInstanceId() + "/networks/" + DataService.getNetworkInstanceId(); case COMPONENT.SERVICE: - return "mso_delete_svc_instance/" - + DataService.getServiceInstanceId(); + if(DataService.getE2EService() === true) + return "mso_delete_e2e_svc_instance/"+ DataService.getServiceInstanceId(); + else + return "mso_delete_svc_instance/"+ DataService.getServiceInstanceId(); case COMPONENT.VNF: return "mso_delete_vnf_instance/" + DataService.getServiceInstanceId() + "/vnfs/" @@ -291,9 +293,22 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService, value : value }); }; - + + var getMsoE2ERequest = function(parameterList) { + return { + "globalSubscriberId": DataService.getSubscriberName(), + "serviceType": DataService.getServiceType() + }; + }; + var getMsoRequestDetails = function(parameterList) { console.log("getMsoRequestDetails invoked"); + + //VoLTE logic goes here + if(DataService.getE2EService() === true) { + return getMsoE2ERequest(parameterList); + } + var inventoryInfo = ComponentService.getInventoryInfo( _this.componentId, DataService.getInventoryItem()); var modelInfo = DataService.getModelInfo(_this.componentId); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm index ccd54a61..efaca5bd 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm @@ -32,7 +32,13 @@ </div> <parameter-block control="summaryControl"></parameter-block> - + + <!-- tell VID if it's an E2E VoLTE service--> + <div style="margin-left: 15px" ng-show="isServiceInstance"> + <input type="checkbox" ng-model="isE2EService" /> + This is an E2E (VoLTE) service instance + </div> + <div ngx-visible="{{isDataVisible}}"> <h4> diff --git a/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css b/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css index 7d8af00b..fb97a947 100644 --- a/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css +++ b/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css @@ -4,7 +4,7 @@ } .modal-content { - width: 587px; + /*width: 587px;*/ border-radius: 8px; background-color: #ffffff; font-family: "OpenSans-Regular"; |