From c19189718469498377b194eea2f9a247bb79c4f9 Mon Sep 17 00:00:00 2001 From: Nicolas Hu Date: Fri, 6 Oct 2017 10:28:45 -0400 Subject: Refactor CCSDK/Dashboard project Change-Id: I34451fbebbe7bbaaf1cd23aed5cef0f9a9ba37b7 Issues-Id: CCSDK-111 Signed-off-by: Nicolas Hu --- .../src/main/webapp/app/oom/home/appDS2.js | 30 ---- .../main/webapp/app/oom/home/controller-service.js | 69 -------- .../main/webapp/app/oom/home/controller_table.html | 85 ---------- .../app/oom/home/executions-view-controller.js | 122 -------------- .../main/webapp/app/oom/home/executions_view.html | 165 ------------------ .../src/main/webapp/app/oom/home/modal-service.js | 97 ----------- .../app/oom/home/oom-instances-controller.js | 70 -------- .../src/main/webapp/app/oom/home/oom-router.js | 99 ----------- .../src/main/webapp/app/oom/home/oom-style.css | 20 --- .../webapp/app/oom/home/oom_instances_popup.html | 86 ---------- .../webapp/app/oom/home/oom_popup_templates.html | 65 ------- .../src/main/webapp/app/oom/home/oom_spa.html | 125 -------------- .../webapp/app/oom/home/tree-view-controller.js | 134 --------------- .../webapp/app/oom/home/tree-view-directive.js | 186 --------------------- .../main/webapp/app/oom/home/tree-view-style.css | 132 --------------- .../src/main/webapp/app/oom/home/tree_view.html | 24 --- 16 files changed, 1509 deletions(-) delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/appDS2.js delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/controller-service.js delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/controller_table.html delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/executions-view-controller.js delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/executions_view.html delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/modal-service.js delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/oom-instances-controller.js delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/oom-router.js delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/oom-style.css delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/oom_instances_popup.html delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/oom_popup_templates.html delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/oom_spa.html delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/tree-view-controller.js delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/tree-view-directive.js delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/tree-view-style.css delete mode 100644 oom-app-overlay/src/main/webapp/app/oom/home/tree_view.html (limited to 'oom-app-overlay/src/main/webapp/app/oom/home') diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/appDS2.js b/oom-app-overlay/src/main/webapp/app/oom/home/appDS2.js deleted file mode 100644 index 80ee672..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/appDS2.js +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * =============LICENSE_START========================================================= - * - * ================================================================================= - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - *******************************************************************************/ -/* Angular application for the EC Dashboard web UI */ -var appDS2 = angular.module("abs", - [ - 'ngCookies', 'ngRoute', 'ngMessages', - 'ui.bootstrap', 'ui.bootstrap.modal', - 'b2b.att', - 'modalServices' - ] - ); diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/controller-service.js b/oom-app-overlay/src/main/webapp/app/oom/home/controller-service.js deleted file mode 100644 index 6c4c45d..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/controller-service.js +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * =============LICENSE_START========================================================= - * - * ================================================================================= - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - *******************************************************************************/ -appDS2.factory('ControllerService', function ($http, $q, $log) { - return { - /** - * Gets ECOMP-C Endpoint objects. - * No provision for pagination here. - * @return {JSON} Response object from remote side - */ - getControllers: function() { - // cache control for IE - var cc = "?cc=" + new Date().getTime().toString(); - return $http({ - method: 'GET', - url: 'controllers' + cc, - cache: false, - responseType: 'json' - }).then(function(response) { - if (response.data == null || typeof response.data != 'object') - return $q.reject('ControllerService.getControllers: response.data null or not object'); - else - return response.data; - }, - function(error) { - $log.error('ControllerService.getControllers failed: ' + JSON.stringify(error)); - return $q.reject(error.statusText); - }); - }, - - setControllerSelection: function(row) { - // $log.debug('ControllerService.setControllerSelection: invoked with ' + JSON.stringify(row)); - return $http({ - method: 'POST', - url: 'controllers', - data: row, - responseType: 'json' - }).then(function(response) { - if (response.data == null || typeof response.data != 'object') - return $q.reject('ControllerService.setControllerSelection: response.data null or not object'); - else - return response.data; - }, - function(error) { - $log.error('ControllerService.setControllerSelection failed: ' + JSON.stringify(error)); - return $q.reject(error.statusText); - }); - } - - }; -}); diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/controller_table.html b/oom-app-overlay/src/main/webapp/app/oom/home/controller_table.html deleted file mode 100644 index c2a0ca9..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/controller_table.html +++ /dev/null @@ -1,85 +0,0 @@ -
- -

ECOMP-C Instances

- - -
-
- - Please wait while the content loads. -
-
- -
- -
-
-
- -
-
-
- -
- {{ecdapp.errMsg}} -
- -
- -
- - - - - - - - - - - - - - - - -
SelectedNameURL
- - - -
-
- - - -
- -
- -
- -
- -
diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/executions-view-controller.js b/oom-app-overlay/src/main/webapp/app/oom/home/executions-view-controller.js deleted file mode 100644 index 4b28fed..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/executions-view-controller.js +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * =============LICENSE_START========================================================= - * - * ================================================================================= - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - *******************************************************************************/ -appDS2.controller('executionsViewController', function($scope, $rootScope, ControllerService, $modal, ExecutionService, $log) { - - $scope.parent = { 'blueprint_id': 'Root', 'parent': 'parent' }; - $scope.ecdapp = {}; - $scope.ecdapp.isDataLoading = false; - $scope.controllersList = []; - $scope.controllerCall; - var debug = false; - - var getControllers = function(){ - $scope.ecdapp.isDataLoading = true; - ControllerService.getControllers().then(function(jsonObj) { - if (debug) - $log.debug("verticalComponentController.getControllers succeeded: " + JSON.stringify(jsonObj)); - // Empty - $scope.controllersList.length = 0; - // Refill - jsonObj.filter(function(d) { - $scope.controllersList.push(d); - if (d.selected){ - $scope.parent.blueprint_id = d.name; - $scope.controllerCallDone = true; - } - return; - }); - $scope.ecdapp.isDataLoading = false; - }, function(error) { - $scope.ecdapp.isDataLoading = false; - alert('Failed to load controllers. Please retry.'); - $log.error("verticalComponentController.getControllers failed: " + error); - }); - }; - - $rootScope.$on('controllerChange', function(e, d){ - $scope.parent.blueprint_id = d.name; - }); - - $scope.ecdapp.loadTable = function(status) { - $scope.ecdapp.isDataLoading = true; - - // Empty list and create the root controller item - $scope.orgChartData = []; - - ExecutionService.getExecutionsByStatus(status).then( - function(jsonObj) { - - if (jsonObj.error) { - $log.error("verticalComponentController.loadTable failed: " - + jsonObj.error); - $scope.ecdapp.isRequestFailed = true; - $scope.ecdapp.errMsg = jsonObj.error; - } else { - $scope.ecdapp.isRequestFailed = false; - $scope.ecdapp.errMsg = null; - for (var i=0; i < jsonObj.items.length; i++) { - $scope.orgChartData.push(jsonObj.items[i]); - } - $scope.$broadcast('listenEvent', {data: $scope.orgChartData} ); - setTimeout(function(){$('.child-item').popover()}, 0); - } - $scope.status = status; - $scope.ecdapp.isDataLoading = false; - }, - function(error) { - $log.error("verticalComponentController.loadTable failed: " - + error); - $scope.ecdapp.isRequestFailed = true; - $scope.ecdapp.errMsg = error; - $scope.ecdapp.isDataLoading = false; - }); - }; - - $scope.showEcompCInstancesModalPopup = function() { - var modalInstance = $modal.open({ - templateUrl : 'ecompc_instances_popup.html', - controller : 'selectEcompcController', - windowClass: 'modal-docked', - sizeClass: 'modal-medium', - resolve : { - message : function() { - return { items: $scope.controllersList } - } - } - }); - }; - - $scope.showsubDropdown = function(e){ - $('#submenu').toggle(); - e.stopPropagation(); - e.preventDefault(); - } - - $scope.closeSubMenu = function(){ - $('#submenu').css({display:'none'}) - } - - // Initialize the page - getControllers(); - $scope.ecdapp.loadTable('active'); - $scope.showOrgTable = true; -}); diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/executions_view.html b/oom-app-overlay/src/main/webapp/app/oom/home/executions_view.html deleted file mode 100644 index 9f3e113..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/executions_view.html +++ /dev/null @@ -1,165 +0,0 @@ - - - -
-

OOM Managed Executions

- -
- - Please wait while the content loads. -
- -
-
-
-
-
-
-
- {{parent.blueprint_id}} -
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
- Status: {{status}} -
-
- No components found with status {{status}} -
-
-
- - - -
-
-
-
- {{item.blueprint_id}} -
-
-
- -
-
-
-
-
-
-
- -
\ No newline at end of file diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/modal-service.js b/oom-app-overlay/src/main/webapp/app/oom/home/modal-service.js deleted file mode 100644 index 07b5d77..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/modal-service.js +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * =============LICENSE_START========================================================= - * - * ================================================================================= - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - *******************************************************************************/ -angular.module("modalServices",[]).service('modalService', ['$modal', function ($modal) { - - /* - * Defines the same functions available in DS1 using DS2 icons etc. - * Relies on templates defined in ecd_popup_templates.html - */ - - var ModalInstanceCtrl = function ($scope, $modalInstance, $rootScope, items) { - // Pass thru to template as object "msg" - $scope.msg = items; - - $scope.cancel = function () { - $modalInstance.dismiss('cancel'); - }; - }; - - this.showIconTitleTextOkModal = function (icon, title, text) { - var modalInstance = $modal.open({ - templateUrl: 'ecd_title_text_ok_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return { - icon: icon, - title: title, - text: text - }; - } - } - }); - }; - - this.showFailure = function (title, text) { - this.showIconTitleTextOkModal('icon-primary-alert', title, text); - }; - - this.showSuccess = function (title, text) { - this.showIconTitleTextOkModal('icon-primary-approval', title, text); - }; - - /* Replicate modals defined by ds2-modal/modalService.js */ - errorPopUp = function(text) { - this.showFailure('Error', text); - }; - successPopUp = function(text) { - this.showSuccess('Success', text); - }; - - this.popupConfirmWin = function(title, text, callback) { - var modalInstance = $modal.open({ - templateUrl: 'ecd_title_text_ok_cancel_modal.html', - controller: ModalInstanceCtrl, - sizeClass: 'modal-small', - resolve: { - items: function () { - return { - icon: 'icon-primary-questionmark', - title: title, - text: text - }; - } - } - }); - var args = Array.prototype.slice.call(arguments, 0); - args.splice(0, 3); - modalInstance.result.then(function(){ - callback.apply(null, args); - }, function() { - // - })['finally'](function(){ - modalInstance = undefined; - }); - }; - - }]); diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/oom-instances-controller.js b/oom-app-overlay/src/main/webapp/app/oom/home/oom-instances-controller.js deleted file mode 100644 index f07d1b3..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/oom-instances-controller.js +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * =============LICENSE_START========================================================= - * - * ================================================================================= - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - *******************************************************************************/ -appDS2.controller('selectEcompcController', function( - $scope, $rootScope, $log, $modalInstance, message, ControllerService) { - - // message brings the table items - - 'use strict'; - - // Set to true for verbose output - var debug = false; - - // this object holds data and functions - $scope.ecdapp = {}; - $scope.ecdapp.tableData = message.items; - - // Populate the model that drives the radio buttons. - // Radio buttons require a model with the value of the button - // that is selected. The data comes across with a boolean - // indicator on each row, selected or not, which is useless - // for driving the radio buttons. This model uses the URL - // as the unique value. - $scope.ecdapp.radiobutton = { - url : null - }; - for (var rowNum in message.items) { - let row = message.items[rowNum]; - if (debug) - $log.debug('selectEcompcController: row is ' + JSON.stringify(row)); - if (row.selected) - $scope.ecdapp.radiobutton.url = row.url; - } - - /** - * Handles a click on radio button to select a controller. - */ - $scope.ecdapp.selectController = function(row) { - if (debug) - $log.debug('selectController: row is ' + JSON.stringify(row)); - if (row == null || row.url == null) - $log.error('selectController invoked with bad argument'); - else - ControllerService.setControllerSelection(row).then(function(data) { - $rootScope.$broadcast('controllerChange', {name: row.name}) - }, - function(error) { - $log.error('selectController failed: ' + error); - }); - }; - -}); diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/oom-router.js b/oom-app-overlay/src/main/webapp/app/oom/home/oom-router.js deleted file mode 100644 index e598487..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/oom-router.js +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * =============LICENSE_START========================================================= - * - * ================================================================================= - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - *******************************************************************************/ -appDS2.config(function($routeProvider) { - $routeProvider - .when('/orgchart', { - /* horizontal layout */ - templateUrl: 'app/oom/home/tree_view.html', - controller : 'treeViewController' - }) - .when('/tosca', { - templateUrl: 'app/oom/cloudify/tosca_table.html', - controller : 'toscaTableController' - }) - .when('/bp', { - templateUrl: 'app/oom/cloudify/blueprint_table.html', - controller : 'blueprintTableController' - }) - .when('/dep', { - templateUrl: 'app/oom/cloudify/deployment_table.html', - controller : 'deploymentTableController' - }) - .when('/exe', { - templateUrl: 'app/oom/cloudify/execution_table.html', - controller : 'executionTableController' - }) - .when('/sh', { - templateUrl: 'app/oom/consul/service_health_table.html', - controller : 'serviceHealthTableController' - }) - .when('/nh', { - templateUrl: 'app/oom/consul/node_table.html', - controller : 'nodeTableController' - }) - .when('/dc', { - templateUrl: 'app/oom/consul/datacenter_table.html', - controller : 'datacenterTableController' - }) - .when('/profile/:profileId', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/self_profile.html', - controller: 'selfProfileController' - }) - .when('/profile_search', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/profile_searchDS2.html', - controller : "profileSearchCtrlDS2" - }) - .when('/post_search', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/post.html', - controller: 'postController' - }) - .when('/self_profile', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-profile/self_profile.html', - controller: 'selfProfileController' - }) - .when('/role_list', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/role_list.html', - controller : 'adminController' - }) - .when('/role_function_list', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/role-function.html', - controller : "adminController" - }) - .when('/jcs_admin', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/jcs_admin.html', - controller: 'adminController' - }) - .when('/admin_menu_edit', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/admin-menu-edit.html', - controller: 'AdminMenuEditController' - }) - .when('/usage_list', { - templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/usage.html', - controller: 'usageListControllerDS2' - }) - .otherwise({ - templateUrl: 'app/oom/home/executions_view.html', - controller : 'executionsViewController' - }) - ; - -}); \ No newline at end of file diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/oom-style.css b/oom-app-overlay/src/main/webapp/app/oom/home/oom-style.css deleted file mode 100644 index e08fc31..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/oom-style.css +++ /dev/null @@ -1,20 +0,0 @@ -/* Styles for ECOMP Controller Dashboard */ - -.ecd-error-message { - font-size: 14px; - font-weight: bold; - color: red; -} - -.ecd-icon-display { - font-size: 18px; -} - -.ecd-icon-action { - font-size: 18px; -} - -.ecd-icon-action:hover { - color: red; - text-decoration: none; -} \ No newline at end of file diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/oom_instances_popup.html b/oom-app-overlay/src/main/webapp/app/oom/home/oom_instances_popup.html deleted file mode 100644 index bc523aa..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/oom_instances_popup.html +++ /dev/null @@ -1,86 +0,0 @@ - diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/oom_popup_templates.html b/oom-app-overlay/src/main/webapp/app/oom/home/oom_popup_templates.html deleted file mode 100644 index fe4d505..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/oom_popup_templates.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/oom_spa.html b/oom-app-overlay/src/main/webapp/app/oom/home/oom_spa.html deleted file mode 100644 index 47eac2d..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/oom_spa.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - OOM Dashboard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- - -
- - - diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/tree-view-controller.js b/oom-app-overlay/src/main/webapp/app/oom/home/tree-view-controller.js deleted file mode 100644 index 577ebe1..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/tree-view-controller.js +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * =============LICENSE_START========================================================= - * - * ================================================================================= - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - *******************************************************************************/ -appDS2.controller('treeViewController',function( - $scope, $rootScope, $log, $modal, ExecutionService, ControllerService){ - - 'use strict'; - - // Set to true for verbose output - var debug = false; - - // this object holds all app data and functions - $scope.ecdapp = {}; - $scope.ecdapp.isDataLoading = false; - $scope.ecdapp.isRequestFailed = false; - $scope.orgChart = true; - $scope.status = ''; - var selectedItem = { - name: '' - }; - // Initial data as eye candy - $scope.orgChartData = [ { 'blueprint_id': 'Root', 'parent': 'parent' } ]; - var controllersList = []; - - var getControllers = function(){ - ControllerService.getControllers().then(function(jsonObj) { - if (debug) - $log.debug("treeViewController.getControllers succeeded: " + JSON.stringify(jsonObj)); - // Empty - controllersList.length = 0; - // Refill - jsonObj.filter(function(d) { - controllersList.push(d); - if (d.selected) - selectedItem = d; - return; - }); - $scope.ecdapp.loadTable(); - }, function(error) { - alert('Failed to load controllers. Please retry.'); - $log.error("treeViewController.getControllers failed: " + error); - }); - } - - /** - * Called from the directive when user picks a status value. - */ - $scope.ecdapp.loadTable = function(status) { - $scope.ecdapp.isDataLoading = true; - $scope.status = status; - // Empty list and create the root controller item - $scope.orgChartData.length = 0; - $scope.orgChartData.push({ - "blueprint_id": selectedItem.name, - "parent": "parent" - }); - ExecutionService.getExecutionsByStatus(status).then( - function(jsonObj) { - if (jsonObj.error) { - $log.error("treeViewController.loadTable failed: " - + jsonObj.error); - $scope.ecdapp.isRequestFailed = true; - $scope.ecdapp.errMsg = jsonObj.error; - } else { - $scope.ecdapp.isRequestFailed = false; - $scope.ecdapp.errMsg = null; - for (var i=0; i < jsonObj.items.length; i++) { - $scope.orgChartData.push(jsonObj.items[i]); - } - $scope.$broadcast('listenEvent', {data: $scope.orgChartData} ); - } - $scope.ecdapp.isDataLoading = false; - }, - function(error) { - $log.error("treeViewController.loadTable failed: " - + error); - $scope.ecdapp.isRequestFailed = true; - $scope.ecdapp.errMsg = error; - $scope.ecdapp.isDataLoading = false; - }); - }; - - // Listens for change of the selected controller - $rootScope.$on('controllerChange', function(e, d){ - $scope.orgChartData[0].blueprint_id = d.name; - $scope.$broadcast('listenEvent', {data: $scope.orgChartData}); - }) - - // Shows popup with list of controllers - $scope.ecdapp.showEcompCInstancesModalPopup = function() { - var modalInstance = $modal.open({ - templateUrl : 'ecompc_instances_popup.html', - controller : 'selectEcompcController', - windowClass: 'modal-docked', - sizeClass: 'modal-medium', - resolve : { - message : function() { - return { items: controllersList } - } - } - }); - modalInstance.result.then(function(response) { - // Always reload the table - // $log.debug('modalInstance: reloading controllers'); - getControllers('active'); - }, - function(error) { - // Should never happen - $log.error('modalInstance: ERROR!?'); - }); - }; - - // Populate the table on load. - getControllers('active'); - -}); diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/tree-view-directive.js b/oom-app-overlay/src/main/webapp/app/oom/home/tree-view-directive.js deleted file mode 100644 index fa81246..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/tree-view-directive.js +++ /dev/null @@ -1,186 +0,0 @@ -/******************************************************************************* - * =============LICENSE_START========================================================= - * - * ================================================================================= - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - *******************************************************************************/ -(function() { - 'use strict'; - - appDS2.directive("orgChart", supervisorOrgChart); - supervisorOrgChart.$inject = ['$http', '$templateCache', 'ExecutionService']; - - function supervisorOrgChart($http, $templateCache, ExecutionService) { - return { - restrict: 'E', - scope: { - data: '=', - getCall: '&', - modalCall: '&', - status: '=' - }, - - link: function(scope, elem, attrs) { - - scope.$on('listenEvent', function(event, data) { - data = data.data; - scope.data = data; - $('.jOrgChart').remove(); - drawOrgChart(data); - }); - - - var items = [], - mCheck = []; - var currentZoom = 100; - var data = scope.data; - var selectedStatus = scope.status; - function statusSelectoin(status){ - $('#statusclick li').removeClass('active'); - scope.getCall()(status); - } - - function drawOrgChart(data, supervisorOrg) { - items = []; - var itemHtml = ""; - for(var i=0; i" + - "
" + - ""+ - ""+ - ""+ - "" + root.blueprint_id + ""+ - ""+ - "

"+ - "
"+ - "
'); - var listElem = $("
    ", { - "class": "org", - "style": "float:right;", - html: items.join("") - }).appendTo(elem); - - var opts = { - chartElement: elem, - rowcolor: false - }; - //elem.html(''); - $(elem).find(".org").jOrgChart(opts); - listElem.remove(); - - setTimeout(function(){ - $('.dropdown .dropdown-toggle').on("click", function(e){ - var cls = '.'+ e.target.id; - var subcls = cls + ' a.test'; - if($(cls).hasClass('open')){ - $(cls).removeClass('open'); - $(subcls).next('ul').css({display: 'none'}); - } else{ - $(cls).addClass('open'); - } - }); - - $('.dropdown-submenu a.test').on("mouseover", function(e){ - console.log("hi"); - $('#'+e.target.id).next('ul').toggle(); - }); - - $('#statusclick li').click(function(event){ - statusSelectoin(event.target.id); - }) - - $('.openmodal').click(function(event){ - openModal(); - }) - - $(document).on('click','.expandBtn', function(event, data) { - event.stopImmediatePropagation() - var $this = $(this); - var $tr = $this.closest("tr"); - if ($tr.hasClass('contracted')) { - $(this).addClass('fa-minus').removeClass('fa-plus'); - $tr.removeClass('contracted').addClass('expanded'); - $tr.nextAll("tr").css('visibility', ''); - } else { - $(this).addClass('fa-plus').removeClass('fa-minus'); - $tr.removeClass('expanded').addClass('contracted'); - $tr.nextAll("tr").css('visibility', 'hidden'); - } - }); - - var selectedStatus = scope.status; - if(selectedStatus){ - $('#'+selectedStatus).addClass('active'); - } - - function openModal(){ - scope.modalCall()(); - } - - },0); - } - - drawOrgChart(data); - - } - }; - }; -})(); \ No newline at end of file diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/tree-view-style.css b/oom-app-overlay/src/main/webapp/app/oom/home/tree-view-style.css deleted file mode 100644 index 5a3e056..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/tree-view-style.css +++ /dev/null @@ -1,132 +0,0 @@ -/* Basic styling */ - -::-webkit-scrollbar -{ - width: 12px; /* for vertical scrollbars */ - height: 7px; /* for horizontal scrollbars */ -} - -::-webkit-scrollbar-track -{ - background: rgba(0, 0, 0, 0.1); -} - -::-webkit-scrollbar-thumb -{ - background: rgba(0, 0, 0, 0.5); -} - -.orgChart .label_node{ - padding-bottom: 5px; -} - -.orgChart .icon-span{ - float:left;width:25px; - padding-top: 3px; -} -.orgChart .title-span{ - width:110px;float:left; font-size:14px; - padding-top: 3px; -} - -/* Draw the lines */ -.jOrgChart{ - position: relative; - /* left: 245px; */ - width:100%; - min-width: 100%; - overflow-x: auto; - -} -.jOrgChart .line { - height : 20px; - width : 4px; -} - -.jOrgChart .down { - background-color : black; - margin : 0px auto; -} - -.jOrgChart .top { - border-top : 3px solid black; -} - -.jOrgChart button{ - min-width : 20px; - width : 20px; - height : 20px; - padding : 0; -} - -.jOrgChart .dropdown{ - display: inline-block; -} - -.jOrgChart .downloadIcon{ - position: relative; - left: 1px; - float:left; -} - -.jOrgChart .ddIcon{ - position: relative; - float: right; - top: 6px; -} - -.jOrgChart .left { - border-right : 2px solid black; -} - -.jOrgChart .right { - border-left : 2px solid black; -} - -/* node cell */ -.jOrgChart td { - text-align : center; - vertical-align : top; - padding : 0 !important; - border : none; - border-bottom : 1px solid white; -} - -/* The node */ -.jOrgChart .node { - background-color : #efefef; - display : inline-block; - width : 180px; - height : 200px; - z-index : 10; - margin : 0 2px; -} - -.expandBtn { - background-color: #efefef; - padding-top:9px; -} - -/* jQuery drag 'n drop */ - -.drag-active { - border-style : dotted !important; -} - -.drop-hover { - border-style : solid !important; - border-color : #E05E00 !important; -} - -#statusclick{ - padding: 0 !important -} - -#statusclick li { - padding :5px; -} - -#statusclick li.active{ - background: #337ab7; - color: white; -} \ No newline at end of file diff --git a/oom-app-overlay/src/main/webapp/app/oom/home/tree_view.html b/oom-app-overlay/src/main/webapp/app/oom/home/tree_view.html deleted file mode 100644 index a4ab27d..0000000 --- a/oom-app-overlay/src/main/webapp/app/oom/home/tree_view.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - -
    - - - -
    -
    - - Please wait while the content loads. -
    -
    -
    -
    - No components found -
    -
    -
    - {{ecdapp.errMsg}} -
    - -
    -- cgit 1.2.3-korg