2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 app.controller('policyDashboardHealthController', function ($scope, PolicyAppService, modalService, $modal){
21 $( "#dialog" ).hide();
22 $scope.pdpTableDatas = [];
23 $scope.papTableDatas = [];
24 $scope.policyActivityTableDatas = [];
26 PolicyAppService.getData('get_DashboardSystemAlertData').then(function(data){
28 $scope.data = JSON.parse(j.data);
29 console.log($scope.data);
30 $scope.systemAlertsTableDatas =JSON.parse($scope.data.systemAlertsTableDatas);
32 console.log("failed");
35 PolicyAppService.getData('get_DashboardPAPStatusData').then(function(data){
37 $scope.data = JSON.parse(j.data);
38 console.log($scope.data);
39 $scope.papTableMapDatas =JSON.parse($scope.data.papTableDatas);
40 if($scope.papTableMapDatas != null){
41 for(i = 0; i < $scope.papTableMapDatas.length; i++){
42 $scope.papTableDatas.push($scope.papTableMapDatas[i].map);
46 console.log("failed");
49 PolicyAppService.getData('get_DashboardPDPStatusData').then(function(data){
51 $scope.data = JSON.parse(j.data);
52 console.log($scope.data);
53 $scope.pdpTableMapDatas =JSON.parse($scope.data.pdpTableDatas);
54 if($scope.pdpTableMapDatas != null) {
55 for (i = 0; i < $scope.pdpTableMapDatas.length; i++) {
56 $scope.pdpTableDatas.push($scope.pdpTableMapDatas[i].map);
60 console.log("failed");
63 PolicyAppService.getData('get_DashboardPolicyActivityData').then(function(data){
65 $scope.data = JSON.parse(j.data);
66 console.log($scope.data);
67 $scope.policyActivityTableMapDatas =JSON.parse($scope.data.policyActivityTableDatas);
68 if($scope.policyActivityTableMapDatas != null) {
69 for (i = 0; i < $scope.policyActivityTableMapDatas.length; i++) {
70 $scope.policyActivityTableDatas.push($scope.policyActivityTableMapDatas[i].map);
74 console.log("failed");
77 $scope.availableGridHealthDatas = {
78 data : 'systemAlertsTableDatas',
79 enableFiltering: true,
80 columnDefs: [{ field: 'id'},
84 {field : 'date' ,type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' },
85 {field : 'description'}
89 $scope.papStatusDatas = {
90 data : 'papTableDatas',
91 enableFiltering: true,
92 columnDefs: [{ field: 'system'},
94 { field: 'noOfPolicy'},
95 {field: 'noOfConnectedTrap'}
99 $scope.pdpStatusDatas = {
100 data : 'pdpTableDatas',
101 enableFiltering: true,
102 columnDefs: [{ field: 'id'},
104 { field: 'groupname'},
106 {field : 'description' },
107 {field : 'permitCount'},
108 {field : 'denyCount'},
113 $scope.policyActivityDatas = {
114 data : 'policyActivityTableDatas',
115 enableFiltering: true,
116 columnDefs: [{ field: 'policyId'},
117 { field: 'fireCount'},