mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 19:51:08 -03:30
Fixing jobs list page: adding launch & cancel buttons
and making sure that you can launch jobs from the jobs list, and that sockets work with the jobs list for live updates
This commit is contained in:
@@ -48,7 +48,7 @@ export function JobsListController($state, $rootScope, $log, $scope, $compile, $
|
|||||||
//ignore
|
//ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
job = Find({ list: list, key: 'id', val: id });
|
job = Find({ list: $scope.jobs, key: 'id', val: id });
|
||||||
if (job.type === 'inventory_update') {
|
if (job.type === 'inventory_update') {
|
||||||
typeId = job.inventory_source;
|
typeId = job.inventory_source;
|
||||||
} else if (job.type === 'project_update') {
|
} else if (job.type === 'project_update') {
|
||||||
@@ -88,21 +88,11 @@ export function JobsListController($state, $rootScope, $log, $scope, $compile, $
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.refreshJobs = function() {
|
$scope.$on('ws-jobs', function(){
|
||||||
$state.reload();
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($rootScope.removeJobStatusChange) {
|
|
||||||
$rootScope.removeJobStatusChange();
|
|
||||||
}
|
|
||||||
$rootScope.removeJobStatusChange = $rootScope.$on('JobStatusChange-jobs', function() {
|
|
||||||
$scope.refreshJobs();
|
$scope.refreshJobs();
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($rootScope.removeScheduleStatusChange) {
|
$scope.$on('ws-schedules', function(){
|
||||||
$rootScope.removeScheduleStatusChange();
|
|
||||||
}
|
|
||||||
$rootScope.removeScheduleStatusChange = $rootScope.$on('ScheduleStatusChange', function() {
|
|
||||||
$state.reload();
|
$state.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export default
|
|||||||
columnClass: 'col-lg-2 col-md-2 col-sm-3 col-xs-4',
|
columnClass: 'col-lg-2 col-md-2 col-sm-3 col-xs-4',
|
||||||
"view": {
|
"view": {
|
||||||
mode: "all",
|
mode: "all",
|
||||||
ngClick: "viewJob(all_job.id)",
|
ngClick: "viewJob(job.id)",
|
||||||
awToolTip: "View the job",
|
awToolTip: "View the job",
|
||||||
dataPlacement: "top"
|
dataPlacement: "top"
|
||||||
},
|
},
|
||||||
@@ -85,21 +85,21 @@ export default
|
|||||||
ngClick: 'relaunchJob($event, job.id)',
|
ngClick: 'relaunchJob($event, job.id)',
|
||||||
awToolTip: 'Relaunch using the same parameters',
|
awToolTip: 'Relaunch using the same parameters',
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
ngShow: "!(all_job.type == 'system_job') && all_job.summary_fields.user_capabilities.start"
|
ngShow: "!(job.type == 'system_job') && job.summary_fields.user_capabilities.start"
|
||||||
},
|
},
|
||||||
cancel: {
|
cancel: {
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
ngClick: 'deleteJob(job.id)',
|
ngClick: 'deleteJob(job.id)',
|
||||||
awToolTip: 'Cancel the job',
|
awToolTip: 'Cancel the job',
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
ngShow: "(all_job.status === 'running'|| all_job.status === 'waiting' || all_job.status === 'pending') && all_job.summary_fields.user_capabilities.start"
|
ngShow: "(job.status === 'running'|| job.status === 'waiting' || job.status === 'pending') && job.summary_fields.user_capabilities.start"
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
ngClick: 'deleteJob(job.id)',
|
ngClick: 'deleteJob(job.id)',
|
||||||
awToolTip: 'Delete the job',
|
awToolTip: 'Delete the job',
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
ngShow: "(all_job.status !== 'running' && all_job.status !== 'waiting' && all_job.status !== 'pending') && all_job.summary_fields.user_capabilities.delete"
|
ngShow: "(job.status !== 'running' && job.status !== 'waiting' && job.status !== 'pending') && job.summary_fields.user_capabilities.delete"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user