Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/jobs/jobsCtrl.js @ 16773

Last change on this file since 16773 was 12584, checked in by dglaser, 9 years ago

#2388: Changed all files to connect to localhost / sqlexpress

HeuristicLab.Services.Hive-3.3:

  • Added Converter.cs and NewHiveService.cs, both will be integrated into existing HiveService.cs and Convert.cs when all methods are successfully implemented

HeuristicLab.Services.Hive.Web.Hive-3.3:

  • Added publish profiles

HeuristicLab.Services.WebApp.Statistics-3.3:

  • Added functionality to download TaskData as .hl file
File size: 1.9 KB
Line 
1(function () {
2    var module = appStatisticsPlugin.getAngularModule();
3    module.controller('app.statistics.jobsCtrl',
4        ['$scope', '$interval', 'app.statistics.jobService', function ($scope, $interval, jobService) {
5            var first = true;
6            $scope.isAdministrator = false;
7            $scope.interval = defaultPageUpdateInterval;
8            $scope.completedJobCurPage = 1;
9            $scope.completedJobPageSize = 20;
10
11            var getAllJobs = function() {
12                jobService.getAllJobs({ completed: false }, function(jobs) {
13                    $scope.jobs = jobs;
14                });
15            };
16
17            var getCompletedJobs = function() {
18                jobService.getJobs({ page: $scope.completedJobCurPage, size: $scope.completedJobPageSize, completed: true },
19                    function (jobPage) {
20                        $scope.completedJobPage = jobPage;
21                    }
22                );
23            };
24
25            var getAllActiveJobsFromAllUsers = function () {
26                jobService.getAllActiveJobsFromAllUsers({}, function (jobs) {
27                    $scope.isAdministrator = true;
28                    $scope.allUsersJobs = jobs;
29                });
30            };
31
32            $scope.changeCompletedJobPage = function () {
33                update();
34            };
35
36            var update = function () {
37                getAllJobs();
38                if (first || $scope.isAdministrator) {
39                    getAllActiveJobsFromAllUsers();
40                }
41                getCompletedJobs();
42            };
43
44            $scope.updateInterval = $interval(update, $scope.interval);
45            var cancelInterval = $scope.$on('$locationChangeSuccess', function () {
46                $interval.cancel($scope.updateInterval);
47                cancelInterval();
48            });
49            update(); // init page
50            first = false;
51        }]
52    );
53})();
Note: See TracBrowser for help on using the repository browser.