diff options
author | 2018-05-15 17:51:02 +0800 | |
---|---|---|
committer | 2018-05-15 17:51:57 +0800 | |
commit | 1ab6dcbbb3c804615c6a8bcef875f231a3b11885 (patch) | |
tree | 6e75630ef8aafdfce217353e4c3e576622d3768b /usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller | |
parent | 3316e8d2a893fcaf8cddff1dd47fa0d6d106487c (diff) |
fix service scaling bug
Change-Id: Ibc7ab6a671d755df5ca10ae16fa088b41afea33b
Issue-ID: USECASEUI-115
Signed-off-by: zhangab <zhanganbing@chinamobile.com>
Diffstat (limited to 'usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller')
-rw-r--r-- | usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js index a7091f83..9d404c87 100644 --- a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js +++ b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js @@ -488,38 +488,36 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', ' console.log(customer); console.log(serviceType); console.log(serviceInstance); - + ServiceTemplateService.getScaleServiceDialog(customer.name,serviceType.name,serviceInstance.serviceInstanceId,function(data){ console.log(data.data); ctrl.nsData = data.data; // console.log(ctrl) }) ctrl.scaleTypes = ["SCALE_NS","SCALE_VNF"]; - ctrl.scaleType = ""; ctrl.scalingDirections = ["SCALE_IN","SCALE_OUT"]; - ctrl.scalingDirection = ""; - ctrl.aspectId = null; - ctrl.numberOfStep = null; ctrl.ok = function () { + let resources = []; + ctrl.nsData.forEach(function(item){ + resources.push({ + "resourceInstanceId": item.netWorkServiceId, + "scaleType": item.scaleType, + "scaleNsData": { + "scaleNsByStepsData": { + "aspectId": item.aspectId, + "numberOfSteps": item.numberOfStep, + "scalingDirection": item.scalingDirection + } + } + }) + }) var requestBody = { "service":{ "serviceInstanceName": serviceInstance.serviceInstanceName, - "serviceType": serviceType, + "serviceType": serviceType.value, "globalSubscriberId": serviceInstance.serviceInstanceId, - "resources": [ - { - "resourceInstanceId": "ns111", - "scaleType": ctrl.scaleType, - "scaleNsData": { - "scaleNsByStepsData": { - "aspectId": ctrl.aspectId, - "numberOfSteps": ctrl.numberOfStep, - "scalingDirection": ctrl.scalingDirection - } - } - } - ] + "resources": resources } }; var errorMessage = function () { |