From dcee67c1fb00dc24a2beefce0c2e6559a44e2934 Mon Sep 17 00:00:00 2001
From: Anantha Kumaran
Date: Fri, 18 Aug 2023 09:05:03 +0530
Subject: [PATCH] reformat html
---
lib/exq_ui_web/live/busy_live/index.html.heex | 59 +++++----
.../historical_stats_component.html.heex | 36 +++++-
.../job_details_component.html.heex | 113 +++++++++---------
.../components/nav_bar_component.html.heex | 15 ++-
.../components/pagination_component.html.heex | 52 +++++---
.../realtime_stats_component.html.heex | 32 ++++-
.../live/components/table_component.html.heex | 59 +++++----
lib/exq_ui_web/live/dead_live/index.html.heex | 11 +-
lib/exq_ui_web/live/dead_live/show.html.heex | 7 +-
.../live/queue_live/index.html.heex | 35 ++++--
lib/exq_ui_web/live/queue_live/show.html.heex | 15 ++-
.../live/recurring_live/index.html.heex | 55 ++++++---
.../live/retry_live/index.html.heex | 12 +-
lib/exq_ui_web/live/retry_live/show.html.heex | 7 +-
.../live/scheduled_live/index.html.heex | 11 +-
.../live/scheduled_live/show.html.heex | 7 +-
.../templates/layout/live.html.heex | 20 +++-
.../templates/layout/root.html.heex | 16 ++-
18 files changed, 385 insertions(+), 177 deletions(-)
diff --git a/lib/exq_ui_web/live/busy_live/index.html.heex b/lib/exq_ui_web/live/busy_live/index.html.heex
index c31ac0f..1796028 100644
--- a/lib/exq_ui_web/live/busy_live/index.html.heex
+++ b/lib/exq_ui_web/live/busy_live/index.html.heex
@@ -10,21 +10,27 @@
<%= for node <- @nodes do %>
-
-
-
- <%= node.identity %>
- <%= 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 %>
-
- Queues: <%= Enum.join(node.queues, ", ") %>
- |
- <%= human_time(node.started_at) %> |
- <%= node.busy %> |
-
+
+
+
+ <%= node.identity %>
+ <%= 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 %>
+
+ Queues: <%= Enum.join(node.queues, ", ") %>
+ |
+ <%= human_time(node.started_at) %> |
+ <%= node.busy %> |
+
<% end %>
@@ -43,15 +49,20 @@
<%= for job <- @jobs do %>
-
- <%= job.host %> |
- <%= job.pid %> |
- <%= job.payload.jid %> |
- <%= live_redirect job.queue, class: "nounderline", to: Routes.queue_show_path(@socket, job.queue) %> |
- <%= job.payload.class %> |
- <%= inspect(job.payload.args) %> |
- <%= human_time(job.run_at) %> |
-
+
+ <%= job.host %> |
+ <%= job.pid %> |
+ <%= job.payload.jid %> |
+
+ <%= live_redirect(job.queue,
+ class: "nounderline",
+ to: Routes.queue_show_path(@socket, job.queue)
+ ) %>
+ |
+ <%= job.payload.class %> |
+ <%= inspect(job.payload.args) %> |
+ <%= human_time(job.run_at) %> |
+
<% end %>
diff --git a/lib/exq_ui_web/live/components/historical_stats_component.html.heex b/lib/exq_ui_web/live/components/historical_stats_component.html.heex
index 0c54a58..4254ae2 100644
--- a/lib/exq_ui_web/live/components/historical_stats_component.html.heex
+++ b/lib/exq_ui_web/live/components/historical_stats_component.html.heex
@@ -4,10 +4,38 @@
Historical
-
-
-
-
+
+
+
+
diff --git a/lib/exq_ui_web/live/components/job_details_component.html.heex b/lib/exq_ui_web/live/components/job_details_component.html.heex
index 51e8e4d..375c154 100644
--- a/lib/exq_ui_web/live/components/job_details_component.html.heex
+++ b/lib/exq_ui_web/live/components/job_details_component.html.heex
@@ -1,59 +1,64 @@
<%= if @item do %>
-
- <%= 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 %>
-
-
-
-
-
- Queue |
- <%= @item.job.queue %> |
-
-
- Module |
- <%= @item.job.class %> |
-
-
- JID |
- <%= @item.job.jid %> |
-
-
- Arguments |
- <%= inspect(@item.job.args) %> |
-
-
- Enqueued At |
- <%= human_time(@item.job.enqueued_at) %> |
-
-
- Failed At |
- <%= human_time(@item.job.failed_at) %> |
-
-
- Last Retried At |
- <%= human_time(@item.job.retried_at) %> |
-
-
- Retry Count |
- <%= @item.job.retry_count %> |
-
-
- Error Module |
- <%= @item.job.error_class %> |
-
-
- Error Message |
- <%= @item.job.error_message %> |
-
-
-
-
+
+ <%= 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 %>
+
+
+
+
+
+ Queue |
+ <%= @item.job.queue %> |
+
+
+ Module |
+ <%= @item.job.class %> |
+
+
+ JID |
+ <%= @item.job.jid %> |
+
+
+ Arguments |
+ <%= inspect(@item.job.args) %> |
+
+
+ Enqueued At |
+ <%= human_time(@item.job.enqueued_at) %> |
+
+
+ Failed At |
+ <%= human_time(@item.job.failed_at) %> |
+
+
+ Last Retried At |
+ <%= human_time(@item.job.retried_at) %> |
+
+
+ Retry Count |
+ <%= @item.job.retry_count %> |
+
+
+ Error Module |
+ <%= @item.job.error_class %> |
+
+
+ Error Message |
+ <%= @item.job.error_message %> |
+
+
+
+
<% else %>
-
+
<% end %>
diff --git a/lib/exq_ui_web/live/components/nav_bar_component.html.heex b/lib/exq_ui_web/live/components/nav_bar_component.html.heex
index e863caa..cc45ac7 100644
--- a/lib/exq_ui_web/live/components/nav_bar_component.html.heex
+++ b/lib/exq_ui_web/live/components/nav_bar_component.html.heex
@@ -22,15 +22,22 @@
<%= nav_link(@socket, "Dead", Routes.dead_index_path(@socket)) %>
<%= if Application.get_env(:exq_ui, :exq_scheduler_name) do %>
-
- <%= nav_link(@socket, "Recurring", Routes.recurring_index_path(@socket)) %>
-
+
+ <%= nav_link(@socket, "Recurring", Routes.recurring_index_path(@socket)) %>
+
<% end %>
diff --git a/lib/exq_ui_web/live/components/pagination_component.html.heex b/lib/exq_ui_web/live/components/pagination_component.html.heex
index a325378..7094882 100644
--- a/lib/exq_ui_web/live/components/pagination_component.html.heex
+++ b/lib/exq_ui_web/live/components/pagination_component.html.heex
@@ -1,19 +1,37 @@
-<%= if @total_page > 0 do %>
-
-<% end %>
+ <%= if @total_page > 0 do %>
+
+ <% end %>
diff --git a/lib/exq_ui_web/live/components/realtime_stats_component.html.heex b/lib/exq_ui_web/live/components/realtime_stats_component.html.heex
index ba7e20c..a6ddef1 100644
--- a/lib/exq_ui_web/live/components/realtime_stats_component.html.heex
+++ b/lib/exq_ui_web/live/components/realtime_stats_component.html.heex
@@ -4,18 +4,44 @@
Realtime
-
+
Processed
-
+
Failed
diff --git a/lib/exq_ui_web/live/components/table_component.html.heex b/lib/exq_ui_web/live/components/table_component.html.heex
index d2e6adb..3d4a54b 100644
--- a/lib/exq_ui_web/live/components/table_component.html.heex
+++ b/lib/exq_ui_web/live/components/table_component.html.heex
@@ -2,38 +2,57 @@
<%= for %{name: name, label: label} <- @actions do %>
-
+
<% end %>
- <.live_component module={ExqUIWeb.PaginationComponent} id="pagination" total={@total} current_page={@current_page} page_size={@page_size} />
+ <.live_component
+ module={ExqUIWeb.PaginationComponent}
+ id="pagination"
+ total={@total}
+ current_page={@current_page}
+ page_size={@page_size}
+ />
- <%= f = form_for :table, "#", [phx_submit: :action] %>
-
- <%= hidden_input(f, :action, class: "js-hidden-submit") %>
-
+ <% end %>
diff --git a/lib/exq_ui_web/live/dead_live/index.html.heex b/lib/exq_ui_web/live/dead_live/index.html.heex
index 47c21d3..75357a9 100644
--- a/lib/exq_ui_web/live/dead_live/index.html.heex
+++ b/lib/exq_ui_web/live/dead_live/index.html.heex
@@ -1,2 +1,11 @@
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
-<.live_component module={ExqUIWeb.TableComponent} id="dead-table" actions={@actions} columns={@columns} items={@items} total={@total} current_page={@current_page} page_size={@page_size} />
+<.live_component
+ module={ExqUIWeb.TableComponent}
+ id="dead-table"
+ actions={@actions}
+ columns={@columns}
+ items={@items}
+ total={@total}
+ current_page={@current_page}
+ page_size={@page_size}
+/>
diff --git a/lib/exq_ui_web/live/dead_live/show.html.heex b/lib/exq_ui_web/live/dead_live/show.html.heex
index 4728ed9..120b64b 100644
--- a/lib/exq_ui_web/live/dead_live/show.html.heex
+++ b/lib/exq_ui_web/live/dead_live/show.html.heex
@@ -1,2 +1,7 @@
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
-<.live_component module={ExqUIWeb.JobDetailsComponent} id="jobs-details" item={@item} actions={@actions} />
+<.live_component
+ module={ExqUIWeb.JobDetailsComponent}
+ id="jobs-details"
+ item={@item}
+ actions={@actions}
+/>
diff --git a/lib/exq_ui_web/live/queue_live/index.html.heex b/lib/exq_ui_web/live/queue_live/index.html.heex
index d3ae379..773f334 100644
--- a/lib/exq_ui_web/live/queue_live/index.html.heex
+++ b/lib/exq_ui_web/live/queue_live/index.html.heex
@@ -9,19 +9,28 @@
<%= for queue <- @queues do %>
-
-
-
- <%= live_redirect queue.name, class: "nounderline", to: Routes.queue_show_path(@socket, queue.name) %>
-
- |
- <%= queue.count %> |
-
-
- <%= link "Delete", class: "btn btn-danger btn-sm", to: "#", phx_click: "delete", phx_value_name: queue.name, data: [confirm: "Are you sure?"] %>
-
- |
-
+
+
+
+ <%= live_redirect(queue.name,
+ class: "nounderline",
+ to: Routes.queue_show_path(@socket, queue.name)
+ ) %>
+
+ |
+ <%= queue.count %> |
+
+
+ <%= link("Delete",
+ class: "btn btn-danger btn-sm",
+ to: "#",
+ phx_click: "delete",
+ phx_value_name: queue.name,
+ data: [confirm: "Are you sure?"]
+ ) %>
+
+ |
+
<% end %>
diff --git a/lib/exq_ui_web/live/queue_live/show.html.heex b/lib/exq_ui_web/live/queue_live/show.html.heex
index 8f3a7ec..38e96eb 100644
--- a/lib/exq_ui_web/live/queue_live/show.html.heex
+++ b/lib/exq_ui_web/live/queue_live/show.html.heex
@@ -2,8 +2,19 @@
- Enqueued jobs in <%= @name %> queue: <%= @total %>
+
+ Enqueued jobs in <%= @name %> queue: <%= @total %>
+
-<.live_component module={ExqUIWeb.TableComponent} id="queues-table" actions={@actions} columns={@columns} items={@items} total={@total} current_page={@current_page} page_size={@page_size} />
+<.live_component
+ module={ExqUIWeb.TableComponent}
+ id="queues-table"
+ actions={@actions}
+ columns={@columns}
+ items={@items}
+ total={@total}
+ current_page={@current_page}
+ page_size={@page_size}
+/>
diff --git a/lib/exq_ui_web/live/recurring_live/index.html.heex b/lib/exq_ui_web/live/recurring_live/index.html.heex
index 17df406..58a069f 100644
--- a/lib/exq_ui_web/live/recurring_live/index.html.heex
+++ b/lib/exq_ui_web/live/recurring_live/index.html.heex
@@ -21,25 +21,42 @@
<%= for item <- @items do %>
-
-
- <%= form_for :active, "#", [id: "schedule-#{item.schedule.name}", phx_change: :active, class: "mb-0 form-check form-switch form-check-inline", style: "margin: auto;display: flex;justify-content: center"], fn f -> %>
- <%= hidden_input(f, :name, value: item.schedule.name) %>
- <%= hidden_input(f, :enabled, value: !item.schedule.schedule_opts.enabled) %>
- <%= checkbox(f, :toggle, value: item.schedule.schedule_opts.enabled, class: "form-check-input", role: "switch", title: "disable") %>
- <% end %>
- |
- <%= item.schedule.name %> |
- <%= item.schedule.description %> |
- <%= item.cron %> |
- <%= item.schedule.timezone %> |
- <%= human_time(item.last_run) %> |
- <%= human_time(item.next_run) %> |
- <%= item.schedule.job.queue %> |
- <%= item.schedule.job.class %> |
- <%= inspect(item.schedule.job.args) %> |
- <%= link "Enqueue Now", class: "btn btn-danger btn-sm", to: "#", phx_click: "enqueue_now", phx_value_name: item.schedule.name %> |
-
+
+
+ <%= form_for :active, "#", [id: "schedule-#{item.schedule.name}", phx_change: :active, class: "mb-0 form-check form-switch form-check-inline", style: "margin: auto;display: flex;justify-content: center"], fn f -> %>
+ <%= hidden_input(f, :name, value: item.schedule.name) %>
+ <%= hidden_input(f, :enabled, value: !item.schedule.schedule_opts.enabled) %>
+ <%= checkbox(f, :toggle,
+ value: item.schedule.schedule_opts.enabled,
+ class: "form-check-input",
+ role: "switch",
+ title: "disable"
+ ) %>
+ <% end %>
+ |
+ <%= item.schedule.name %> |
+ <%= item.schedule.description %> |
+ <%= item.cron %> |
+ <%= item.schedule.timezone %> |
+ <%= human_time(item.last_run) %> |
+
+ <%= human_time(item.next_run) %>
+ |
+ <%= item.schedule.job.queue %> |
+ <%= item.schedule.job.class %> |
+ <%= inspect(item.schedule.job.args) %> |
+
+ <%= link("Enqueue Now",
+ class: "btn btn-danger btn-sm",
+ to: "#",
+ phx_click: "enqueue_now",
+ phx_value_name: item.schedule.name
+ ) %>
+ |
+
<% end %>
diff --git a/lib/exq_ui_web/live/retry_live/index.html.heex b/lib/exq_ui_web/live/retry_live/index.html.heex
index ea08910..f7d4801 100644
--- a/lib/exq_ui_web/live/retry_live/index.html.heex
+++ b/lib/exq_ui_web/live/retry_live/index.html.heex
@@ -1,3 +1,11 @@
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
-<.live_component module={ExqUIWeb.TableComponent} id="retry-table" actions={@actions} columns={@columns} items={@items} total={@total} current_page={@current_page} page_size={@page_size} />
-
+<.live_component
+ module={ExqUIWeb.TableComponent}
+ id="retry-table"
+ actions={@actions}
+ columns={@columns}
+ items={@items}
+ total={@total}
+ current_page={@current_page}
+ page_size={@page_size}
+/>
diff --git a/lib/exq_ui_web/live/retry_live/show.html.heex b/lib/exq_ui_web/live/retry_live/show.html.heex
index 4728ed9..120b64b 100644
--- a/lib/exq_ui_web/live/retry_live/show.html.heex
+++ b/lib/exq_ui_web/live/retry_live/show.html.heex
@@ -1,2 +1,7 @@
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
-<.live_component module={ExqUIWeb.JobDetailsComponent} id="jobs-details" item={@item} actions={@actions} />
+<.live_component
+ module={ExqUIWeb.JobDetailsComponent}
+ id="jobs-details"
+ item={@item}
+ actions={@actions}
+/>
diff --git a/lib/exq_ui_web/live/scheduled_live/index.html.heex b/lib/exq_ui_web/live/scheduled_live/index.html.heex
index 8d84cbe..3b83c96 100644
--- a/lib/exq_ui_web/live/scheduled_live/index.html.heex
+++ b/lib/exq_ui_web/live/scheduled_live/index.html.heex
@@ -1,2 +1,11 @@
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
-<.live_component module={ExqUIWeb.TableComponent} id="scheduled-table" actions={@actions} columns={@columns} items={@items} total={@total} current_page={@current_page} page_size={@page_size} />
+<.live_component
+ module={ExqUIWeb.TableComponent}
+ id="scheduled-table"
+ actions={@actions}
+ columns={@columns}
+ items={@items}
+ total={@total}
+ current_page={@current_page}
+ page_size={@page_size}
+/>
diff --git a/lib/exq_ui_web/live/scheduled_live/show.html.heex b/lib/exq_ui_web/live/scheduled_live/show.html.heex
index 4728ed9..120b64b 100644
--- a/lib/exq_ui_web/live/scheduled_live/show.html.heex
+++ b/lib/exq_ui_web/live/scheduled_live/show.html.heex
@@ -1,2 +1,7 @@
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
-<.live_component module={ExqUIWeb.JobDetailsComponent} id="jobs-details" item={@item} actions={@actions} />
+<.live_component
+ module={ExqUIWeb.JobDetailsComponent}
+ id="jobs-details"
+ item={@item}
+ actions={@actions}
+/>
diff --git a/lib/exq_ui_web/templates/layout/live.html.heex b/lib/exq_ui_web/templates/layout/live.html.heex
index 9eb31ed..1df0686 100644
--- a/lib/exq_ui_web/templates/layout/live.html.heex
+++ b/lib/exq_ui_web/templates/layout/live.html.heex
@@ -1,11 +1,23 @@
<.live_component module={ExqUIWeb.NavBarComponent} id="nav-bar" />
- <%= live_flash(@flash, :info) %>
+ phx-value-key="info"
+ >
+ <%= live_flash(@flash, :info) %>
+
- <%= live_flash(@flash, :error) %>
+ phx-value-key="error"
+ >
+ <%= live_flash(@flash, :error) %>
+
<%= @inner_content %>
diff --git a/lib/exq_ui_web/templates/layout/root.html.heex b/lib/exq_ui_web/templates/layout/root.html.heex
index dce89e5..21c6bb9 100644
--- a/lib/exq_ui_web/templates/layout/root.html.heex
+++ b/lib/exq_ui_web/templates/layout/root.html.heex
@@ -1,13 +1,17 @@
-
-
-
+
+
+
<%= csrf_meta_tag() %>
- <%= live_title_tag assigns[:page_title] || "ExqUI" %>
-
-
+ <%= live_title_tag(assigns[:page_title] || "ExqUI") %>
+
+
<%= @inner_content %>