mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -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:
parent
78b8876ed9
commit
b3dbc59df6
@ -48,7 +48,7 @@ export function JobsListController($state, $rootScope, $log, $scope, $compile, $
|
||||
//ignore
|
||||
}
|
||||
|
||||
job = Find({ list: list, key: 'id', val: id });
|
||||
job = Find({ list: $scope.jobs, key: 'id', val: id });
|
||||
if (job.type === 'inventory_update') {
|
||||
typeId = job.inventory_source;
|
||||
} else if (job.type === 'project_update') {
|
||||
@ -88,21 +88,11 @@ export function JobsListController($state, $rootScope, $log, $scope, $compile, $
|
||||
|
||||
};
|
||||
|
||||
$scope.refreshJobs = function() {
|
||||
$state.reload();
|
||||
};
|
||||
|
||||
if ($rootScope.removeJobStatusChange) {
|
||||
$rootScope.removeJobStatusChange();
|
||||
}
|
||||
$rootScope.removeJobStatusChange = $rootScope.$on('JobStatusChange-jobs', function() {
|
||||
$scope.$on('ws-jobs', function(){
|
||||
$scope.refreshJobs();
|
||||
});
|
||||
|
||||
if ($rootScope.removeScheduleStatusChange) {
|
||||
$rootScope.removeScheduleStatusChange();
|
||||
}
|
||||
$rootScope.removeScheduleStatusChange = $rootScope.$on('ScheduleStatusChange', function() {
|
||||
$scope.$on('ws-schedules', function(){
|
||||
$state.reload();
|
||||
});
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ export default
|
||||
columnClass: 'col-lg-2 col-md-2 col-sm-3 col-xs-4',
|
||||
"view": {
|
||||
mode: "all",
|
||||
ngClick: "viewJob(all_job.id)",
|
||||
ngClick: "viewJob(job.id)",
|
||||
awToolTip: "View the job",
|
||||
dataPlacement: "top"
|
||||
},
|
||||
@ -85,21 +85,21 @@ export default
|
||||
ngClick: 'relaunchJob($event, job.id)',
|
||||
awToolTip: 'Relaunch using the same parameters',
|
||||
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: {
|
||||
mode: 'all',
|
||||
ngClick: 'deleteJob(job.id)',
|
||||
awToolTip: 'Cancel the job',
|
||||
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": {
|
||||
mode: 'all',
|
||||
ngClick: 'deleteJob(job.id)',
|
||||
awToolTip: 'Delete the job',
|
||||
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"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user