mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 20:05:03 -02:30
Jobs list on Job Templates detail page now closely matches the Jobs tab. Status looks the same, is clickable and offers matching tooltip.
This commit is contained in:
@@ -292,7 +292,8 @@ JobTemplatesAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$l
|
||||
function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, JobTemplateForm,
|
||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||
RelatedPaginateInit, ReturnToCaller, ClearScope, InventoryList, CredentialList,
|
||||
ProjectList, LookUpInit, PromptPasswords, GetBasePath, md5Setup, ParseTypeChange)
|
||||
ProjectList, LookUpInit, PromptPasswords, GetBasePath, md5Setup, ParseTypeChange,
|
||||
JobStatusToolTip, FormatDate)
|
||||
{
|
||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||
//scope.
|
||||
@@ -389,6 +390,25 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route
|
||||
checkSCMStatus();
|
||||
}
|
||||
});
|
||||
|
||||
// Set the status/badge for each related job
|
||||
if (scope.removeRelatedJobs) {
|
||||
scope.removeRelatedJobs();
|
||||
}
|
||||
scope.removeRelatedJobs = scope.$on('relatedjobs', function() {
|
||||
if (scope['jobs'] && scope['jobs'].length) {
|
||||
var cDate;
|
||||
for (var i=0; i < scope['jobs'].length; i++) {
|
||||
// Convert created date to local time zone
|
||||
cDate = new Date(scope['jobs'][i].created);
|
||||
scope['jobs'][i].created = FormatDate(cDate);
|
||||
// Set tooltip and link
|
||||
scope['jobs'][i].statusBadgeToolTip = JobStatusToolTip(scope['jobs'][i].status) +
|
||||
" Click to view status details.";
|
||||
scope['jobs'][i].statusLinkTo = '/#/jobs/' + scope['jobs'][i].id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Retrieve each related set and populate the playbook list
|
||||
if (scope.jobTemplateLoadedRemove) {
|
||||
@@ -610,5 +630,6 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route
|
||||
JobTemplatesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobTemplateForm',
|
||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
||||
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList',
|
||||
'ProjectList', 'LookUpInit', 'PromptPasswords', 'GetBasePath', 'md5Setup', 'ParseTypeChange'
|
||||
'ProjectList', 'LookUpInit', 'PromptPasswords', 'GetBasePath', 'md5Setup', 'ParseTypeChange',
|
||||
'JobStatusToolTip', 'FormatDate'
|
||||
];
|
||||
|
||||
@@ -34,23 +34,18 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
scope[ngc] = "";
|
||||
});
|
||||
|
||||
if (scope[list.name]) {
|
||||
// Convert created date to local time zone
|
||||
if (scope['jobs'] && scope['jobs'].length) {
|
||||
var cDate;
|
||||
for (var i=0; i < scope[list.name].length; i++) {
|
||||
cDate = new Date(scope[list.name][i].created);
|
||||
scope[list.name][i].created = FormatDate(cDate);
|
||||
}
|
||||
}
|
||||
|
||||
if (scope.jobs && scope.jobs.length) {
|
||||
for (var i=0; i < scope.jobs.length; i++) {
|
||||
for (var i=0; i < scope['jobs'].length; i++) {
|
||||
// Convert created date to local time zone
|
||||
cDate = new Date(scope['jobs'][i].created);
|
||||
scope['jobs'][i].created = FormatDate(cDate);
|
||||
// Set tooltip and link
|
||||
scope.jobs[i].statusBadgeToolTip = JobStatusToolTip(scope.jobs[i].status) +
|
||||
" Click to view status details.";
|
||||
scope.jobs[i].statusLinkTo = '/#/jobs/' + scope.jobs[i].id;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user