summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/controller
diff options
context:
space:
mode:
authorOfir Sonsino <os0695@att.com>2017-09-20 14:08:19 +0300
committerOfir Sonsino <os0695@att.com>2017-09-20 14:14:56 +0300
commit1ba64a4a45f26e8bdb58e866e540aa58f32e2e52 (patch)
treedac3ada662bb141fe986526d13b2436032e5012e /vid-app-common/src/main/webapp/app/vid/scripts/controller
parentcbdd17f586a4914890bd2b26ee91be135568f38c (diff)
Change management and PNF support
Issue-ID: VID-44, VID-48, VID-49, VID-50, VID-51, VID-52 Change-Id: I83e940aad2e4e294a0927b546c4c08ca8e539a65 Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/controller')
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js3
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js4
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js5
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js15
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js138
5 files changed, 158 insertions, 7 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
index b0fcb11e..f0653f68 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
@@ -352,9 +352,6 @@
$scope.deleteVnf = function(serviceObject, vnf) {
-
- debugger;
-
console.log("Removing VNF " + vnf.name);
var serviceInstance = serviceObject.object;
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 731c2f2e..a0030889 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
@@ -39,8 +39,8 @@
$http.get(pathQuery)
.then(function successCallback(response) {
$scope.services = [];
- if (angular.isArray(response.data.services)) {
- wholeData = response.data.services;
+ if (angular.isArray(response.data)) {
+ wholeData = response.data;
$scope.services = $scope.filterDataWithHigerVersion(wholeData);
$scope.viewPerPage=10;
$scope.totalPage=$scope.services.length/$scope.viewPerPage;
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js
index dcde2ecc..b611def4 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js
@@ -47,6 +47,11 @@
templateUrl : "app/vid/scripts/view-models/aaiSubDetails.htm",
controller : "aaiSubscriberController"
})
+ .when('/change-management', {
+ templateUrl : "app/vid/scripts/view-models/change-management.html",
+ controller : "changeManagementController",
+ controllerAs: 'vm'
+ })
.when('/instantiate', {
controller: 'InstantiationController',
templateUrl: 'app/vid/scripts/view-models/instantiate.htm'
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
index 84d27a23..6bf16c34 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
@@ -20,8 +20,8 @@
"use strict";
-appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "VIDCONFIGURATION", "UtilityService", "vidService", "AaiService",
- function (COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, VIDCONFIGURATION, UtilityService, vidService, AaiService) {
+appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "VIDCONFIGURATION", "UtilityService", "vidService", "AaiService", "MsoService",
+ function (COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, VIDCONFIGURATION, UtilityService, vidService, AaiService, MsoService) {
$scope.showVnfDetails = function (vnf) {
console.log("showVnfDetails");
@@ -901,6 +901,17 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
$scope.currentPage--;
}
+ $scope.activateMSOInstance = function() {
+ MsoService.activateInstance($scope.service.instance, $scope.service.model)
+ .then(function(response) {
+ alert("Activation succeeded");
+ })
+ .catch(function (error) {
+ $log.error(error);
+ });
+ ;
+ };
+
$scope.nextPage = function () {
$scope.currentPage++;
}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
new file mode 100644
index 00000000..662b10ec
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
@@ -0,0 +1,138 @@
+(function () {
+ 'use strict';
+
+ appDS2.controller("changeManagementController", ["$uibModal", "changeManagementService", "_", "$log", changeManagementController]);
+
+ function changeManagementController($uibModal, changeManagementService, _, $log) {
+ var vm = this;
+
+ var init = function() {
+ loadMSOChangeManagements();
+ loadSchedulerChangeManagements();
+ };
+
+ var loadMSOChangeManagements = function() {
+ changeManagementService.getMSOChangeManagements()
+ .then(function(response) {
+ vm.changeManagements = response.data;
+ })
+ .catch(function (error) {
+ $log.error(error);
+ });
+ };
+
+ var loadSchedulerChangeManagements = function() {
+ changeManagementService.getSchedulerChangeManagements()
+ .then(function(response) {
+ vm.pendingChangeManagements = response.data;
+ _.forEach(vm.pendingChangeManagements, function(changeManagement) {
+ var callbackData = _.filter(changeManagement.scheduleRequest.domainData, {name: "CallbackData"});
+ if(callbackData) {
+ var parsedModel = {};
+ try {
+ parsedModel = JSON.parse(callbackData[0].value);
+ } catch(exception) {
+ $log.error(exception);
+ }
+
+ changeManagement.workflow = parsedModel.requestType || 'No workflow';
+ }
+ });
+ })
+ .catch(function(error) {
+ $log.error(error);
+ });
+ };
+
+ vm.createNewChange = function() {
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/new-change-management/new-change-management.html',
+ controller: 'newChangeManagementModalController',
+ controllerAs: 'vm',
+ resolve: {}
+ });
+
+ modalInstance.result.then(function (result) {
+ console.log("This is the result of the new change management modal.", result);
+ });
+ };
+
+ vm.openScheduler = function() {
+ console.log("function for opening the scheduler app")
+ };
+
+ vm.searchChanges = function() {
+ console.log("function for searching changes: " + vm.searchChangesTerm)
+ };
+
+ vm.openFailedModal = function(jobInfo) {
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/failed-change-management/failed-change-management.html',
+ controller: 'changeManagementManualTasksController',
+ controllerAs: 'vm',
+ resolve: {
+ jobInfo: function () {
+ return jobInfo;
+ }
+ }
+ });
+
+ modalInstance.result.then(function (result) {
+ console.log("This is the result of the failed change management modal.", result);
+ });
+ };
+
+ vm.openInProgressModal = function(jobInfo) {
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html',
+ controller: 'changeManagementManualTasksController',
+ controllerAs: 'vm',
+ resolve: {
+ jobInfo: function () {
+ return jobInfo;
+ }
+ }
+ });
+
+ modalInstance.result.then(function (result) {
+ console.log("This is the result of the in progress change management modal.", result);
+ });
+ };
+
+ vm.openAlertModal = function(jobInfo) {
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/alert-change-management/alert-change-management.html',
+ controller: 'changeManagementManualTasksController',
+ controllerAs: 'vm',
+ resolve: {
+ jobInfo: function () {
+ return jobInfo;
+ }
+ }
+ });
+
+ modalInstance.result.then(function (result) {
+ console.log("This is the result of the alert change management modal.", result);
+ });
+ };
+
+ vm.openPendingModal = function(jobInfo) {
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/pending-change-management/pending-change-management.html',
+ controller: 'changeManagementManualTasksController',
+ controllerAs: 'vm',
+ resolve: {
+ jobInfo: function () {
+ return jobInfo;
+ }
+ }
+ });
+
+ modalInstance.result.then(function (result) {
+ console.log("This is the result of the pending change management modal.", result);
+ });
+ };
+
+ init();
+ }
+})(); \ No newline at end of file