summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhangab <zhanganbing@chinamobile.com>2018-05-15 16:49:07 +0800
committerzhangab <zhanganbing@chinamobile.com>2018-05-15 16:50:04 +0800
commit3316e8d2a893fcaf8cddff1dd47fa0d6d106487c (patch)
treee08964e1a2cd9865e9b62ec1d65d326fc270171b
parenta3591f7fe0b20bd010b6daa5054a919aab6aa5fa (diff)
fix e2e service template bug for ns detail show
Change-Id: I53f0f8273fac3f6e26b69c98882cd78ebe262d6d Issue-ID: USECASEUI-115 Signed-off-by: zhangab <zhanganbing@chinamobile.com>
-rw-r--r--usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js6
-rw-r--r--usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js52
-rw-r--r--usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html41
3 files changed, 77 insertions, 22 deletions
diff --git a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js
index acb61f92..ad1818dd 100644
--- a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js
+++ b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js
@@ -108,6 +108,7 @@
headers: uuiHeaders
}).then(function(response){
var inputRsp = response.data;
+ console.log(inputRsp);
processFun(inputRsp);
});
},
@@ -139,6 +140,7 @@
headers: uuiHeaders
}).then(function(response){
var sdnControllers = response.data;
+ console.log(sdnControllers);
var result = sdnControllers.map(function (sdn) {
return {
name: sdn['thirdparty-sdnc-id'],
@@ -172,7 +174,7 @@
reqParas[parameter.name] = parameter.value.value;
}
} else {
- newreqParas[parameter.name] = parameter.value;
+ reqParas[parameter.name] = parameter.value;
}
});
@@ -222,7 +224,7 @@
// console.log(requestBody);
// console.log(JSON.stringify(requestBody));
- return false;
+ // return false;
return $http({
url: url+'/services',
method: 'POST',
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 ffdb622d..a7091f83 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
@@ -173,7 +173,6 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', '
}
);
-
};
ctrl.deleteService = function (serviceInstance) {
@@ -198,6 +197,55 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', '
ServiceTemplateService.deleteService(serviceInstance.serviceInstanceId, ctrl.customer, ctrl.serviceType, successFun);
};
+ ctrl.upDateService = function (serviceInstance) {
+
+ var modalInstance = $uibModal.open({
+ ariaLabelledBy: 'modal-title',
+ ariaDescribedBy: 'modal-body',
+ templateUrl: 'app/uui/fusion/scripts/view-models/scale-service-dialog.html',
+ controller: 'scaleServiceCtrl',
+ controllerAs: 'ctrl',
+ resolve: {
+ customer: function () {
+ return ctrl.customer;
+ },
+ serviceType: function () {
+ return ctrl.serviceType;
+ },
+ serviceInstance: serviceInstance
+ }
+ });
+ modalInstance.result.then(
+ function (result) {
+ console.log(result);
+ console.log(serviceInstance);
+ var successFun = function (result) {
+ ctrl.alerts.push({
+ type: 'success',
+ msg: result
+ });
+ ServiceTemplateService.getServiceInstances(ctrl.customer.id, ctrl.serviceType.value, function (instances) {
+ ctrl.serviceInstances = instances;
+ });
+ }
+ var failFun = function (reason) {
+ console.log(reason)
+ ctrl.alerts.push({
+ type: 'danger',
+ msg: reason
+ });
+ }
+ openServiceProgressDialog(result.serviceId, result.operationId, 'Scale Service', successFun, failFun);
+ },
+ function (reason) {
+ console.log('receive cancel button clicked!');
+ console.log(reason);
+ $log.info('Modal dismissed at: ' + new Date());
+ }
+ );
+
+ };
+
ctrl.packageOnboard = function (onboardPackage) {
if (onboardPackage.type === 'NS') {
var processFun = function (response) {
@@ -360,6 +408,7 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', '
});
return {
nodeTemplateName: nestedTemplate.name,
+ customizationUuid:nestedTemplate.customizationUuid,
invariantUUID: nestedTemplate.invariantUUID,
uuid: nestedTemplate.uuid,
type: nestedTemplate.type,
@@ -374,6 +423,7 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', '
segments: segmentsPara
};
ctrl.service = service;
+ console.log(service);
};
ctrl.service = {
serviceName: '',
diff --git a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html
index 263656f5..810fe81f 100644
--- a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html
+++ b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/view-models/create-service-dialog.html
@@ -60,24 +60,7 @@
</uib-tab>
<uib-tab heading="Template Parameters">
<div id='templateParasTab' style="margin-top:20px;">
- <div ng-repeat="parameter in ctrl.service.parameters" class="mT15 form-group" style="margin-left:0px;">
- <label class="col-sm-5 control-label">
- <span>{{parameter.name}}</span><span ng-if="parameter.isRequired" class="required">*</span>
- </label>
- <div ng-if="parameter.type === 'string' || parameter.type === 'boolean' || parameter.type === 'integer'" class="col-sm-5">
- <input type="text" name="{{parameter.description}}" class="form-control" ng-model="parameter.value" placeholder="{{parameter.name}}" value="{{parameter.defaultValue}}" ng-readonly="{{parameter.readonly}}"/>
- </div>
- <div ng-if="parameter.type === 'vf_location'" class="col-sm-5">
- <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="parameter.value" ng-options="option.value for option in ctrl.locations">
- <option value="">--select--</option>
- </select>
- </div>
- <div ng-if="parameter.type === 'sdn_controller'" class="col-sm-5">
- <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="parameter.value" ng-options="option.value for option in ctrl.sdnControllers">
- <option value="">--select--</option>
- </select>
- </div>
- </div>
+
<fieldset ng-repeat="segment in ctrl.service.segments" style="margin-left:25px;">
<legend>{{segment.nodeTemplateName}}</legend>
<!-- <div class="form-group" style="margin-left:0px;margin-bottom:5px;">
@@ -101,7 +84,7 @@
<input type="text" name="{{segment_parameter.description}}" class="form-control" ng-model="segment_parameter.value" placeholder="{{segment_parameter.name}}" value="{{segment_parameter.defaultValue}}" ng-readonly="{{segment_parameter.readonly}}"/>
</div>
<div ng-if="segment_parameter.type === 'vf_location'" class="col-sm-5">
- <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="segment_parameter.value" ng-options="option.value for option in ctrl.locations">
+ <select class="form-control" style ="padding-top: 1px;padding-bottom: 0px;" ng-model="segment_parameter.value" ng-options="option.name for option in ctrl.locations">
<option value="">--select--</option>
</select>
</div>
@@ -112,6 +95,26 @@
</div>
</div>
</fieldset>
+ <legend>Service Inputs</legend>
+ <div ng-repeat="parameter in ctrl.service.parameters" class="mT15 form-group" style="margin-left:0px;">
+ <label class="col-sm-5 control-label">
+ <span>{{parameter.name}}</span><span ng-if="parameter.isRequired" class="required">*</span>
+ </label>
+ <div ng-if="parameter.type === 'string' || parameter.type === 'boolean' || parameter.type === 'integer'" class="col-sm-5">
+ <input type="text" name="{{parameter.description}}" class="form-control" ng-model="parameter.value" placeholder="{{parameter.name}}" value="{{parameter.defaultValue}}" ng-readonly="{{parameter.readonly}}"/>
+ </div>
+ <div ng-if="parameter.type === 'vf_location'" class="col-sm-5">
+ <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="parameter.value" ng-options="option.name for option in ctrl.locations">
+ <option value="">--select--</option>
+ </select>
+ </div>
+ <div ng-if="parameter.type === 'sdn_controller'" class="col-sm-5">
+ <select class="form-control" style ="padding-top: 0px;padding-bottom: 0px;" ng-model="parameter.value" ng-options="option.value for option in ctrl.sdnControllers">
+ <option value="">--select--</option>
+ </select>
+ </div>
+ </div>
+
</div>
</uib-tab>
</uib-tabset>