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=========================================================
21 app.controller('policyDashboardHealthController', function ($scope,DashboardService,modalService, $modal){
22 $( "#dialog" ).hide();
23 $scope.pdpTableDatas = [];
24 $scope.papTableDatas = [];
25 $scope.policyActivityTableDatas = [];
26 DashboardService.getSystemAlertData().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");
36 DashboardService.getPAPStatusData().then(function(data){
38 $scope.data = JSON.parse(j.data);
39 console.log($scope.data);
40 $scope.papTableMapDatas =JSON.parse($scope.data.papTableDatas);
41 if($scope.papTableMapDatas != null){
42 for(i = 0; i < $scope.papTableMapDatas.length; i++){
43 $scope.papTableDatas.push($scope.papTableMapDatas[i].map);
47 console.log("failed");
51 DashboardService.getPDPStatusData().then(function(data){
53 $scope.data = JSON.parse(j.data);
54 console.log($scope.data);
55 $scope.pdpTableMapDatas =JSON.parse($scope.data.pdpTableDatas);
56 if($scope.pdpTableMapDatas != null) {
57 for (i = 0; i < $scope.pdpTableMapDatas.length; i++) {
58 $scope.pdpTableDatas.push($scope.pdpTableMapDatas[i].map);
62 console.log("failed");
66 DashboardService.getPolicyActivityData().then(function(data){
68 $scope.data = JSON.parse(j.data);
69 console.log($scope.data);
70 $scope.policyActivityTableMapDatas =JSON.parse($scope.data.policyActivityTableDatas);
71 if($scope.policyActivityTableMapDatas != null) {
72 for (i = 0; i < $scope.policyActivityTableMapDatas.length; i++) {
73 $scope.policyActivityTableDatas.push($scope.policyActivityTableMapDatas[i].map);
77 console.log("failed");
81 $scope.availableGridHealthDatas = {
82 data : 'systemAlertsTableDatas',
83 enableFiltering: true,
84 columnDefs: [{ field: 'id'},
88 {field : 'date' ,type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' },
89 {field : 'description'}
93 $scope.papStatusDatas = {
94 data : 'papTableDatas',
95 enableFiltering: true,
96 columnDefs: [{ field: 'system'},
98 { field: 'noOfPolicy'},
99 {field: 'noOfConnectedTrap'}
103 $scope.pdpStatusDatas = {
104 data : 'pdpTableDatas',
105 enableFiltering: true,
106 columnDefs: [{ field: 'id'},
108 { field: 'groupname'},
110 {field : 'description' },
111 {field : 'permitCount'},
112 {field : 'denyCount'},
117 $scope.policyActivityDatas = {
118 data : 'policyActivityTableDatas',
119 enableFiltering: true,
120 columnDefs: [{ field: 'policyId'},
121 { field: 'fireCount'},