diff --git a/Gemfile.lock b/Gemfile.lock index 65b6b86..b49d3b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -197,6 +197,7 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 DEPENDENCIES panoptic! diff --git a/app/controllers/panoptic/jobs/retries_controller.rb b/app/controllers/panoptic/jobs/retries_controller.rb new file mode 100644 index 0000000..6b9f271 --- /dev/null +++ b/app/controllers/panoptic/jobs/retries_controller.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Panoptic + class Jobs::RetriesController < ApplicationController + def create + @job = SolidQueue::Job.find(params[:job_id]) + + @job.retry + redirect_to jobs_path, notice: "Successfully retried Job ##{@job.id}" + end + end +end diff --git a/app/views/layouts/panoptic/application.html.erb b/app/views/layouts/panoptic/application.html.erb index 7a6420e..ac5e1ff 100644 --- a/app/views/layouts/panoptic/application.html.erb +++ b/app/views/layouts/panoptic/application.html.erb @@ -1,19 +1,26 @@ - - Panoptic - <%= csrf_meta_tags %> - <%= csp_meta_tag %> + + Panoptic + <%= csrf_meta_tags %> + <%= csp_meta_tag %> - - - - <%= render "shared/navbar" %> + + + -
- <%= content_for?(:content) ? yield(:content) : yield %> -
+ <%= render "shared/navbar" %> - - + <% flash.each do |type, message| %> + + <% end %> + +
+ <%= content_for?(:content) ? yield(:content) : yield %> +
+ + + diff --git a/app/views/panoptic/jobs/failed/_job.html.erb b/app/views/panoptic/jobs/failed/_job.html.erb index 4f570cc..d5f8ebd 100644 --- a/app/views/panoptic/jobs/failed/_job.html.erb +++ b/app/views/panoptic/jobs/failed/_job.html.erb @@ -5,6 +5,9 @@ <%= job.exception_class %> <%= safe_time_tag job.enqueued_at %> - <%= link_to "Details", failed_job_path(job) %> + <%= link_to "Details", failed_job_path(job), class: "btn btn-link" %> + <%= button_to "Retry Job", job_retry_path(job), + class: "btn btn-link", + form_class: "d-inline" %> diff --git a/app/views/panoptic/jobs/failed/show.html.erb b/app/views/panoptic/jobs/failed/show.html.erb index 25f929e..e982207 100644 --- a/app/views/panoptic/jobs/failed/show.html.erb +++ b/app/views/panoptic/jobs/failed/show.html.erb @@ -5,6 +5,8 @@

<%= @job.class_name %>

+<%= button_to "Retry Job", job_retry_path(@job), class: "btn btn-primary mb-3" %> +