-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename
GoodJob::Job
to GoodJob::Execution
- Also renames `GoodJob::CurrentExecution` to `GoodJob::CurrentThread` - Updates Dashboard controllers and views/partials; puts the "Active Job ID" column first in the table view; wraps UUIDs with `<code>` tags
- Loading branch information
1 parent
de2184b
commit 1484d1f
Showing
40 changed files
with
342 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
module GoodJob | ||
class ExecutionsController < GoodJob::BaseController | ||
def destroy | ||
deleted_count = GoodJob::Execution.where(id: params[:id]).delete_all | ||
message = deleted_count.positive? ? { notice: "Job execution deleted" } : { alert: "Job execution not deleted" } | ||
redirect_to root_path, **message | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
<%= render 'good_job/shared/jobs_table', jobs: @jobs %> | ||
<h1>ActiveJob ID: <code><%= @executions.first.id %></code></h1> | ||
|
||
<%= render 'good_job/shared/executions_table', executions: @executions %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<div class="card my-3"> | ||
<div class="table-responsive"> | ||
<table class="table card-table table-bordered table-hover table-sm mb-0"> | ||
<thead> | ||
<tr> | ||
<th>ActiveJob ID</th> | ||
<th>Execution ID</th> | ||
<th>Job Class</th> | ||
<th>Queue</th> | ||
<th>Scheduled At</th> | ||
<th>Error</th> | ||
<th> | ||
ActiveJob Params | ||
<%= tag.button "Toggle", type: "button", class: "btn btn-sm btn-outline-primary", role: "button", | ||
data: { bs_toggle: "collapse", bs_target: ".job-params" }, | ||
aria: { expanded: false, controls: executions.map { |execution| "##{dom_id(execution, "params")}" }.join(" ") } | ||
%> | ||
</th> | ||
<th>Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% executions.each do |execution| %> | ||
<tr id="<%= dom_id(execution) %>"> | ||
<td> | ||
<%= link_to active_job_path(execution.serialized_params['job_id']) do %> | ||
<code><%= execution.active_job_id %></code> | ||
<% end %> | ||
</td> | ||
<td> | ||
<%= link_to active_job_path(execution.active_job_id, anchor: dom_id(execution)) do %> | ||
<code><%= execution.id %></code> | ||
<% end %> | ||
</td> | ||
<td><%= execution.serialized_params['job_class'] %></td> | ||
<td><%= execution.queue_name %></td> | ||
<td><%= execution.scheduled_at || execution.created_at %></td> | ||
<td class="text-break"><%= truncate(execution.error, length: 1_000) %></td> | ||
<td> | ||
<%= tag.button "Preview", type: "button", class: "btn btn-sm btn-outline-primary", role: "button", | ||
data: { bs_toggle: "collapse", bs_target: "##{dom_id(execution, 'params')}" }, | ||
aria: { expanded: false, controls: dom_id(execution, "params") } | ||
%> | ||
<%= tag.pre JSON.pretty_generate(execution.serialized_params), id: dom_id(execution, "params"), class: "collapse job-params" %> | ||
</td> | ||
<td> | ||
<%= button_to execution_path(execution.id), method: :delete, class: "btn btn-sm btn-outline-danger", title: "Delete execution" do %> | ||
<%= render "good_job/shared/icons/trash" %> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.