diff options
author | Luji7 <lu.ji3@zte.com.cn> | 2017-11-14 23:26:29 +0800 |
---|---|---|
committer | Luji7 <lu.ji3@zte.com.cn> | 2017-11-14 23:26:35 +0800 |
commit | 2e29c8babdb01a46604f8fd356dc1aad563942e9 (patch) | |
tree | 688fed32e2e47c7521c25408603a0b5c02517961 /usecaseui-lcm/src/main/webapp | |
parent | e65cfcdec756fc4a1b82191bc4e927984272dfae (diff) |
Fix vf onboard issue.
Change-Id: Id4d0a23de8199e6f289a589c628ae2bc95e0da96
Issue-id: USECASEUI-55
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
Diffstat (limited to 'usecaseui-lcm/src/main/webapp')
-rw-r--r-- | usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/lcmController.js | 48 |
1 files changed, 41 insertions, 7 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 498d0ac7..6b47353a 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 @@ -186,16 +186,50 @@ app.controller('lcmCtrl', ['$scope', '$uibModal', '$log', '$http', '$timeout', ' }; ctrl.packageDelete = function (deletePackage) { - var processFun = function (response) { - if('failed' === response.status) { - ctrl.alerts.push({type: 'danger',msg: 'Operation failed! ' + response.statusDescription}); - } else { - ctrl.alerts.push({type: 'success',msg: 'Operation is finished!'}); - } - }; if(deletePackage.type === 'NS') { + var processFun = function (response) { + if('failed' === response.status) { + ctrl.alerts.push({type: 'danger',msg: 'Operation failed! ' + response.statusDescription}); + } else { + ctrl.alerts.push({type: 'success',msg: 'Operation is finished!'}); + } + }; ServiceTemplateService.nsPackageDelete(deletePackage, processFun); } else { + var openOnboardProgressDialog = function (jobId, title, successFun, failFun) { + var onboardProgressInstance = $uibModal.open({ + ariaLabelledBy: 'modal-title', + ariaDescribedBy: 'modal-body', + templateUrl : 'app/uui/fusion/scripts/view-models/progress-dialog.html', + controller : 'VfOnboardProgressCtrl', + controllerAs : 'ctrl', + resolve: { + jobId: function () { + return jobId; + }, + operationTitle: function () { + return title; + } + } + }); + onboardProgressInstance.result.then( + function (result) { + successFun(result); + }, + function (reason) { + failFun(reason); + } + ); + }; + var successFun = function (result) { + ctrl.alerts.push({type: 'success',msg: 'Operation is finished!'}); + }; + var failFun = function (reason) { + ctrl.alerts.push({type: 'danger',msg: 'Operation is failed! ' + reason}); + }; + var processFun = function (response) { + openOnboardProgressDialog(response.jobId, 'Delete VF package', successFun, failFun); + }; ServiceTemplateService.vfPackageDelete(deletePackage, processFun); } }; |