1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

Fix project update model

This commit is contained in:
gconsidine 2018-02-02 10:43:43 -05:00 committed by Jake McDermott
parent 52a6cca206
commit 41d3d29ae8
3 changed files with 25 additions and 3 deletions

View File

@ -473,6 +473,22 @@ function getTime (created) {
return `${hour}:${minute}:${second}`;
}
function pageUp () {
}
function pageDown () {
}
function jumpToStart () {
}
function jumpToEnd () {
}
function showHostDetails (id) {
jobEvent.request('get', id)
.then(() => {

View File

@ -15,13 +15,16 @@ function resolveJob (Job, ProjectUpdate, AdHocCommand, SystemJob, WorkflowJob, $
const { type } = $stateParams;
let Resource;
let related;
switch (type) {
case 'project':
Resource = ProjectUpdate;
related = 'events';
break;
case 'playbook':
Resource = Job;
related = 'job_events';
break;
case 'command':
Resource = AdHocCommand;
@ -38,14 +41,17 @@ function resolveJob (Job, ProjectUpdate, AdHocCommand, SystemJob, WorkflowJob, $
}
return new Resource('get', id)
.then(resource => resource.extend('job_events', {
.then(resource => resource.extend(related, {
pageCache: true,
pageLimit: 3,
params: {
page_size: 100,
order_by: 'start_line'
}
}));
}))
.catch(err => {
console.error(err);
});
}
function JobsRun ($stateExtender, strings) {

View File

@ -1,7 +1,7 @@
let BaseModel;
function ProjectUpdateModel (method, resource, config) {
BaseModel.call(this, 'jobs');
BaseModel.call(this, 'project_updates');
this.Constructor = ProjectUpdateModel;