diff --git a/awx/ui/static/js/helpers/Jobs.js b/awx/ui/static/js/helpers/Jobs.js index 5c903b19dd..63ac307abb 100644 --- a/awx/ui/static/js/helpers/Jobs.js +++ b/awx/ui/static/js/helpers/Jobs.js @@ -69,34 +69,30 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job }; - scope.viewJobLog = function(id, url) { + scope.viewJobLog = function(id) { var list, job; - if (url) { - $location.url(url); + if (scope.completed_jobs) { + list = scope.completed_jobs; + } + else if (scope.running_jobs) { + list = scope.running_jobs; + } + else if (scope.queued_jobs) { + list = scope.queued_jobs; + } + else if (scope.jobs) { + list = scope.jobs; + } + job = Find({ list: list, key: 'id', val: id }); + console.log('job type: ' + job.type); + if (job.type === 'job') { + $location.url('/jobs/' + job.id); } else { - if (scope.completed_jobs) { - list = scope.completed_jobs; - } - else if (scope.running_jobs) { - list = scope.running_jobs; - } - else if (scope.queued_jobs) { - list = scope.queued_jobs; - } - else if (scope.jobs) { - list = scope.jobs; - } - job = Find({ list: list, key: 'id', val: id }); - if (job.type === 'job') { - $location.url('/jobs/' + job.id); - } - else { - LogViewer({ - scope: scope, - url: job.url - }); - } + LogViewer({ + scope: scope, + url: job.url + }); } }; }; diff --git a/awx/ui/static/js/lists/CompletedJobs.js b/awx/ui/static/js/lists/CompletedJobs.js index 3651001211..6829a74186 100644 --- a/awx/ui/static/js/lists/CompletedJobs.js +++ b/awx/ui/static/js/lists/CompletedJobs.js @@ -98,7 +98,7 @@ angular.module('CompletedJobsDefinition', []) }, job_details: { mode: 'all', - href: '/#/jobs/{{ completed_job.id }}', + ngClick: "viewJobLog(completed_job.id)", awToolTip: 'View job details', dataPlacement: 'top' }, diff --git a/awx/ui/static/js/lists/Jobs.js b/awx/ui/static/js/lists/Jobs.js index 6b2c8ec541..d842f6b9fc 100644 --- a/awx/ui/static/js/lists/Jobs.js +++ b/awx/ui/static/js/lists/Jobs.js @@ -94,7 +94,7 @@ angular.module('JobsListDefinition', []) }, job_details: { mode: 'all', - href: '/#/jobs/{{ job.id }}', + ngClick: "viewJobLog(job.id)", awToolTip: 'View job details', dataPlacement: 'top' }, diff --git a/awx/ui/static/js/lists/QueuedJobs.js b/awx/ui/static/js/lists/QueuedJobs.js index 939697a64d..34b584b992 100644 --- a/awx/ui/static/js/lists/QueuedJobs.js +++ b/awx/ui/static/js/lists/QueuedJobs.js @@ -83,7 +83,7 @@ angular.module('QueuedJobsDefinition', []) }, job_details: { mode: 'all', - href: '/#/jobs/{{ queued_job.id }}', + ngClick: "viewJobLog(queued_job.id)", awToolTip: 'View job details', dataPlacement: 'top' } diff --git a/awx/ui/static/js/lists/RunningJobs.js b/awx/ui/static/js/lists/RunningJobs.js index 325b1cbc20..e7b376a463 100644 --- a/awx/ui/static/js/lists/RunningJobs.js +++ b/awx/ui/static/js/lists/RunningJobs.js @@ -83,7 +83,7 @@ angular.module('RunningJobsDefinition', []) }, job_details: { mode: 'all', - href: '/#/jobs/{{ running_job.id }}', + ngClick: "viewJobLog(running_job.id)", awToolTip: 'View job details', dataPlacement: 'top' },