Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Maintenance/3.3/WebApp/facttask/facttaskCtrl.js @ 12761

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

#2429: Worked on the maintenance WebApp plugin:

  • Space Usage Page: Displays the number of rows and allocated disk space for every database table
  • Plugin Page: Shows unused plugins and provides functionality to delete all and specific plugins
  • FactTask Page: Allows to aggregate all Job Tasks to a single task for a given job or jobs within an selected time period
  • FactClientInfo Page: Allows to aggregate consecutive FactClientInfo entries with the same state and isallowedtocalculate flag
File size: 2.6 KB
Line 
1(function () {
2    var module = appMaintenancePlugin.getAngularModule();
3    module.controller('app.maintenance.facttaskCtrl',
4        ['$scope', '$interval', 'app.maintenance.facttaskService', function ($scope, $interval, facttaskService) {
5            $scope.interval = defaultPageUpdateInterval;
6            $scope.curJobsPage = 1;
7            $scope.jobsPageSize = 20;
8
9            $scope.fromDate = new Date();
10            $scope.toDate = new Date();
11
12            $scope.fromIsOpen = false;
13            $scope.toIsOpen = false;
14
15            $scope.openFromDateSelection = function ($event) {
16                $event.preventDefault();
17                $event.stopPropagation();
18                $scope.toIsOpen = false;
19                $scope.fromIsOpen = true;
20            };
21
22            $scope.openToDateSelection = function ($event) {
23                $event.preventDefault();
24                $event.stopPropagation();
25                $scope.fromIsOpen = false;
26                $scope.toIsOpen = true;
27            };
28
29            $scope.dateOptions = {
30                formatYear: 'yy',
31                startingDay: 1
32            };
33
34            $scope.getJobs = function () {
35                facttaskService.getJobs({
36                    start: ConvertFromDate($scope.fromDate),
37                    end: ConvertToDate($scope.toDate),
38                    page: $scope.curJobsPage,
39                    size: $scope.jobsPageSize
40                },
41                function (jobPage) {
42                    $scope.jobPage = jobPage;
43                });
44            };
45
46            $scope.aggregateJob = function (id) {
47                facttaskService.aggregateJob({ id: id }, function () {
48                    $scope.getJobs();
49                });
50            };
51
52            $scope.aggregateAllJobs = function () {
53                facttaskService.aggregateAllJobs({
54                    start: ConvertFromDate($scope.fromDate),
55                    end: ConvertToDate($scope.toDate)
56                },
57                function () {
58                    $scope.getJobs();
59                });
60            };
61
62            $scope.changeJobsPage = function () {
63                $scope.getJobs();
64            };
65
66            $scope.updateInterval = $interval($scope.getJobs, $scope.interval);
67            var cancelInterval = $scope.$on('$locationChangeSuccess', function () {
68                $interval.cancel($scope.updateInterval);
69                cancelInterval();
70            });
71            $scope.getJobs(); // init page
72        }]
73    );
74})();
Note: See TracBrowser for help on using the repository browser.