Merge pull request #3941 from jaredevantabor/jobs-page-fix

Jobs page fix
This commit is contained in:
Jared Tabor 2016-11-10 11:37:22 -05:00 committed by GitHub
commit 27ddb7392b
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"
}
}
});