1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Correctly link to job details from portal jobs list

This commit is contained in:
mabashian 2017-07-30 14:53:55 -04:00
parent 59157565bd
commit 9816511f51
2 changed files with 29 additions and 0 deletions

View File

@ -29,6 +29,7 @@ export default ['i18n', function(i18n) {
awTipPlacement: "top",
awToolTip: "{{ job.status_tip }}",
dataTipWatch: 'job.status_tip',
ngClick:"viewjobResults(job)",
},
name: {
label: i18n._('Name'),

View File

@ -72,6 +72,34 @@ export function PortalModeJobsController($scope, $state, qs, GetBasePath, Portal
function buildTooltips(job) {
job.status_tip = `Job ${job.status}. Click for details.`;
}
$scope.viewjobResults = function(job) {
var goTojobResults = function(state) {
$state.go(state, { id: job.id }, { reload: true });
};
switch (job.type) {
case 'job':
goTojobResults('jobResult');
break;
case 'ad_hoc_command':
goTojobResults('adHocJobStdout');
break;
case 'system_job':
goTojobResults('managementJobStdout');
break;
case 'project_update':
goTojobResults('scmUpdateStdout');
break;
case 'inventory_update':
goTojobResults('inventorySyncStdout');
break;
case 'workflow_job':
goTojobResults('workflowResults');
break;
}
};
}
PortalModeJobsController.$inject = ['$scope', '$state', 'QuerySet', 'GetBasePath', 'PortalJobsList', 'jobsDataset'];