From bc60281379d13c200c69edc2ad53bc3d3ae35688 Mon Sep 17 00:00:00 2001 From: FreeScout Date: Sat, 16 May 2020 03:17:42 -0700 Subject: [PATCH] Allow to cancel queued job - closes #606, #611 --- app/Http/Controllers/SystemController.php | 5 +++++ resources/views/system/status.blade.php | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index af7f6c157..3d8b032db 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -201,6 +201,11 @@ public function status(Request $request) public function action(Request $request) { switch ($request->action) { + case 'cancel_job': + \App\Job::where('id', $request->job_id)->delete(); + \Session::flash('flash_success_floating', __('Done')); + break; + case 'delete_failed_jobs': \App\FailedJob::where('queue', $request->failed_queue)->delete(); \Session::flash('flash_success_floating', __('Failed jobs deleted')); diff --git a/resources/views/system/status.blade.php b/resources/views/system/status.blade.php index 6e4f6179e..255c4daf8 100644 --- a/resources/views/system/status.blade.php +++ b/resources/views/system/status.blade.php @@ -172,7 +172,16 @@ - + +
{{ $loop->index+1 }}. {{ json_decode($job->payload, true)['displayName'] }}{{ $loop->index+1 }}. {{ json_decode($job->payload, true)['displayName'] }} +
+ {{ csrf_field() }} + + + + +
+
{{ __('Queue') }}