mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 08:57:35 -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,
|
function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, JobTemplateForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||||
RelatedPaginateInit, ReturnToCaller, ClearScope, InventoryList, CredentialList,
|
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
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -389,6 +390,25 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route
|
|||||||
checkSCMStatus();
|
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
|
// Retrieve each related set and populate the playbook list
|
||||||
if (scope.jobTemplateLoadedRemove) {
|
if (scope.jobTemplateLoadedRemove) {
|
||||||
@@ -610,5 +630,6 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route
|
|||||||
JobTemplatesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobTemplateForm',
|
JobTemplatesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobTemplateForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
||||||
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList',
|
'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] = "";
|
scope[ngc] = "";
|
||||||
});
|
});
|
||||||
|
|
||||||
if (scope[list.name]) {
|
if (scope['jobs'] && scope['jobs'].length) {
|
||||||
// Convert created date to local time zone
|
|
||||||
var cDate;
|
var cDate;
|
||||||
for (var i=0; i < scope[list.name].length; i++) {
|
for (var i=0; i < scope['jobs'].length; i++) {
|
||||||
cDate = new Date(scope[list.name][i].created);
|
// Convert created date to local time zone
|
||||||
scope[list.name][i].created = FormatDate(cDate);
|
cDate = new Date(scope['jobs'][i].created);
|
||||||
}
|
scope['jobs'][i].created = FormatDate(cDate);
|
||||||
}
|
// Set tooltip and link
|
||||||
|
|
||||||
if (scope.jobs && scope.jobs.length) {
|
|
||||||
for (var i=0; i < scope.jobs.length; i++) {
|
|
||||||
scope.jobs[i].statusBadgeToolTip = JobStatusToolTip(scope.jobs[i].status) +
|
scope.jobs[i].statusBadgeToolTip = JobStatusToolTip(scope.jobs[i].status) +
|
||||||
" Click to view status details.";
|
" Click to view status details.";
|
||||||
scope.jobs[i].statusLinkTo = '/#/jobs/' + scope.jobs[i].id;
|
scope.jobs[i].statusLinkTo = '/#/jobs/' + scope.jobs[i].id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -267,26 +267,32 @@ angular.module('JobTemplateFormDefinition', [])
|
|||||||
desc: true,
|
desc: true,
|
||||||
searchType: 'int'
|
searchType: 'int'
|
||||||
},
|
},
|
||||||
name: {
|
created: {
|
||||||
label: 'Name',
|
label: 'Date',
|
||||||
link: true
|
link: false,
|
||||||
},
|
searchable: false
|
||||||
description: {
|
|
||||||
label: 'Description'
|
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
label: 'Status',
|
label: 'Status',
|
||||||
icon: 'icon-circle',
|
|
||||||
"class": 'job-\{\{ job.status \}\}',
|
"class": 'job-\{\{ job.status \}\}',
|
||||||
searchType: 'select',
|
searchType: 'select',
|
||||||
|
linkTo: "\{\{ job.statusLinkTo \}\}",
|
||||||
searchOptions: [
|
searchOptions: [
|
||||||
{ name: "new", value: "new" },
|
{ name: "new", value: "new" },
|
||||||
|
{ name: "waiting", value: "waiting" },
|
||||||
{ name: "pending", value: "pending" },
|
{ name: "pending", value: "pending" },
|
||||||
{ name: "running", value: "running" },
|
{ name: "running", value: "running" },
|
||||||
{ name: "successful", value: "successful" },
|
{ name: "successful", value: "successful" },
|
||||||
{ name: "error", value: "error" },
|
{ name: "error", value: "error" },
|
||||||
{ name: "failed", value: "failed" },
|
{ 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;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Disable textarea re-sizing as a general rule */
|
||||||
|
textarea {
|
||||||
|
resize: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* Working... spinner */
|
/* Working... spinner */
|
||||||
.spinny {
|
.spinny {
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
Reference in New Issue
Block a user