diff --git a/app/controllers/solid_queue_web/jobs_controller.rb b/app/controllers/solid_queue_web/jobs_controller.rb index 800a9ce..c4fde60 100644 --- a/app/controllers/solid_queue_web/jobs_controller.rb +++ b/app/controllers/solid_queue_web/jobs_controller.rb @@ -14,8 +14,6 @@ def show @job = SolidQueue::Job .includes(:ready_execution, :scheduled_execution, :claimed_execution, :blocked_execution, :failed_execution) .find(params[:id]) - @failed_execution = @job.failed_execution - @blocked_execution = @job.blocked_execution @execution_status = derive_status(@job) end diff --git a/app/views/solid_queue_web/jobs/index.html.erb b/app/views/solid_queue_web/jobs/index.html.erb index 323f49e..44c64c0 100644 --- a/app/views/solid_queue_web/jobs/index.html.erb +++ b/app/views/solid_queue_web/jobs/index.html.erb @@ -5,11 +5,11 @@
- <%= link_to "Ready", jobs_path(status: "ready", queue: @queue, q: @search), class: @status == "ready" ? "active" : "" %> - <%= link_to "Scheduled", jobs_path(status: "scheduled", queue: @queue, q: @search), class: @status == "scheduled" ? "active" : "" %> - <%= link_to "Running", jobs_path(status: "claimed", queue: @queue, q: @search), class: @status == "claimed" ? "active" : "" %> - <%= link_to "Blocked", jobs_path(status: "blocked", queue: @queue, q: @search), class: @status == "blocked" ? "active" : "" %> - <%= link_to "Failed", jobs_path(status: "failed", queue: @queue, q: @search), class: @status == "failed" ? "active" : "" %> + <%= link_to "Ready", jobs_path(status: "ready", q: @search), class: @status == "ready" ? "active" : "" %> + <%= link_to "Scheduled", jobs_path(status: "scheduled", q: @search), class: @status == "scheduled" ? "active" : "" %> + <%= link_to "Running", jobs_path(status: "claimed", q: @search), class: @status == "claimed" ? "active" : "" %> + <%= link_to "Blocked", jobs_path(status: "blocked", q: @search), class: @status == "blocked" ? "active" : "" %> + <%= link_to "Failed", jobs_path(status: "failed", q: @search), class: @status == "failed" ? "active" : "" %>
<% if discardable && @jobs.any? %>
diff --git a/app/views/solid_queue_web/jobs/show.html.erb b/app/views/solid_queue_web/jobs/show.html.erb index 3dccc52..6a8acfa 100644 --- a/app/views/solid_queue_web/jobs/show.html.erb +++ b/app/views/solid_queue_web/jobs/show.html.erb @@ -7,10 +7,10 @@
- <% if @execution_status == "failed" && @failed_execution %> - <%= button_to "Retry", retry_failed_job_path(@failed_execution), method: :post, + <% if @execution_status == "failed" && @job.failed_execution %> + <%= button_to "Retry", retry_failed_job_path(@job.failed_execution), method: :post, class: "sqd-btn sqd-btn--primary" %> - <%= button_to "Discard", failed_job_path(@failed_execution), method: :delete, + <%= button_to "Discard", failed_job_path(@job.failed_execution), method: :delete, class: "sqd-btn sqd-btn--danger", data: { confirm: "Discard this job?" } %> <% elsif SolidQueueWeb::Job::DISCARDABLE.include?(@execution_status) %> @@ -45,9 +45,9 @@
Concurrency Key
<%= @job.concurrency_key.presence || "—" %>
- <% if @blocked_execution %> + <% if @job.blocked_execution %>
Blocked Until
-
<%= @blocked_execution.expires_at ? @blocked_execution.expires_at.strftime("%Y-%m-%d %H:%M:%S %Z") : "—" %>
+
<%= @job.blocked_execution.expires_at ? @job.blocked_execution.expires_at.strftime("%Y-%m-%d %H:%M:%S %Z") : "—" %>
<% end %>
Enqueued At
@@ -67,14 +67,14 @@
-<% if @failed_execution %> +<% if @job.failed_execution %>

Error

- <%= @failed_execution.exception_class %>: <%= @failed_execution.message %> + <%= @job.failed_execution.exception_class %>: <%= @job.failed_execution.message %>

- <% if @failed_execution.backtrace.present? %> -
<%= Array(@failed_execution.backtrace).join("\n") %>
+ <% if @job.failed_execution.backtrace.present? %> +
<%= Array(@job.failed_execution.backtrace).join("\n") %>
<% end %>
<% end %>