mirror of
https://github.com/ansible/awx.git
synced 2026-03-25 04:45:03 -02:30
Fix project update model
This commit is contained in:
committed by
Jake McDermott
parent
52a6cca206
commit
41d3d29ae8
@@ -473,6 +473,22 @@ function getTime (created) {
|
|||||||
return `${hour}:${minute}:${second}`;
|
return `${hour}:${minute}:${second}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pageUp () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function pageDown () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function jumpToStart () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function jumpToEnd () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function showHostDetails (id) {
|
function showHostDetails (id) {
|
||||||
jobEvent.request('get', id)
|
jobEvent.request('get', id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
@@ -15,13 +15,16 @@ function resolveJob (Job, ProjectUpdate, AdHocCommand, SystemJob, WorkflowJob, $
|
|||||||
const { type } = $stateParams;
|
const { type } = $stateParams;
|
||||||
|
|
||||||
let Resource;
|
let Resource;
|
||||||
|
let related;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'project':
|
case 'project':
|
||||||
Resource = ProjectUpdate;
|
Resource = ProjectUpdate;
|
||||||
|
related = 'events';
|
||||||
break;
|
break;
|
||||||
case 'playbook':
|
case 'playbook':
|
||||||
Resource = Job;
|
Resource = Job;
|
||||||
|
related = 'job_events';
|
||||||
break;
|
break;
|
||||||
case 'command':
|
case 'command':
|
||||||
Resource = AdHocCommand;
|
Resource = AdHocCommand;
|
||||||
@@ -38,14 +41,17 @@ function resolveJob (Job, ProjectUpdate, AdHocCommand, SystemJob, WorkflowJob, $
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Resource('get', id)
|
return new Resource('get', id)
|
||||||
.then(resource => resource.extend('job_events', {
|
.then(resource => resource.extend(related, {
|
||||||
pageCache: true,
|
pageCache: true,
|
||||||
pageLimit: 3,
|
pageLimit: 3,
|
||||||
params: {
|
params: {
|
||||||
page_size: 100,
|
page_size: 100,
|
||||||
order_by: 'start_line'
|
order_by: 'start_line'
|
||||||
}
|
}
|
||||||
}));
|
}))
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function JobsRun ($stateExtender, strings) {
|
function JobsRun ($stateExtender, strings) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
let BaseModel;
|
let BaseModel;
|
||||||
|
|
||||||
function ProjectUpdateModel (method, resource, config) {
|
function ProjectUpdateModel (method, resource, config) {
|
||||||
BaseModel.call(this, 'jobs');
|
BaseModel.call(this, 'project_updates');
|
||||||
|
|
||||||
this.Constructor = ProjectUpdateModel;
|
this.Constructor = ProjectUpdateModel;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user