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:
parent
52a6cca206
commit
41d3d29ae8
@ -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(() => {
|
||||
|
@ -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) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
let BaseModel;
|
||||
|
||||
function ProjectUpdateModel (method, resource, config) {
|
||||
BaseModel.call(this, 'jobs');
|
||||
BaseModel.call(this, 'project_updates');
|
||||
|
||||
this.Constructor = ProjectUpdateModel;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user