mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Job detail page refactor
For SCM update and inventory sync job types, clicking on job details now gives you the log viewer dialog rather than attempting to load the job detail page and ending in error.
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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'
|
||||
},
|
||||
|
||||
@@ -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'
|
||||
},
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user