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:
Chris Houseknecht
2014-06-30 09:19:15 -04:00
parent cd56906a2b
commit 0473251886
5 changed files with 25 additions and 29 deletions

View File

@@ -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
});
}
};
};

View File

@@ -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'
},

View File

@@ -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'
},

View File

@@ -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'
}

View File

@@ -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'
},