mirror of
https://github.com/ansible/awx.git
synced 2026-09-15 16:30:10 -02:30
add completed job section on host page
host completed jobs added on both host page and related section under inventory edit
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
import { N_ } from '../../../src/i18n';
|
||||
import jobsListController from '../jobsList.controller';
|
||||
|
||||
const jobsListTemplate = require('~features/jobs/jobsList.view.html');
|
||||
|
||||
export default {
|
||||
url: '/completed_jobs',
|
||||
params: {
|
||||
job_search: {
|
||||
value: {
|
||||
page_size: '20',
|
||||
job__hosts: '',
|
||||
order_by: '-id'
|
||||
},
|
||||
dynamic: true,
|
||||
squash: ''
|
||||
}
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
label: N_('COMPLETED JOBS')
|
||||
},
|
||||
views: {
|
||||
related: {
|
||||
templateUrl: jobsListTemplate,
|
||||
controller: jobsListController,
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
resolvedModels: [
|
||||
'UnifiedJobModel',
|
||||
(UnifiedJob) => {
|
||||
const models = [
|
||||
new UnifiedJob(['options']),
|
||||
];
|
||||
return Promise.all(models);
|
||||
},
|
||||
],
|
||||
Dataset: [
|
||||
'$stateParams',
|
||||
'Wait',
|
||||
'GetBasePath',
|
||||
'QuerySet',
|
||||
($stateParams, Wait, GetBasePath, qs) => {
|
||||
const hostId = $stateParams.host_id;
|
||||
|
||||
const searchParam = _.assign($stateParams
|
||||
.job_search, { job__hosts: hostId });
|
||||
|
||||
const searchPath = GetBasePath('unified_jobs');
|
||||
|
||||
Wait('start');
|
||||
return qs.search(searchPath, searchParam)
|
||||
.finally(() => Wait('stop'));
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user