Skip to content

Commit

Permalink
reformat html
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthakumaran committed Aug 20, 2023
1 parent 90e578f commit dcee67c
Show file tree
Hide file tree
Showing 18 changed files with 385 additions and 177 deletions.
59 changes: 35 additions & 24 deletions lib/exq_ui_web/live/busy_live/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,27 @@
</thead>
<tbody>
<%= for node <- @nodes do %>
<tr>
<td>
<div class="d-flex align-items-center">
<span class="me-2"><%= node.identity %></span>
<%= form_for :signal, "#", [id: "node-#{node.identity}", phx_change: :signal, class: "mb-0 form-check form-switch form-check-inline"], fn f -> %>
<%= hidden_input(f, :name, value: "TSTP") %>
<%= hidden_input(f, :node_id, value: node.identity) %>
<%= checkbox(f, :quiet, value: !node.quiet, disabled: node.quiet, class: "form-check-input", role: "switch", title: "quiet") %>
<% end %>
</div>
<span><b>Queues: </b><%= Enum.join(node.queues, ", ") %></span>
</td>
<td><%= human_time(node.started_at) %></td>
<td><%= node.busy %></td>
</tr>
<tr>
<td>
<div class="d-flex align-items-center">
<span class="me-2"><%= node.identity %></span>
<%= form_for :signal, "#", [id: "node-#{node.identity}", phx_change: :signal, class: "mb-0 form-check form-switch form-check-inline"], fn f -> %>
<%= hidden_input(f, :name, value: "TSTP") %>
<%= hidden_input(f, :node_id, value: node.identity) %>
<%= checkbox(f, :quiet,
value: !node.quiet,
disabled: node.quiet,
class: "form-check-input",
role: "switch",
title: "quiet"
) %>
<% end %>
</div>
<span><b>Queues: </b><%= Enum.join(node.queues, ", ") %></span>
</td>
<td><%= human_time(node.started_at) %></td>
<td><%= node.busy %></td>
</tr>
<% end %>
</tbody>
</table>
Expand All @@ -43,15 +49,20 @@
</thead>
<tbody>
<%= for job <- @jobs do %>
<tr>
<td><%= job.host %></td>
<td><%= job.pid %></td>
<td><%= job.payload.jid %></td>
<td><%= live_redirect job.queue, class: "nounderline", to: Routes.queue_show_path(@socket, job.queue) %></td>
<td><%= job.payload.class %></td>
<td><%= inspect(job.payload.args) %></td>
<td><%= human_time(job.run_at) %></td>
</tr>
<tr>
<td><%= job.host %></td>
<td><%= job.pid %></td>
<td><%= job.payload.jid %></td>
<td>
<%= live_redirect(job.queue,
class: "nounderline",
to: Routes.queue_show_path(@socket, job.queue)
) %>
</td>
<td><%= job.payload.class %></td>
<td><%= inspect(job.payload.args) %></td>
<td><%= human_time(job.run_at) %></td>
</tr>
<% end %>
</tbody>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,38 @@
<div class="d-flex align-items-center mt-2">
<h6 class="mb-0 me-2 text-muted">Historical</h6>
<div class="btn-group btn-group-sm" role="group">
<label phx-target={@myself} phx-click="days" phx-value-days="7" class={"btn #{date_selector_class(@days, 7)}"}>1 week</label>
<label phx-target={@myself} phx-click="days" phx-value-days="30" class={"btn #{date_selector_class(@days, 30)}"}>1 month</label>
<label phx-target={@myself} phx-click="days" phx-value-days="90" class={"btn #{date_selector_class(@days, 90)}"}>3 months</label>
<label phx-target={@myself} phx-click="days" phx-value-days="180" class={"btn #{date_selector_class(@days, 180)}"}>6 months</label>
<label
phx-target={@myself}
phx-click="days"
phx-value-days="7"
class={"btn #{date_selector_class(@days, 7)}"}
>
1 week
</label>
<label
phx-target={@myself}
phx-click="days"
phx-value-days="30"
class={"btn #{date_selector_class(@days, 30)}"}
>
1 month
</label>
<label
phx-target={@myself}
phx-click="days"
phx-value-days="90"
class={"btn #{date_selector_class(@days, 90)}"}
>
3 months
</label>
<label
phx-target={@myself}
phx-click="days"
phx-value-days="180"
class={"btn #{date_selector_class(@days, 180)}"}
>
6 months
</label>
</div>
</div>
</div>
Expand Down
113 changes: 59 additions & 54 deletions lib/exq_ui_web/live/components/job_details_component.html.heex
Original file line number Diff line number Diff line change
@@ -1,59 +1,64 @@
<div class="row">
<%= if @item do %>
<div class="col-4 my-2">
<%= for %{name: name, label: label} <- @actions do %>
<%= link label, class: "btn btn-danger btn-sm me-1", to: "#", phx_click: name, phx_value_raw: @item.raw %>
<% end %>
</div>
<div class="col-12">
<table class="my-2 table table-bordered">
<tbody>
<tr>
<th>Queue</th>
<td><%= @item.job.queue %></td>
</tr>
<tr>
<th>Module</th>
<td><%= @item.job.class %></td>
</tr>
<tr>
<th>JID</th>
<td><%= @item.job.jid %></td>
</tr>
<tr>
<th>Arguments</th>
<td><%= inspect(@item.job.args) %></td>
</tr>
<tr>
<th>Enqueued At</th>
<td><%= human_time(@item.job.enqueued_at) %></td>
</tr>
<tr>
<th>Failed At</th>
<td><%= human_time(@item.job.failed_at) %></td>
</tr>
<tr>
<th>Last Retried At</th>
<td><%= human_time(@item.job.retried_at) %></td>
</tr>
<tr>
<th>Retry Count</th>
<td><%= @item.job.retry_count %></td>
</tr>
<tr>
<th>Error Module</th>
<td><%= @item.job.error_class %></td>
</tr>
<tr>
<th>Error Message</th>
<td><pre><%= @item.job.error_message %></pre></td>
</tr>
</tbody>
</table>
</div>
<div class="col-4 my-2">
<%= for %{name: name, label: label} <- @actions do %>
<%= link(label,
class: "btn btn-danger btn-sm me-1",
to: "#",
phx_click: name,
phx_value_raw: @item.raw
) %>
<% end %>
</div>
<div class="col-12">
<table class="my-2 table table-bordered">
<tbody>
<tr>
<th>Queue</th>
<td><%= @item.job.queue %></td>
</tr>
<tr>
<th>Module</th>
<td><%= @item.job.class %></td>
</tr>
<tr>
<th>JID</th>
<td><%= @item.job.jid %></td>
</tr>
<tr>
<th>Arguments</th>
<td><%= inspect(@item.job.args) %></td>
</tr>
<tr>
<th>Enqueued At</th>
<td><%= human_time(@item.job.enqueued_at) %></td>
</tr>
<tr>
<th>Failed At</th>
<td><%= human_time(@item.job.failed_at) %></td>
</tr>
<tr>
<th>Last Retried At</th>
<td><%= human_time(@item.job.retried_at) %></td>
</tr>
<tr>
<th>Retry Count</th>
<td><%= @item.job.retry_count %></td>
</tr>
<tr>
<th>Error Module</th>
<td><%= @item.job.error_class %></td>
</tr>
<tr>
<th>Error Message</th>
<td><pre><%= @item.job.error_message %></pre></td>
</tr>
</tbody>
</table>
</div>
<% else %>
<div class="col-12">
<div class="my-2 alert alert-danger">Job not found</div>
</div>
<div class="col-12">
<div class="my-2 alert alert-danger">Job not found</div>
</div>
<% end %>
</div>
15 changes: 11 additions & 4 deletions lib/exq_ui_web/live/components/nav_bar_component.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,22 @@
<%= nav_link(@socket, "Dead", Routes.dead_index_path(@socket)) %>
</li>
<%= if Application.get_env(:exq_ui, :exq_scheduler_name) do %>
<li class="nav-item">
<%= nav_link(@socket, "Recurring", Routes.recurring_index_path(@socket)) %>
</li>
<li class="nav-item">
<%= nav_link(@socket, "Recurring", Routes.recurring_index_path(@socket)) %>
</li>
<% end %>
</ul>
</div>
<form class="d-flex align-items-center" phx-target="stats">
<label for="refresh-interval" class="text-light col-auto me-2">Update every</label>
<select name="refresh_interval" phx-hook="Refresh" id="refresh-interval" class="form-select" aria-label="Refresh Interval" phx-update="ignore">
<select
name="refresh_interval"
phx-hook="Refresh"
id="refresh-interval"
class="form-select"
aria-label="Refresh Interval"
phx-update="ignore"
>
<%= options_for_select([1, 2, 5, 10, 30], 5) %>
</select>
</form>
Expand Down
52 changes: 35 additions & 17 deletions lib/exq_ui_web/live/components/pagination_component.html.heex
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
<div>
<%= if @total_page > 0 do %>
<nav class="my-2">
<ul class="pagination pagination-sm justify-content-end mb-0">
<li class={"page-item #{if @current_page == 1, do: "disabled"}"}>
<%= link "«", class: "page-link", to: "#", phx_page_loading: true, phx_click: "page", phx_value_page: 1 %>
</li>
<%= for i <- @start_page..@end_page do %>
<li class={"page-item #{if @current_page == i, do: "active"}"}>
<%= link i, class: "page-link", to: "#", phx_page_loading: true, phx_click: "page", phx_value_page: i %>
</li>
<% end %>
<li class={"page-item #{if @current_page == @total_page, do: "disabled"}"}>
<%= link "»", class: "page-link", to: "#", phx_page_loading: true, phx_click: "page", phx_value_page: @total_page %>
</li>
</ul>
</nav>
<% end %>
<%= if @total_page > 0 do %>
<nav class="my-2">
<ul class="pagination pagination-sm justify-content-end mb-0">
<li class={"page-item #{if @current_page == 1, do: "disabled"}"}>
<%= link("«",
class: "page-link",
to: "#",
phx_page_loading: true,
phx_click: "page",
phx_value_page: 1
) %>
</li>
<%= for i <- @start_page..@end_page do %>
<li class={"page-item #{if @current_page == i, do: "active"}"}>
<%= link(i,
class: "page-link",
to: "#",
phx_page_loading: true,
phx_click: "page",
phx_value_page: i
) %>
</li>
<% end %>
<li class={"page-item #{if @current_page == @total_page, do: "disabled"}"}>
<%= link("»",
class: "page-link",
to: "#",
phx_page_loading: true,
phx_click: "page",
phx_value_page: @total_page
) %>
</li>
</ul>
</nav>
<% end %>
</div>
32 changes: 29 additions & 3 deletions lib/exq_ui_web/live/components/realtime_stats_component.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,44 @@
<div class="d-flex align-items-center">
<h6 class="mb-0 me-2 text-muted">Realtime</h6>
<span class="legend me-2">
<svg class="rounded me-1" width="16" height="16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" preserveAspectRatio="xMidYMid slice" focusable="false"><rect width="100%" height="100%" fill="#007200"></rect></svg>
<svg
class="rounded me-1"
width="16"
height="16"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
preserveAspectRatio="xMidYMid slice"
focusable="false"
>
<rect width="100%" height="100%" fill="#007200"></rect>
</svg>
<span>Processed</span>
</span>
<span class="legend me-2">
<svg class="rounded me-1" width="16" height="16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" preserveAspectRatio="xMidYMid slice" focusable="false"><rect width="100%" height="100%" fill="#dc3545"></rect></svg>
<svg
class="rounded me-1"
width="16"
height="16"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
preserveAspectRatio="xMidYMid slice"
focusable="false"
>
<rect width="100%" height="100%" fill="#dc3545"></rect>
</svg>
<span>Failed</span>
</span>
</div>
</div>
</div>
<div class="row">
<div id="realtime-chart" class="col-12" phx-hook="RealtimePlot" phx-update="ignore" data-tick={@tick_interval}>
<div
id="realtime-chart"
class="col-12"
phx-hook="RealtimePlot"
phx-update="ignore"
data-tick={@tick_interval}
>
</div>
</div>
</div>
Loading

0 comments on commit dcee67c

Please sign in to comment.