[12560] | 1 | (function () {
|
---|
| 2 | var module = appStatisticsPlugin.getAngularModule();
|
---|
| 3 | module.controller('app.statistics.exceptionsCtrl',
|
---|
| 4 | ['$scope', '$interval', '$modal', 'app.statistics.exceptionService',
|
---|
| 5 | function ($scope, $interval, $modal, exceptionService) {
|
---|
| 6 | $scope.interval = defaultPageUpdateInterval;
|
---|
| 7 | $scope.curExceptionsPage = 1;
|
---|
| 8 | $scope.exceptionsPageSize = 20;
|
---|
| 9 |
|
---|
| 10 | var getExceptions = function () {
|
---|
| 11 | exceptionService.getExceptions({ page: $scope.curExceptionsPage, size: $scope.exceptionsPageSize },
|
---|
| 12 | function (exceptionPage) {
|
---|
| 13 | $scope.exceptionPage = exceptionPage;
|
---|
| 14 | }
|
---|
| 15 | );
|
---|
| 16 | };
|
---|
| 17 |
|
---|
| 18 | $scope.changeExceptionsPage = function () {
|
---|
| 19 | update();
|
---|
| 20 | };
|
---|
| 21 |
|
---|
| 22 | var update = function () {
|
---|
| 23 | getExceptions();
|
---|
| 24 | };
|
---|
| 25 |
|
---|
| 26 | $scope.openDialog = function (message) {
|
---|
| 27 | $scope.message = message;
|
---|
| 28 | $modal.open({
|
---|
| 29 | templateUrl: 'plugin=statistics&view=WebApp/exceptions/exceptionDetailsDialog.cshtml',
|
---|
| 30 | controller: 'app.statistics.exceptionDetailsDialogCtrl',
|
---|
| 31 | windowClass: 'app-modal-window',
|
---|
| 32 | resolve: {
|
---|
| 33 | message: function () {
|
---|
| 34 | return $scope.message;
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
| 37 | });
|
---|
| 38 | };
|
---|
| 39 |
|
---|
| 40 | $scope.updateInterval = $interval(update, $scope.interval);
|
---|
| 41 | var cancelInterval = $scope.$on('$locationChangeSuccess', function () {
|
---|
| 42 | $interval.cancel($scope.updateInterval);
|
---|
| 43 | cancelInterval();
|
---|
| 44 | });
|
---|
| 45 | update();
|
---|
| 46 | }
|
---|
| 47 | ]
|
---|
| 48 | );
|
---|
| 49 | })(); |
---|