Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/clientsCtrl.js @ 13826

Last change on this file since 13826 was 12516, checked in by dglaser, 9 years ago

#2388:

HeuristicLab.Services.Hive.DataAccess-3.3:

  • updated daos
  • changed statistics database schema
  • updated HiveStatisticsGenerator

HeuristicLab.Services.WebApp.Statistics-3.3:

  • added jobs, client and user page
File size: 1.8 KB
Line 
1(function () {
2    var module = appStatisticsPlugin.getAngularModule();
3    module.controller('app.statistics.clientsCtrl',
4        ['$scope', '$interval', 'app.statistics.clientService',
5        function ($scope, $interval, clientService) {
6            $scope.interval = defaultPageUpdateInterval;
7            $scope.curClientsPage = 1;
8            $scope.clientsPageSize = 20;
9            $scope.curExpiredClientsPage = 1;
10            $scope.expiredClientsPageSize = 20;
11
12            var getClients = function () {
13                clientService.getClients({ page: $scope.curClientsPage, size: $scope.clientsPageSize, expired: false },
14                    function (clientPage) {
15                        $scope.clientPage = clientPage;
16                    }
17                );
18            };
19
20            var getExpiredClients = function() {
21                clientService.getClients({ page: $scope.curExpiredClientsPage, size: $scope.expiredClientsPageSize, expired: true },
22                    function (clientPage) {
23                        $scope.expiredClientPage = clientPage;
24                    }
25                );
26            };
27
28            var update = function () {
29                getClients();
30                getExpiredClients();
31            };
32
33            $scope.changeClientsPage = function () {
34                update();
35            };
36
37            $scope.changeExpiredClientsPage = function () {
38                update();
39            };
40
41            $scope.updateInterval = $interval(update, $scope.interval);
42            var cancelInterval = $scope.$on('$locationChangeSuccess', function () {
43                $interval.cancel($scope.updateInterval);
44                cancelInterval();
45            });
46            update(); // init page
47
48        }]
49    );
50})();
Note: See TracBrowser for help on using the repository browser.