AC-463 Latest changes automating refresh button on Projects and Jobs tab. Cleaned up Cancel/Delete buttons on Jobs tab.

This commit is contained in:
chouseknecht 2013-09-17 12:05:25 -04:00
parent f97b889a9b
commit b7488b7043
6 changed files with 28 additions and 11 deletions

View File

@ -258,6 +258,10 @@ angular.module('ansible', [
CheckLicense();
}
if ($rootScope.timer) {
clearInterval($rootScope.timer);
}
// Make the correct tab active
var base = $location.path().replace(/^\//,'').split('/')[0];
if (base == '') {

View File

@ -70,10 +70,12 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
LoadBreadCrumbs();
scope.refreshJob = function() {
scope.refresh = function() {
scope.search(list.iterator);
}
scope.refreshJob = scope.refresh;
scope.editJob = function(id, name) {
LoadBreadCrumbs({ path: '/jobs/' + id, title: id + ' - ' + name });
$location.path($location.path() + '/' + id);
@ -94,7 +96,7 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
Rest.get()
.success( function(data, status, headers, config) {
var url, action_label, restcall, hdr;
if (data.status == 'pending' || data.status == 'running') {
if (data.status == 'pending' || data.status == 'running' || data.status == 'waiting') {
url = data.related.cancel;
action_label = 'cancel';
hdr = 'Cancel Job';

View File

@ -47,7 +47,8 @@ angular.module('JobsListDefinition', [])
"class": 'job-\{\{ job.status \}\}',
searchType: 'select',
searchOptions: [
{ name: "new", value: "new" },
{ name: "new", value: "new" },
{ name: "waiting", value: "waiting" },
{ name: "pending", value: "pending" },
{ name: "running", value: "running" },
{ name: "successful", value: "successful" },
@ -117,18 +118,18 @@ angular.module('JobsListDefinition', [])
icon: 'icon-minus-sign',
mode: 'all',
ngClick: 'deleteJob(\{\{ job.id \}\})',
"class": 'btn-danger btn-xs',
"class": 'btn-danger btn-xs delete-btn',
awToolTip: 'Cancel a running or pending job',
ngShow: "job.status == 'pending' || job.status == 'running'"
ngShow: "job.status == 'pending' || job.status == 'running' || job.status == 'waiting'"
},
"delete": {
label: 'Delete',
icon: 'icon-trash',
mode: 'all',
ngClick: 'deleteJob(\{\{ job.id \}\})',
"class": 'btn-danger btn-xs',
"class": 'btn-danger btn-xs delete-btn',
awToolTip: 'Remove the selected job from the database',
ngShow: "job.status != 'pending' && job.status != 'running'"
ngShow: "job.status != 'pending' && job.status != 'running' && job.status != 'waiting'"
}
}
});

View File

@ -960,7 +960,11 @@ tr td button i {
/* Large desktop */
@media (min-width: 1200px) {
.delete-btn {
/* Used on job page to make cancel and delete buttons have an equal width */
width: 60px;
}
}
/* Portrait tablet to landscape and desktop */

View File

@ -100,6 +100,11 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
}
});
// Remove leftover timer, if any
//if ((!options.modal) && this.scope.timer) {
// clearInterval(this.scope.timer);
//}
if (options.modal) {
this.scope.formModalActionDisabled = false;
this.scope.formModalInfo = false //Disable info button for default modal

View File

@ -71,9 +71,10 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
// remove lingering popover <div>. Seems to be a bug in TB3 RC1
$(this).remove();
});
// Remove leftover timer
//if (options.mode != 'lookup' && $rootScope.timer) {
// clearInterval($rootScope.timer);
// Remove leftover timer, if any
//if (options.mode != 'lookup' && this.scope.timer) {
// clearInterval(this.scope.timer);
//}
if (options.mode == 'lookup') {