From 7a668c908933328a76581d38feca3d40557f0cba Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 23 Jan 2015 11:36:38 -0500 Subject: [PATCH 1/2] add explanation and result traceback to details page for failed jobs --- awx/ui/static/js/controllers/JobDetail.js | 6 ++++-- awx/ui/static/partials/job_detail.html | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/awx/ui/static/js/controllers/JobDetail.js b/awx/ui/static/js/controllers/JobDetail.js index a6a651cd49..0812d8f1ba 100644 --- a/awx/ui/static/js/controllers/JobDetail.js +++ b/awx/ui/static/js/controllers/JobDetail.js @@ -478,7 +478,7 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar scope.selectedPlay = scope.activePlay; } else { // if we are here, there are no plays and the job has failed, let the user know they may want to consult stdout - if (scope.job_status.status === 'failed' || scope.job_status.status === 'error' && + if ( (scope.job_status.status === 'failed' || scope.job_status.status === 'error') && (!scope.job_status.explanation)) { scope.job_status.explanation = "View stdout for more detail "; } @@ -671,7 +671,9 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar scope.job_status.started = data.started; scope.job_status.status_class = ((data.status === 'error' || data.status === 'failed') && data.job_explanation) ? "alert alert-danger" : ""; scope.job_status.explanation = data.job_explanation; - + if(data.result_traceback) { + scope.job_status.traceback = data.result_traceback; + } if (data.status === 'successful' || data.status === 'failed' || data.status === 'error' || data.status === 'canceled') { scope.job_status.finished = data.finished; scope.liveEventProcessing = false; diff --git a/awx/ui/static/partials/job_detail.html b/awx/ui/static/partials/job_detail.html index 68142f2523..0787dddbf9 100644 --- a/awx/ui/static/partials/job_detail.html +++ b/awx/ui/static/partials/job_detail.html @@ -30,12 +30,21 @@
- -
{{ job_status.status }}
-
+ +
{{ job_status.status }}
-
+
+ +
+
+ +
+ +
+
+ +
Started  {{ job_status.started | date:'MM/dd/yy HH:mm:ss' }}
From ef331d37bbd9939a18f9563f9f5aec2675c1a9c4 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 23 Jan 2015 14:45:18 -0500 Subject: [PATCH 2/2] finished styling for explanation/traceback on the details page --- awx/ui/static/js/controllers/JobDetail.js | 2 +- awx/ui/static/partials/job_detail.html | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/awx/ui/static/js/controllers/JobDetail.js b/awx/ui/static/js/controllers/JobDetail.js index 0812d8f1ba..a1a8a9e6de 100644 --- a/awx/ui/static/js/controllers/JobDetail.js +++ b/awx/ui/static/js/controllers/JobDetail.js @@ -672,7 +672,7 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar scope.job_status.status_class = ((data.status === 'error' || data.status === 'failed') && data.job_explanation) ? "alert alert-danger" : ""; scope.job_status.explanation = data.job_explanation; if(data.result_traceback) { - scope.job_status.traceback = data.result_traceback; + scope.job_status.traceback = data.result_traceback.trim().split('\n').join('
'); } if (data.status === 'successful' || data.status === 'failed' || data.status === 'error' || data.status === 'canceled') { scope.job_status.finished = data.finished; diff --git a/awx/ui/static/partials/job_detail.html b/awx/ui/static/partials/job_detail.html index 0787dddbf9..ac073e29aa 100644 --- a/awx/ui/static/partials/job_detail.html +++ b/awx/ui/static/partials/job_detail.html @@ -14,7 +14,10 @@
-
+ +
{{ job_status.status }}
+ +
@@ -29,11 +32,6 @@
-
- -
{{ job_status.status }}
-
-