mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Obtaining job status from API instead of capitalizing
The jobs page and the job detail page now use the API value to display job status
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
export function JobDetailController ($location, $rootScope, $scope, $compile, $routeParams, $log, ClearScope, Breadcrumbs, LoadBreadCrumbs, GetBasePath, Wait, Rest,
|
export function JobDetailController ($location, $rootScope, $scope, $compile, $routeParams, $log, ClearScope, Breadcrumbs, LoadBreadCrumbs, GetBasePath, Wait, Rest,
|
||||||
ProcessErrors, SelectPlay, SelectTask, Socket, GetElapsed, DrawGraph, LoadHostSummary, ReloadHostSummaryList, JobIsFinished, SetTaskStyles, DigestEvent,
|
ProcessErrors, SelectPlay, SelectTask, Socket, GetElapsed, DrawGraph, LoadHostSummary, ReloadHostSummaryList, JobIsFinished, SetTaskStyles, DigestEvent,
|
||||||
UpdateDOM, EventViewer, DeleteJob, PlaybookRun, HostEventsViewer, LoadPlays, LoadTasks, LoadHosts, HostsEdit, ParseVariableString) {
|
UpdateDOM, EventViewer, DeleteJob, PlaybookRun, HostEventsViewer, LoadPlays, LoadTasks, LoadHosts, HostsEdit, ParseVariableString, GetChoices) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
@@ -86,6 +86,14 @@ export function JobDetailController ($location, $rootScope, $scope, $compile, $r
|
|||||||
{ value: 'check', label: 'Check' }
|
{ value: 'check', label: 'Check' }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
GetChoices({
|
||||||
|
scope: scope,
|
||||||
|
url: GetBasePath('unified_jobs'),
|
||||||
|
field: 'status',
|
||||||
|
variable: 'status_choices',
|
||||||
|
// callback: 'choicesReady'
|
||||||
|
});
|
||||||
|
|
||||||
scope.eventsHelpText = "<p><i class=\"fa fa-circle successful-hosts-color\"></i> Successful</p>\n" +
|
scope.eventsHelpText = "<p><i class=\"fa fa-circle successful-hosts-color\"></i> Successful</p>\n" +
|
||||||
"<p><i class=\"fa fa-circle changed-hosts-color\"></i> Changed</p>\n" +
|
"<p><i class=\"fa fa-circle changed-hosts-color\"></i> Changed</p>\n" +
|
||||||
"<p><i class=\"fa fa-circle unreachable-hosts-color\"></i> Unreachable</p>\n" +
|
"<p><i class=\"fa fa-circle unreachable-hosts-color\"></i> Unreachable</p>\n" +
|
||||||
@@ -680,6 +688,13 @@ export function JobDetailController ($location, $rootScope, $scope, $compile, $r
|
|||||||
else {
|
else {
|
||||||
scope.job_status.elapsed = '00:00:00';
|
scope.job_status.elapsed = '00:00:00';
|
||||||
}
|
}
|
||||||
|
scope.status_choices.every(function(status) {
|
||||||
|
if (status.value === scope.job.status) {
|
||||||
|
scope.job_status.status_label = status.label;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
//scope.setSearchAll('host');
|
//scope.setSearchAll('host');
|
||||||
scope.$emit('LoadPlays', data.related.job_events);
|
scope.$emit('LoadPlays', data.related.job_events);
|
||||||
scope.$emit('GetCreatedByNames', data.related.created_by);
|
scope.$emit('GetCreatedByNames', data.related.created_by);
|
||||||
@@ -1305,5 +1320,5 @@ export function JobDetailController ($location, $rootScope, $scope, $compile, $r
|
|||||||
JobDetailController.$inject = [ '$location', '$rootScope', '$scope', '$compile', '$routeParams', '$log', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'GetBasePath',
|
JobDetailController.$inject = [ '$location', '$rootScope', '$scope', '$compile', '$routeParams', '$log', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'GetBasePath',
|
||||||
'Wait', 'Rest', 'ProcessErrors', 'SelectPlay', 'SelectTask', 'Socket', 'GetElapsed', 'DrawGraph', 'LoadHostSummary', 'ReloadHostSummaryList',
|
'Wait', 'Rest', 'ProcessErrors', 'SelectPlay', 'SelectTask', 'Socket', 'GetElapsed', 'DrawGraph', 'LoadHostSummary', 'ReloadHostSummaryList',
|
||||||
'JobIsFinished', 'SetTaskStyles', 'DigestEvent', 'UpdateDOM', 'EventViewer', 'DeleteJob', 'PlaybookRun', 'HostEventsViewer', 'LoadPlays', 'LoadTasks',
|
'JobIsFinished', 'SetTaskStyles', 'DigestEvent', 'UpdateDOM', 'EventViewer', 'DeleteJob', 'PlaybookRun', 'HostEventsViewer', 'LoadPlays', 'LoadTasks',
|
||||||
'LoadHosts', 'HostsEdit', 'ParseVariableString'
|
'LoadHosts', 'HostsEdit', 'ParseVariableString', 'GetChoices'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export default
|
|||||||
awTipPlacement: "top",
|
awTipPlacement: "top",
|
||||||
dataTitle: "{{ all_job.status_popover_title }}",
|
dataTitle: "{{ all_job.status_popover_title }}",
|
||||||
icon: 'icon-job-{{ all_job.status }}',
|
icon: 'icon-job-{{ all_job.status }}',
|
||||||
alt_text: "{{all_job.status | capitalize}}",
|
alt_text: "{{all_job.status_label}}",
|
||||||
iconOnly: true,
|
iconOnly: true,
|
||||||
ngClick:"viewJobLog(all_job.id)",
|
ngClick:"viewJobLog(all_job.id)",
|
||||||
searchable: true,
|
searchable: true,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<div class="job_well">
|
<div class="job_well">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-lg-2 col-md-2 col-sm-2 col-xs-2">Status</label>
|
<label class="col-lg-2 col-md-2 col-sm-2 col-xs-2">Status</label>
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 job_status"><i class="fa icon-job-{{ job_status.status }}"></i> {{ job_status.status }}</div>
|
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 job_status"><i class="fa icon-job-{{ job_status.status }}"></i> {{ job_status.status_label }}</div>
|
||||||
|
|
||||||
<div class="col-lg-4 text-right">
|
<div class="col-lg-4 text-right">
|
||||||
<a href="" id="play-help" aw-pop-over="Live event processing is now paused. Click here to resume." id="play-button-help" data-placement="left" ng-show="pauseLiveEvents" ><i class="fa fa-question"></i></a>
|
<a href="" id="play-help" aw-pop-over="Live event processing is now paused. Click here to resume." id="play-button-help" data-placement="left" ng-show="pauseLiveEvents" ><i class="fa fa-question"></i></a>
|
||||||
|
|||||||
Reference in New Issue
Block a user