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('policyDashboardController', function ($scope,DashboardService,modalService, $modal, uiGridConstants,Grid){
22 $( "#dialog" ).hide();
24 $scope.loading = true;
25 DashboardService.getData().then(function(data){
26 $scope.loading = false;
28 $scope.data = JSON.parse(j.data);
29 console.log($scope.data);
30 $scope.availableLoggingDatas =JSON.parse($scope.data.availableLoggingDatas);
31 console.log($scope.availableLoggingDatas);
33 console.log("failed");
37 $scope.availableGridLoggingDatas = {
38 data : 'availableLoggingDatas',
39 enableFiltering: true,
40 columnDefs: [{ field: 'id'},
44 {field : 'date' ,type: 'date', cellFilter: 'date:\'yyyy-MM-dd HH:MM:ss a\'' },
45 {field : 'description'}
48 enableSelectAll: true,
49 exporterCsvFilename: 'DashboardLogging.csv',
50 exporterPdfDefaultStyle: {fontSize: 9},
51 exporterPdfTableStyle: {margin: [30, 30, 30, 30]},
52 exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'},
53 exporterPdfHeader: { text: "My Header", style: 'headerStyle' },
54 exporterPdfFooter: function ( currentPage, pageCount ) {
55 return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' };
57 exporterPdfCustomFormatter: function ( docDefinition ) {
58 docDefinition.styles.headerStyle = { fontSize: 22, bold: true };
59 docDefinition.styles.footerStyle = { fontSize: 10, bold: true };
62 exporterFieldCallback: function(grid, row, col, input) {
63 if( col.name == 'date') {
64 var date = new Date(input);
70 exporterPdfOrientation: 'portrait',
71 exporterPdfPageSize: 'LETTER',
72 exporterPdfMaxGridWidth: 500,
73 exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
74 onRegisterApi: function(gridApi){
75 $scope.gridApi = gridApi;