From 7d168e9fd1459eecd1ca18beb068f7034e16bf4a Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Tue, 1 Apr 2014 10:03:23 -0400 Subject: [PATCH] Pulled in angular-scheduler changes. --- awx/ui/static/js/controllers/Jobs.js | 13 +++++++------ awx/ui/static/js/controllers/Projects.js | 1 + awx/ui/static/js/controllers/Schedules.js | 4 ++++ awx/ui/static/js/helpers/Schedules.js | 11 ++++++++--- awx/ui/static/js/helpers/refresh.js | 2 +- awx/ui/static/js/lists/CompletedJobs.js | 6 +++--- awx/ui/static/js/lists/ScheduledJobs.js | 3 ++- awx/ui/static/js/lists/Schedules.js | 19 ++++++++++++------- bower.json | 2 +- 9 files changed, 39 insertions(+), 22 deletions(-) diff --git a/awx/ui/static/js/controllers/Jobs.js b/awx/ui/static/js/controllers/Jobs.js index 83fc8db386..2f89b6ba2b 100644 --- a/awx/ui/static/js/controllers/Jobs.js +++ b/awx/ui/static/js/controllers/Jobs.js @@ -64,6 +64,13 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea id: 'scheduled-jobs', url: GetBasePath('schedules') }); + + $scope.refreshJobs = function() { + queued_scope.search('queued_job'); + running_scope.search('running_job'); + completed_scope.search('completed_job'); + scheduled_scope.search('schedule'); + }; }); if ($scope.removeChoicesReady) { @@ -94,12 +101,6 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea callback: 'choicesReady' }); - $scope.refreshJobs = function() { - queued_scope.search('queued_job'); - running_scope.search('running_job'); - completed_scope.search('completed_job'); - scheduled_scope.search('schedules'); - }; } JobsListController.$inject = ['$scope', '$compile', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'LoadSchedulesScope', 'LoadJobsScope', 'RunningJobsList', 'CompletedJobsList', diff --git a/awx/ui/static/js/controllers/Projects.js b/awx/ui/static/js/controllers/Projects.js index 42fdff1a70..ce21665f74 100644 --- a/awx/ui/static/js/controllers/Projects.js +++ b/awx/ui/static/js/controllers/Projects.js @@ -58,6 +58,7 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, $scope.projects[i].statusTip = 'No SCM updates have run for this project'; break; case 'updating': + case 'running': $scope.projects[i].statusIcon = 'running pulsate'; $scope.projects[i].statusTip = 'Running! Click for details'; break; diff --git a/awx/ui/static/js/controllers/Schedules.js b/awx/ui/static/js/controllers/Schedules.js index f13818aad3..d1f576ed11 100644 --- a/awx/ui/static/js/controllers/Schedules.js +++ b/awx/ui/static/js/controllers/Schedules.js @@ -74,6 +74,10 @@ GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, Get }); }); + $scope.refreshJobs = function() { + schedules_scope.search(SchedulesList.iterator); + }; + Wait('start'); GetChoices({ diff --git a/awx/ui/static/js/helpers/Schedules.js b/awx/ui/static/js/helpers/Schedules.js index c2bbc3cc75..27a822e3a8 100644 --- a/awx/ui/static/js/helpers/Schedules.js +++ b/awx/ui/static/js/helpers/Schedules.js @@ -412,7 +412,7 @@ angular.module('SchedulesHelper', ['Utilities', 'RestServices', 'SchedulesHelper function(ToggleSchedule, DeleteSchedule, EditSchedule, AddSchedule) { return function(params) { var scope = params.scope, - list = params.list; + parent_scope = params.parent_scope; scope.toggleSchedule = function(event, id) { try { @@ -451,8 +451,12 @@ angular.module('SchedulesHelper', ['Utilities', 'RestServices', 'SchedulesHelper }); }; + scope.refreshJobs = function() { + parent_scope.refreshJobs(); + }; + scope.$on('SchedulesRefresh', function() { - scope.search(list.iterator); + parent_scope.refreshJobs(); }); }; }]) @@ -504,6 +508,7 @@ angular.module('SchedulesHelper', ['Utilities', 'RestServices', 'SchedulesHelper SchedulesControllerInit({ scope: scope, + parent_scope: parent_scope, list: list }); @@ -531,7 +536,7 @@ angular.module('SchedulesHelper', ['Utilities', 'RestServices', 'SchedulesHelper } } } - + // Set the item type label if (list.fields.type) { parent_scope.type_choices.every(function(choice) { diff --git a/awx/ui/static/js/helpers/refresh.js b/awx/ui/static/js/helpers/refresh.js index a7f25d6f9b..54339c5076 100644 --- a/awx/ui/static/js/helpers/refresh.js +++ b/awx/ui/static/js/helpers/refresh.js @@ -25,7 +25,7 @@ angular.module('RefreshHelper', ['RestServices', 'Utilities', 'PaginationHelpers set = params.set, iterator = params.iterator, url = params.url; - + scope.current_url = url; Rest.setUrl(url); Rest.get() diff --git a/awx/ui/static/js/lists/CompletedJobs.js b/awx/ui/static/js/lists/CompletedJobs.js index 30b871b02d..aef27a7b1d 100644 --- a/awx/ui/static/js/lists/CompletedJobs.js +++ b/awx/ui/static/js/lists/CompletedJobs.js @@ -23,8 +23,6 @@ angular.module('CompletedJobsDefinition', []) id: { label: 'Job ID', ngClick:"viewJobLog(completed_job.id)", - key: true, - desc: true, searchType: 'int', columnClass: 'col-md-1 col-sm-2 col-xs-2' }, @@ -57,7 +55,9 @@ angular.module('CompletedJobsDefinition', []) link: false, searchable: false, filter: "date:'MM/dd/yy HH:mm:ss'", - columnClass: "col-md-2 hidden-xs" + columnClass: "col-md-2 hidden-xs", + key: true, + desc: true }, type: { label: 'Type', diff --git a/awx/ui/static/js/lists/ScheduledJobs.js b/awx/ui/static/js/lists/ScheduledJobs.js index 2154b3b55f..6dbfe620a9 100644 --- a/awx/ui/static/js/lists/ScheduledJobs.js +++ b/awx/ui/static/js/lists/ScheduledJobs.js @@ -27,7 +27,8 @@ angular.module('ScheduledJobsDefinition', []) awTipPlacement: "top", icon: 'icon-job-{{ schedule.status }}', iconOnly: true, - ngClick: "toggleSchedule($event, schedule.id)" + ngClick: "toggleSchedule($event, schedule.id)", + searchable: false }, next_run: { label: 'Next Run', diff --git a/awx/ui/static/js/lists/Schedules.js b/awx/ui/static/js/lists/Schedules.js index c103fd5c66..bb1e1c0318 100644 --- a/awx/ui/static/js/lists/Schedules.js +++ b/awx/ui/static/js/lists/Schedules.js @@ -26,20 +26,20 @@ angular.module('SchedulesListDefinition', []) ngClick: "editSchedule(schedule.id)", columnClass: "col-md-3 col-sm-3 col-xs-3" }, + dtstart: { + label: 'First Run', + filter: "date:'MM/dd/yy HH:mm:ss'", + searchable: false, + columnClass: "col-md-2 col-sm-3 hidden-xs" + }, next_run: { label: 'Next Run', filter: "date:'MM/dd/yy HH:mm:ss'", searchable: false, columnClass: "col-md-2 col-sm-3 col-xs-3" }, - dtstart: { - label: 'Start', - filter: "date:'MM/dd/yy HH:mm:ss'", - searchable: false, - columnClass: "col-md-2 col-sm-3 hidden-xs" - }, dtend: { - label: 'End', + label: 'Final Run', filter: "date:'MM/dd/yy HH:mm:ss'", searchable: false, columnClass: "col-md-2 col-sm-3 hidden-xs" @@ -52,6 +52,11 @@ angular.module('SchedulesListDefinition', []) ngClick: 'addSchedule()', awToolTip: 'Add a new schedule' }, + refresh: { + mode: 'all', + awToolTip: "Refresh the page", + ngClick: "refreshJobs()" + }, stream: { ngClick: "showActivity()", awToolTip: "View Activity Stream", diff --git a/bower.json b/bower.json index a6072f82cd..621f2e1647 100644 --- a/bower.json +++ b/bower.json @@ -15,7 +15,7 @@ "angular-md5": "~0.1.7", "angular-resource": "~1.2.12", "angular-sanitize": "~1.2.12", - "angular-scheduler": "~0.0.5", + "angular-scheduler": "~0.0.6", "bootstrap": "~3.1.1", "components-font-awesome": "~4.0.3", "less.js": "~1.6.3",