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:
jaredevantabor 2016-11-10 11:34:06 -05:00
parent 78b8876ed9
commit b3dbc59df6
2 changed files with 7 additions and 17 deletions

View File

@ -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();
});
}

View File

@ -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"
}
}
});