Sha256: 240b2f44f450c3878578ba825c91d44e4428313a03939bc7f761fc0bce36c67e

Contents?: true

Size: 1.96 KB

Versions: 1

Compression:

Stored size: 1.96 KB

Contents

<% if @cron_schedules.present? %>
  <div class="card my-3">
    <div class="table-responsive">
      <table class="table card-table table-bordered table-hover table-sm mb-0">
        <thead>
          <th>Cron Job Name</th>
          <th>Configuration</th>
          <th>
            Set&nbsp;
            <%= tag.button "Toggle", type: "button", class: "btn btn-sm btn-outline-primary", role: "button",
                           data: { bs_toggle: "collapse", bs_target: ".job-properties" },
                           aria: { expanded: false, controls: @cron_schedules.map { |job_key, _| "##{job_key.to_param}" }.join(" ") }
            %>
          </th>
          <th>Class</th>
          <th>Description</th>
          <th>Next scheduled</th>
        </thead>
        <tbody>
          <% @cron_schedules.each do |job_key, job| %>
            <tr>
              <td class="font-monospace"><%= job_key %></td>
              <td class="font-monospace"><%= job[:cron] %></td>
              <td>
                <%=
                  case job[:set]
                  when NilClass
                    "None"
                  when Proc
                    "Lambda/Callable"
                  when Hash
                    tag.button("Preview", type: "button", class: "btn btn-sm btn-outline-primary", role: "button",
                        data: { bs_toggle: "collapse", bs_target: "##{job_key.to_param}" },
                        aria: { expanded: false, controls: job_key.to_param }) +
                      tag.pre(JSON.pretty_generate(job[:set]), id: job_key.to_param, class: "collapse job-properties")
                  end
                %>
              </td>
              <td class="font-monospace"><%= job[:class] %></td>
              <td><%= job[:description] %></td>
              <td><%= Fugit.parse_cron(job[:cron]).next_time.to_local_time %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
    </div>
  </div>
<% else %>
  <em>No cron jobs present.</em>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
good_job-2.4.0 engine/app/views/good_job/cron_schedules/index.html.erb