aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhangab <zhanganbing@chinamobile.com>2018-05-15 17:51:02 +0800
committerzhangab <zhanganbing@chinamobile.com>2018-05-15 17:51:57 +0800
commit1ab6dcbbb3c804615c6a8bcef875f231a3b11885 (patch)
tree6e75630ef8aafdfce217353e4c3e576622d3768b
parent3316e8d2a893fcaf8cddff1dd47fa0d6d106487c (diff)
fix service scaling bug
Change-Id: Ibc7ab6a671d755df5ca10ae16fa088b41afea33b Issue-ID: USECASEUI-115 Signed-off-by: zhangab <zhanganbing@chinamobile.com>
-rw-r--r--usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js36
-rw-r--r--usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/scale-service-dialog.html (renamed from usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/scale-service-dialog.html)8
2 files changed, 21 insertions, 23 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 () {
diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/scale-service-dialog.html b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/scale-service-dialog.html
index 3b4aaaf4..19fa8edd 100644
--- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/view-models/scale-service-dialog.html
+++ b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/scale-service-dialog.html
@@ -34,7 +34,7 @@
<span class="required">*</span>
</label>
<div class="col-sm-7">
- <input type="text" id="svcName" name="svcName" class="form-control" placeholder="aspectId" maxlength="256" ng-model="ctrl.aspectId"/>
+ <input type="text" id="svcName" name="svcName" class="form-control" placeholder="aspectId" maxlength="256" ng-model="nsdata.aspectId"/>
</div>
</div>
<div class="mT15 form-group" style="margin-left:25px;">
@@ -43,7 +43,7 @@
<span class="required">*</span>
</label>
<div class="col-sm-7">
- <input type="text" id="svcDesc" name="" class="form-control" placeholder="numberOfStep" maxlength="256" ng-model="ctrl.numberOfStep"/>
+ <input type="text" id="svcDesc" name="" class="form-control" placeholder="numberOfStep" maxlength="256" ng-model="nsdata.numberOfStep"/>
</div>
</div>
<div class="form-group" style="margin-left:25px;margin-bottom:15px;">
@@ -52,7 +52,7 @@
<span class="required">*</span>
</label>
<div class="col-sm-7">
- <select class="form-control" style="padding-top: 0px;padding-bottom: 0px;" id="svcTempl" name="svcTempl" ng-change="" ng-model="ctrl.scaleType" ng-options="template for template in ctrl.scaleTypes">
+ <select class="form-control" style="padding-top: 0px;padding-bottom: 0px;" id="svcTempl" name="svcTempl" ng-change="" ng-model="nsdata.scaleType" ng-options="template for template in ctrl.scaleTypes">
<option value="">--select--</option>
</select>
</div>
@@ -63,7 +63,7 @@
<span class="required">*</span>
</label>
<div class="col-sm-7">
- <select class="form-control" style="padding-top: 0px;padding-bottom: 0px;" id="svcTempl" name="svcTempl" ng-change="" ng-model="ctrl.scalingDirection" ng-options="template for template in ctrl.scalingDirections">
+ <select class="form-control" style="padding-top: 0px;padding-bottom: 0px;" id="svcTempl" name="svcTempl" ng-change="" ng-model="nsdata.scalingDirection" ng-options="template for template in ctrl.scalingDirections">
<option value="">--select--</option>
</select>
</div>