Skip to content

Commit

Permalink
Add job block implementation in index page
Browse files Browse the repository at this point in the history
  • Loading branch information
chaadow committed Sep 14, 2024
1 parent 281fa8a commit 355554c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/views/clockwork_web/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<tr>
<th>Job</th>
<th class="width-15">Period</th>
<th class="width-15">Implementation block</th>
<th class="width-15">Last Run</th>
<th class="width-15">Action</th>
</tr>
Expand All @@ -98,6 +99,14 @@
if __
<% end %>
</td>
<td>
<% if block = event.instance_variable_get(:@block) %>
<details>
<summary>Click to open</summary>
<%= RubyVM::AbstractSyntaxTree.of(block, keep_script_lines: true).source.tap(&:strip!) %>
</details>
<% end %>
</td>
<td><%= last_run(@last_runs[event.job]) %></td>
<td><%= button_to enabled ? "Disable" : "Enable", home_job_path(job: event.job, enable: !enabled), disabled: !ClockworkWeb.redis %></td>
</tr>
Expand Down

0 comments on commit 355554c

Please sign in to comment.