mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 20:00:43 -03: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:
parent
e701857594
commit
1497d128f3
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -267,26 +267,32 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
desc: true,
|
||||
searchType: 'int'
|
||||
},
|
||||
name: {
|
||||
label: 'Name',
|
||||
link: true
|
||||
},
|
||||
description: {
|
||||
label: 'Description'
|
||||
created: {
|
||||
label: 'Date',
|
||||
link: false,
|
||||
searchable: false
|
||||
},
|
||||
status: {
|
||||
label: 'Status',
|
||||
icon: 'icon-circle',
|
||||
"class": 'job-\{\{ job.status \}\}',
|
||||
searchType: 'select',
|
||||
linkTo: "\{\{ job.statusLinkTo \}\}",
|
||||
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" },
|
||||
{ name: "error", value: "error" },
|
||||
{ name: "failed", value: "failed" },
|
||||
{ name: "canceled", value: "canceled" } ]
|
||||
{ name: "canceled", value: "canceled" } ],
|
||||
badgeIcon: 'icon-job-\{\{ job.status \}\}',
|
||||
badgePlacement: 'left',
|
||||
badgeToolTip: "\{\{ job.statusBadgeToolTip \}\}",
|
||||
badgeTipPlacement: 'top',
|
||||
badgeNgHref: "\{\{ job.statusLinkTo \}\}",
|
||||
awToolTip: "\{\{ job.statusBadgeToolTip \}\}",
|
||||
dataPlacement: 'top'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -55,6 +55,11 @@ body {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Disable textarea re-sizing as a general rule */
|
||||
textarea {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
/* Working... spinner */
|
||||
.spinny {
|
||||
display: none;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user