mirror of
https://github.com/ansible/awx.git
synced 2026-02-24 06:26:00 -03: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'));
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -123,6 +123,11 @@ function(i18n) {
|
|||||||
title: i18n._('Insights'),
|
title: i18n._('Insights'),
|
||||||
skipGenerator: true,
|
skipGenerator: true,
|
||||||
ngIf: "host.insights_system_id!==null && host.summary_fields.inventory.hasOwnProperty('insights_credential_id')"
|
ngIf: "host.insights_system_id!==null && host.summary_fields.inventory.hasOwnProperty('insights_credential_id')"
|
||||||
|
},
|
||||||
|
completed_jobs: {
|
||||||
|
name: 'completed_jobs',
|
||||||
|
title: i18n._('Completed Jobs'),
|
||||||
|
skipGenerator: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
import insightsRoute from '../inventories/insights/insights.route';
|
import insightsRoute from '../inventories/insights/insights.route';
|
||||||
import hostGroupsRoute from './related/groups/hosts-related-groups.route';
|
import hostGroupsRoute from './related/groups/hosts-related-groups.route';
|
||||||
import hostGroupsAssociateRoute from './related/groups/hosts-related-groups-associate.route';
|
import hostGroupsAssociateRoute from './related/groups/hosts-related-groups-associate.route';
|
||||||
|
import hostCompletedJobsRoute from '~features/jobs/routes/hostCompletedJobs.route.js';
|
||||||
import hostGroups from './related/groups/main';
|
import hostGroups from './related/groups/main';
|
||||||
|
|
||||||
export default
|
export default
|
||||||
@@ -87,6 +88,9 @@ angular.module('host', [
|
|||||||
let hostInsights = _.cloneDeep(insightsRoute);
|
let hostInsights = _.cloneDeep(insightsRoute);
|
||||||
hostInsights.name = 'hosts.edit.insights';
|
hostInsights.name = 'hosts.edit.insights';
|
||||||
|
|
||||||
|
let hostCompletedJobs = _.cloneDeep(hostCompletedJobsRoute);
|
||||||
|
hostCompletedJobs.name = 'hosts.edit.completed_jobs';
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
hostTree
|
hostTree
|
||||||
]).then((generated) => {
|
]).then((generated) => {
|
||||||
@@ -97,7 +101,8 @@ angular.module('host', [
|
|||||||
stateExtender.buildDefinition(hostAnsibleFacts),
|
stateExtender.buildDefinition(hostAnsibleFacts),
|
||||||
stateExtender.buildDefinition(hostInsights),
|
stateExtender.buildDefinition(hostInsights),
|
||||||
stateExtender.buildDefinition(hostGroupsRoute),
|
stateExtender.buildDefinition(hostGroupsRoute),
|
||||||
stateExtender.buildDefinition(hostGroupsAssociateRoute)
|
stateExtender.buildDefinition(hostGroupsAssociateRoute),
|
||||||
|
stateExtender.buildDefinition(hostCompletedJobs)
|
||||||
])
|
])
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import hostNestedGroupsAssociateRoute from './related/hosts/related/nested-group
|
|||||||
import groupNestedGroupsAssociateRoute from './related/groups/related/nested-groups/group-nested-groups-associate.route';
|
import groupNestedGroupsAssociateRoute from './related/groups/related/nested-groups/group-nested-groups-associate.route';
|
||||||
import nestedHostsAssociateRoute from './related/groups/related/nested-hosts/group-nested-hosts-associate.route';
|
import nestedHostsAssociateRoute from './related/groups/related/nested-hosts/group-nested-hosts-associate.route';
|
||||||
import nestedHostsAddRoute from './related/groups/related/nested-hosts/group-nested-hosts-add.route';
|
import nestedHostsAddRoute from './related/groups/related/nested-hosts/group-nested-hosts-add.route';
|
||||||
|
import hostCompletedJobsRoute from '~features/jobs/routes/hostCompletedJobs.route.js';
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('inventory', [
|
angular.module('inventory', [
|
||||||
@@ -292,6 +293,9 @@ angular.module('inventory', [
|
|||||||
let smartInventoryAdhocCredential = _.cloneDeep(adhocCredentialRoute);
|
let smartInventoryAdhocCredential = _.cloneDeep(adhocCredentialRoute);
|
||||||
smartInventoryAdhocCredential.name = 'inventories.editSmartInventory.adhoc.credential';
|
smartInventoryAdhocCredential.name = 'inventories.editSmartInventory.adhoc.credential';
|
||||||
|
|
||||||
|
let relatedHostCompletedJobs = _.cloneDeep(hostCompletedJobsRoute);
|
||||||
|
relatedHostCompletedJobs.name = 'inventories.edit.hosts.edit.completed_jobs';
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
standardInventoryAdd,
|
standardInventoryAdd,
|
||||||
standardInventoryEdit,
|
standardInventoryEdit,
|
||||||
@@ -339,7 +343,8 @@ angular.module('inventory', [
|
|||||||
stateExtender.buildDefinition(hostNestedGroupsAssociateRoute),
|
stateExtender.buildDefinition(hostNestedGroupsAssociateRoute),
|
||||||
stateExtender.buildDefinition(nestedHostsAssociateRoute),
|
stateExtender.buildDefinition(nestedHostsAssociateRoute),
|
||||||
stateExtender.buildDefinition(nestedGroupsAdd),
|
stateExtender.buildDefinition(nestedGroupsAdd),
|
||||||
stateExtender.buildDefinition(nestedHostsAddRoute)
|
stateExtender.buildDefinition(nestedHostsAddRoute),
|
||||||
|
stateExtender.buildDefinition(relatedHostCompletedJobs)
|
||||||
])
|
])
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -122,6 +122,11 @@ function(i18n) {
|
|||||||
title: i18n._('Insights'),
|
title: i18n._('Insights'),
|
||||||
skipGenerator: true,
|
skipGenerator: true,
|
||||||
ngIf: "host.insights_system_id!==null && host.summary_fields.inventory.hasOwnProperty('insights_credential_id')"
|
ngIf: "host.insights_system_id!==null && host.summary_fields.inventory.hasOwnProperty('insights_credential_id')"
|
||||||
|
},
|
||||||
|
completed_jobs: {
|
||||||
|
name: 'completed_jobs',
|
||||||
|
title: i18n._('Completed Jobs'),
|
||||||
|
skipGenerator: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user