pgbus 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/pgbus/api/insights_controller.rb +5 -4
- data/app/controllers/pgbus/application_controller.rb +40 -0
- data/app/controllers/pgbus/insights_controller.rb +3 -2
- data/app/controllers/pgbus/locale_controller.rb +15 -0
- data/app/helpers/pgbus/application_helper.rb +67 -7
- data/app/views/layouts/pgbus/application.html.erb +50 -14
- data/app/views/pgbus/dashboard/_processes_table.html.erb +6 -6
- data/app/views/pgbus/dashboard/_queues_table.html.erb +8 -8
- data/app/views/pgbus/dashboard/_recent_failures.html.erb +6 -6
- data/app/views/pgbus/dashboard/_stats_cards.html.erb +9 -9
- data/app/views/pgbus/dashboard/show.html.erb +1 -1
- data/app/views/pgbus/dead_letter/_messages_table.html.erb +19 -19
- data/app/views/pgbus/dead_letter/index.html.erb +5 -5
- data/app/views/pgbus/dead_letter/show.html.erb +12 -12
- data/app/views/pgbus/events/index.html.erb +11 -11
- data/app/views/pgbus/events/show.html.erb +6 -6
- data/app/views/pgbus/insights/show.html.erb +41 -21
- data/app/views/pgbus/jobs/_enqueued_table.html.erb +19 -19
- data/app/views/pgbus/jobs/_failed_table.html.erb +11 -11
- data/app/views/pgbus/jobs/index.html.erb +5 -5
- data/app/views/pgbus/jobs/show.html.erb +13 -13
- data/app/views/pgbus/locks/index.html.erb +11 -11
- data/app/views/pgbus/outbox/index.html.erb +15 -15
- data/app/views/pgbus/processes/_processes_table.html.erb +7 -7
- data/app/views/pgbus/processes/index.html.erb +1 -1
- data/app/views/pgbus/queues/_queues_list.html.erb +14 -14
- data/app/views/pgbus/queues/index.html.erb +1 -1
- data/app/views/pgbus/queues/show.html.erb +11 -11
- data/app/views/pgbus/recurring_tasks/_tasks_table.html.erb +14 -14
- data/app/views/pgbus/recurring_tasks/index.html.erb +2 -2
- data/app/views/pgbus/recurring_tasks/show.html.erb +21 -21
- data/config/i18n-tasks.yml +41 -0
- data/config/locales/da.yml +348 -0
- data/config/locales/de.yml +348 -0
- data/config/locales/en.yml +348 -0
- data/config/locales/es.yml +348 -0
- data/config/locales/fi.yml +348 -0
- data/config/locales/fr.yml +348 -0
- data/config/locales/it.yml +348 -0
- data/config/locales/ja.yml +348 -0
- data/config/locales/nb.yml +348 -0
- data/config/locales/nl.yml +348 -0
- data/config/locales/pt.yml +348 -0
- data/config/locales/sv.yml +348 -0
- data/config/routes.rb +2 -0
- data/lib/pgbus/active_job/executor.rb +1 -1
- data/lib/pgbus/client.rb +60 -32
- data/lib/pgbus/configuration.rb +8 -2
- data/lib/pgbus/engine.rb +4 -0
- data/lib/pgbus/event_bus/publisher.rb +1 -7
- data/lib/pgbus/outbox/poller.rb +58 -20
- data/lib/pgbus/process/consumer.rb +16 -3
- data/lib/pgbus/process/worker.rb +15 -5
- data/lib/pgbus/version.rb +1 -1
- data/lib/pgbus/web/data_source.rb +11 -9
- metadata +15 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
<div class="mb-6">
|
|
2
|
-
<%= link_to "
|
|
2
|
+
<%= link_to "\u2190 #{t("pgbus.dead_letter.show.back")}", pgbus.dead_letter_index_path, class: "text-sm text-indigo-600 hover:text-indigo-500" %>
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<% if @message %>
|
|
6
|
-
<h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-6"
|
|
6
|
+
<h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-6"><%= t("pgbus.dead_letter.show.title", id: @message[:msg_id]) %></h1>
|
|
7
7
|
|
|
8
8
|
<div class="rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700 p-6 mb-6">
|
|
9
9
|
<dl class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
10
10
|
<div>
|
|
11
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
11
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.dead_letter.show.labels.source_queue") %></dt>
|
|
12
12
|
<dd class="text-sm text-gray-900 dark:text-white"><%= @message[:queue_name] %></dd>
|
|
13
13
|
</div>
|
|
14
14
|
<div>
|
|
15
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
15
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.dead_letter.show.labels.enqueued_at") %></dt>
|
|
16
16
|
<dd class="text-sm text-gray-900 dark:text-white"><%= @message[:enqueued_at] %></dd>
|
|
17
17
|
</div>
|
|
18
18
|
<div>
|
|
19
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
19
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.dead_letter.show.labels.read_count") %></dt>
|
|
20
20
|
<dd class="text-sm text-gray-900 dark:text-white"><%= @message[:read_ct] %></dd>
|
|
21
21
|
</div>
|
|
22
22
|
<div>
|
|
23
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
23
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.dead_letter.show.labels.visibility_timeout") %></dt>
|
|
24
24
|
<dd class="text-sm text-gray-900 dark:text-white"><%= @message[:vt] %></dd>
|
|
25
25
|
</div>
|
|
26
26
|
</dl>
|
|
27
27
|
</div>
|
|
28
28
|
|
|
29
29
|
<div class="rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700 p-6 mb-6">
|
|
30
|
-
<h2 class="text-sm font-medium text-gray-500 mb-2"
|
|
30
|
+
<h2 class="text-sm font-medium text-gray-500 mb-2"><%= t("pgbus.dead_letter.show.payload") %></h2>
|
|
31
31
|
<pre class="text-xs text-gray-600 bg-gray-50 dark:bg-gray-900 rounded p-4 overflow-x-auto"><%= JSON.pretty_generate(JSON.parse(@message[:message])) rescue @message[:message] %></pre>
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<% if @message[:headers] %>
|
|
35
35
|
<div class="rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700 p-6 mb-6">
|
|
36
|
-
<h2 class="text-sm font-medium text-gray-500 mb-2"
|
|
36
|
+
<h2 class="text-sm font-medium text-gray-500 mb-2"><%= t("pgbus.dead_letter.show.headers") %></h2>
|
|
37
37
|
<pre class="text-xs text-gray-600 bg-gray-50 dark:bg-gray-900 rounded p-4 overflow-x-auto"><%= JSON.pretty_generate(JSON.parse(@message[:headers])) rescue @message[:headers] %></pre>
|
|
38
38
|
</div>
|
|
39
39
|
<% end %>
|
|
40
40
|
|
|
41
41
|
<div class="flex space-x-2">
|
|
42
|
-
<%= button_to "
|
|
42
|
+
<%= button_to t("pgbus.dead_letter.show.retry"), pgbus.retry_dead_letter_path(@message[:msg_id], queue_name: @message[:queue_name]), method: :post,
|
|
43
43
|
class: "rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500" %>
|
|
44
|
-
<%= button_to "
|
|
44
|
+
<%= button_to t("pgbus.dead_letter.show.discard"), pgbus.discard_dead_letter_path(@message[:msg_id], queue_name: @message[:queue_name]), method: :post,
|
|
45
45
|
class: "rounded-md bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-500",
|
|
46
|
-
data: { turbo_confirm: "
|
|
46
|
+
data: { turbo_confirm: t("pgbus.dead_letter.show.discard_confirm") } %>
|
|
47
47
|
</div>
|
|
48
48
|
<% else %>
|
|
49
49
|
<div class="text-center py-12">
|
|
50
|
-
<p class="text-gray-400"
|
|
50
|
+
<p class="text-gray-400"><%= t("pgbus.dead_letter.show.not_found") %></p>
|
|
51
51
|
</div>
|
|
52
52
|
<% end %>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-6"
|
|
1
|
+
<h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-6"><%= t("pgbus.events.index.title") %></h1>
|
|
2
2
|
|
|
3
3
|
<!-- Registered Subscribers -->
|
|
4
4
|
<div class="mb-8">
|
|
5
|
-
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-3"
|
|
5
|
+
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-3"><%= t("pgbus.events.index.subscribers_title") %></h2>
|
|
6
6
|
<div class="overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
7
7
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
8
8
|
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
9
9
|
<tr>
|
|
10
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
11
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
12
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
10
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.events.index.subscribers_headers.pattern") %></th>
|
|
11
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.events.index.subscribers_headers.handler") %></th>
|
|
12
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.events.index.subscribers_headers.queue") %></th>
|
|
13
13
|
</tr>
|
|
14
14
|
</thead>
|
|
15
15
|
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</tr>
|
|
22
22
|
<% end %>
|
|
23
23
|
<% if @subscribers.empty? %>
|
|
24
|
-
<tr><td colspan="3" class="px-4 py-8 text-center text-sm text-gray-400"
|
|
24
|
+
<tr><td colspan="3" class="px-4 py-8 text-center text-sm text-gray-400"><%= t("pgbus.events.index.subscribers_empty") %></td></tr>
|
|
25
25
|
<% end %>
|
|
26
26
|
</tbody>
|
|
27
27
|
</table>
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
|
|
31
31
|
<!-- Processed Events (Audit Trail) -->
|
|
32
32
|
<div>
|
|
33
|
-
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-3"
|
|
33
|
+
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-3"><%= t("pgbus.events.index.processed_title") %></h2>
|
|
34
34
|
<div class="overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
35
35
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
36
36
|
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
37
37
|
<tr>
|
|
38
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
39
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
40
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
38
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.events.index.processed_headers.event_id") %></th>
|
|
39
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.events.index.processed_headers.handler") %></th>
|
|
40
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.events.index.processed_headers.processed_at") %></th>
|
|
41
41
|
</tr>
|
|
42
42
|
</thead>
|
|
43
43
|
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
</tr>
|
|
50
50
|
<% end %>
|
|
51
51
|
<% if @events.empty? %>
|
|
52
|
-
<tr><td colspan="3" class="px-4 py-8 text-center text-sm text-gray-400"
|
|
52
|
+
<tr><td colspan="3" class="px-4 py-8 text-center text-sm text-gray-400"><%= t("pgbus.events.index.processed_empty") %></td></tr>
|
|
53
53
|
<% end %>
|
|
54
54
|
</tbody>
|
|
55
55
|
</table>
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
<div class="mb-6">
|
|
2
|
-
<%= link_to "
|
|
2
|
+
<%= link_to "\u2190 #{t("pgbus.events.show.back")}", pgbus.events_path, class: "text-sm text-indigo-600 hover:text-indigo-500" %>
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<% if @event %>
|
|
6
|
-
<h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-6"
|
|
6
|
+
<h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-6"><%= t("pgbus.events.show.title", event_id: @event["event_id"]) %></h1>
|
|
7
7
|
|
|
8
8
|
<div class="rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700 p-6">
|
|
9
9
|
<dl class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
10
10
|
<div>
|
|
11
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
11
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.events.show.labels.event_id") %></dt>
|
|
12
12
|
<dd class="text-sm font-mono text-gray-900 dark:text-white"><%= @event["event_id"] %></dd>
|
|
13
13
|
</div>
|
|
14
14
|
<div>
|
|
15
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
15
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.events.show.labels.handler") %></dt>
|
|
16
16
|
<dd class="text-sm text-gray-900 dark:text-white"><%= @event["handler_class"] %></dd>
|
|
17
17
|
</div>
|
|
18
18
|
<div>
|
|
19
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
19
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.events.show.labels.processed_at") %></dt>
|
|
20
20
|
<dd class="text-sm text-gray-900 dark:text-white"><%= @event["processed_at"] %></dd>
|
|
21
21
|
</div>
|
|
22
22
|
</dl>
|
|
23
23
|
</div>
|
|
24
24
|
<% else %>
|
|
25
25
|
<div class="text-center py-12">
|
|
26
|
-
<p class="text-gray-400"
|
|
26
|
+
<p class="text-gray-400"><%= t("pgbus.events.show.not_found") %></p>
|
|
27
27
|
</div>
|
|
28
28
|
<% end %>
|
|
@@ -1,32 +1,52 @@
|
|
|
1
|
-
<div class="mb-6">
|
|
2
|
-
<
|
|
3
|
-
|
|
1
|
+
<div class="mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3">
|
|
2
|
+
<div>
|
|
3
|
+
<h1 class="text-2xl font-bold text-gray-900 dark:text-white"><%= t("pgbus.insights.show.title") %></h1>
|
|
4
|
+
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.description_html", range: pgbus_time_range_label(@minutes)) %></p>
|
|
5
|
+
</div>
|
|
6
|
+
<nav class="inline-flex rounded-lg shadow-sm" role="group" aria-label="Time range">
|
|
7
|
+
<% ranges = [["1h", 60], ["24h", 1440], ["7d", 10_080], ["30d", 43_200]] %>
|
|
8
|
+
<% ranges.each_with_index do |(label, mins), i| %>
|
|
9
|
+
<%
|
|
10
|
+
active = @minutes == mins
|
|
11
|
+
base = "px-3 py-1.5 text-xs font-medium border border-gray-300 dark:border-gray-600 focus:z-10 focus:outline-none"
|
|
12
|
+
colors = active ?
|
|
13
|
+
"bg-indigo-600 text-white border-indigo-600 dark:border-indigo-500" :
|
|
14
|
+
"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"
|
|
15
|
+
rounded = case i
|
|
16
|
+
when 0 then "rounded-l-lg"
|
|
17
|
+
when ranges.length - 1 then "rounded-r-lg"
|
|
18
|
+
else "-ml-px"
|
|
19
|
+
end
|
|
20
|
+
%>
|
|
21
|
+
<%= link_to label, pgbus.insights_path(minutes: mins), class: "#{base} #{colors} #{rounded}" %>
|
|
22
|
+
<% end %>
|
|
23
|
+
</nav>
|
|
4
24
|
</div>
|
|
5
25
|
|
|
6
26
|
<!-- Summary cards -->
|
|
7
27
|
<div class="grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-6 mb-8">
|
|
8
28
|
<div class="rounded-lg bg-white dark:bg-gray-800 p-4 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
9
|
-
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
29
|
+
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.summary.total_jobs") %></dt>
|
|
10
30
|
<dd class="mt-1 text-2xl font-semibold text-gray-900 dark:text-white"><%= pgbus_number(@summary[:total]) %></dd>
|
|
11
31
|
</div>
|
|
12
32
|
<div class="rounded-lg bg-white dark:bg-gray-800 p-4 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
13
|
-
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
33
|
+
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.summary.succeeded") %></dt>
|
|
14
34
|
<dd class="mt-1 text-2xl font-semibold text-green-600 dark:text-green-400"><%= pgbus_number(@summary[:success]) %></dd>
|
|
15
35
|
</div>
|
|
16
36
|
<div class="rounded-lg bg-white dark:bg-gray-800 p-4 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
17
|
-
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
37
|
+
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.summary.failed") %></dt>
|
|
18
38
|
<dd class="mt-1 text-2xl font-semibold text-red-600 dark:text-red-400"><%= pgbus_number(@summary[:failed]) %></dd>
|
|
19
39
|
</div>
|
|
20
40
|
<div class="rounded-lg bg-white dark:bg-gray-800 p-4 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
21
|
-
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
41
|
+
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.summary.dead_lettered") %></dt>
|
|
22
42
|
<dd class="mt-1 text-2xl font-semibold text-orange-600 dark:text-orange-400"><%= pgbus_number(@summary[:dead_lettered]) %></dd>
|
|
23
43
|
</div>
|
|
24
44
|
<div class="rounded-lg bg-white dark:bg-gray-800 p-4 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
25
|
-
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
45
|
+
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.summary.avg_duration") %></dt>
|
|
26
46
|
<dd class="mt-1 text-2xl font-semibold text-gray-900 dark:text-white"><%= pgbus_ms_duration(@summary[:avg_duration_ms]) %></dd>
|
|
27
47
|
</div>
|
|
28
48
|
<div class="rounded-lg bg-white dark:bg-gray-800 p-4 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
29
|
-
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
49
|
+
<dt class="text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.summary.max_duration") %></dt>
|
|
30
50
|
<dd class="mt-1 text-2xl font-semibold text-gray-900 dark:text-white"><%= pgbus_ms_duration(@summary[:max_duration_ms]) %></dd>
|
|
31
51
|
</div>
|
|
32
52
|
</div>
|
|
@@ -34,11 +54,11 @@
|
|
|
34
54
|
<!-- Charts -->
|
|
35
55
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
|
|
36
56
|
<div class="rounded-lg bg-white dark:bg-gray-800 p-5 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
37
|
-
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-4"
|
|
57
|
+
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-4"><%= t("pgbus.insights.show.charts.throughput") %></h3>
|
|
38
58
|
<div id="throughput-chart" style="height: 280px;"></div>
|
|
39
59
|
</div>
|
|
40
60
|
<div class="rounded-lg bg-white dark:bg-gray-800 p-5 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
41
|
-
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-4"
|
|
61
|
+
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-4"><%= t("pgbus.insights.show.charts.status_distribution") %></h3>
|
|
42
62
|
<div id="status-chart" style="height: 280px;"></div>
|
|
43
63
|
</div>
|
|
44
64
|
</div>
|
|
@@ -46,15 +66,15 @@
|
|
|
46
66
|
<!-- Slowest job classes -->
|
|
47
67
|
<div class="rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
48
68
|
<div class="px-5 py-4 border-b border-gray-200 dark:border-gray-700">
|
|
49
|
-
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300"
|
|
69
|
+
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300"><%= t("pgbus.insights.show.slowest.title") %></h3>
|
|
50
70
|
</div>
|
|
51
71
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
52
72
|
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
53
73
|
<tr>
|
|
54
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
55
|
-
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
56
|
-
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
57
|
-
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
74
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.slowest.headers.job_class") %></th>
|
|
75
|
+
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.slowest.headers.count") %></th>
|
|
76
|
+
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.slowest.headers.avg") %></th>
|
|
77
|
+
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.insights.show.slowest.headers.max") %></th>
|
|
58
78
|
</tr>
|
|
59
79
|
</thead>
|
|
60
80
|
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
|
@@ -67,7 +87,7 @@
|
|
|
67
87
|
</tr>
|
|
68
88
|
<% end %>
|
|
69
89
|
<% if @slowest.empty? %>
|
|
70
|
-
<tr><td colspan="4" class="px-4 py-8 text-center text-sm text-gray-400 dark:text-gray-500"
|
|
90
|
+
<tr><td colspan="4" class="px-4 py-8 text-center text-sm text-gray-400 dark:text-gray-500"><%= t("pgbus.insights.show.slowest.empty") %></td></tr>
|
|
71
91
|
<% end %>
|
|
72
92
|
</tbody>
|
|
73
93
|
</table>
|
|
@@ -101,7 +121,7 @@
|
|
|
101
121
|
}));
|
|
102
122
|
|
|
103
123
|
throughputChart = new ApexCharts(document.querySelector('#throughput-chart'), {
|
|
104
|
-
series: [{ name: '
|
|
124
|
+
series: [{ name: '<%= j(t("pgbus.insights.show.charts.series_name")) %>', data: throughputData }],
|
|
105
125
|
chart: { type: 'area', height: 280, toolbar: { show: false }, background: 'transparent', foreColor: t.text },
|
|
106
126
|
stroke: { curve: 'smooth', width: 2 },
|
|
107
127
|
fill: { type: 'gradient', gradient: { shadeIntensity: 1, opacityFrom: 0.4, opacityTo: 0.05, stops: [0, 100] } },
|
|
@@ -137,17 +157,17 @@
|
|
|
137
157
|
statusChart.render();
|
|
138
158
|
} else {
|
|
139
159
|
document.querySelector('#status-chart').innerHTML =
|
|
140
|
-
'<p class="text-center text-sm text-gray-400 dark:text-gray-500 pt-24"
|
|
160
|
+
'<p class="text-center text-sm text-gray-400 dark:text-gray-500 pt-24"><%= j(t("pgbus.insights.show.charts.no_data")) %></p>';
|
|
141
161
|
}
|
|
142
162
|
}
|
|
143
163
|
|
|
144
164
|
// Fetch data and render
|
|
145
165
|
let chartData = null;
|
|
146
|
-
fetch('<%= pgbus.api_insights_path %>')
|
|
166
|
+
fetch('<%= pgbus.api_insights_path(minutes: @minutes) %>')
|
|
147
167
|
.then(r => r.json())
|
|
148
168
|
.then(data => { chartData = data; renderCharts(data); })
|
|
149
169
|
.catch(() => {
|
|
150
|
-
const msg = '<p class="text-center text-sm text-gray-400 dark:text-gray-500 pt-24"
|
|
170
|
+
const msg = '<p class="text-center text-sm text-gray-400 dark:text-gray-500 pt-24"><%= j(t("pgbus.insights.show.charts.failed_to_load")) %></p>';
|
|
151
171
|
document.querySelector('#throughput-chart').innerHTML = msg;
|
|
152
172
|
document.querySelector('#status-chart').innerHTML = msg;
|
|
153
173
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<turbo-frame id="jobs-enqueued" data-auto-refresh src="<%= pgbus.jobs_path(request.query_parameters.merge(frame: 'enqueued')) %>">
|
|
2
2
|
<div>
|
|
3
|
-
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-3"
|
|
3
|
+
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-3"><%= t("pgbus.jobs.enqueued_table.title") %></h2>
|
|
4
4
|
<div class="overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
5
5
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
6
6
|
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
7
7
|
<tr>
|
|
8
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
9
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
10
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
11
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
12
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
8
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.enqueued_table.headers.id") %></th>
|
|
9
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.enqueued_table.headers.job_class") %></th>
|
|
10
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.enqueued_table.headers.queue") %></th>
|
|
11
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.enqueued_table.headers.enqueued") %></th>
|
|
12
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.enqueued_table.headers.reads") %></th>
|
|
13
13
|
</tr>
|
|
14
14
|
</thead>
|
|
15
15
|
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
|
@@ -27,33 +27,33 @@
|
|
|
27
27
|
</summary>
|
|
28
28
|
<div class="px-4 pb-4 bg-gray-50 dark:bg-gray-900 border-t border-gray-100">
|
|
29
29
|
<div class="flex items-center mt-3 mb-3">
|
|
30
|
-
<span class="text-xs font-mono text-gray-400"
|
|
30
|
+
<span class="text-xs font-mono text-gray-400"><%= t("pgbus.jobs.enqueued_table.job_id") %> <%= payload["job_id"] %></span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class="grid grid-cols-2 gap-4 mb-3">
|
|
33
33
|
<div>
|
|
34
|
-
<span class="text-xs font-medium text-gray-500"
|
|
34
|
+
<span class="text-xs font-medium text-gray-500"><%= t("pgbus.jobs.enqueued_table.arguments") %></span>
|
|
35
35
|
<pre class="text-xs text-gray-700 bg-white dark:bg-gray-800 rounded p-2 mt-1 overflow-x-auto max-h-40"><%= JSON.pretty_generate(payload["arguments"] || []) rescue "—" %></pre>
|
|
36
36
|
</div>
|
|
37
37
|
<div>
|
|
38
|
-
<span class="text-xs font-medium text-gray-500"
|
|
38
|
+
<span class="text-xs font-medium text-gray-500"><%= t("pgbus.jobs.enqueued_table.metadata") %></span>
|
|
39
39
|
<div class="text-xs text-gray-600 bg-white dark:bg-gray-800 rounded p-2 mt-1 space-y-1">
|
|
40
|
-
<% if payload["queue_name"] %><p><strong
|
|
41
|
-
<% if payload["priority"] %><p><strong
|
|
42
|
-
<% if payload["locale"] %><p><strong
|
|
43
|
-
<% if payload["timezone"] %><p><strong
|
|
44
|
-
<% if payload["scheduled_at"] %><p><strong
|
|
45
|
-
<% if j[:vt] %><p><strong
|
|
46
|
-
<% if j[:last_read_at] %><p><strong
|
|
40
|
+
<% if payload["queue_name"] %><p><strong><%= t("pgbus.jobs.enqueued_table.metadata_labels.queue") %></strong> <%= payload["queue_name"] %></p><% end %>
|
|
41
|
+
<% if payload["priority"] %><p><strong><%= t("pgbus.jobs.enqueued_table.metadata_labels.priority") %></strong> <%= payload["priority"] %></p><% end %>
|
|
42
|
+
<% if payload["locale"] %><p><strong><%= t("pgbus.jobs.enqueued_table.metadata_labels.locale") %></strong> <%= payload["locale"] %></p><% end %>
|
|
43
|
+
<% if payload["timezone"] %><p><strong><%= t("pgbus.jobs.enqueued_table.metadata_labels.timezone") %></strong> <%= payload["timezone"] %></p><% end %>
|
|
44
|
+
<% if payload["scheduled_at"] %><p><strong><%= t("pgbus.jobs.enqueued_table.metadata_labels.scheduled") %></strong> <%= payload["scheduled_at"] %></p><% end %>
|
|
45
|
+
<% if j[:vt] %><p><strong><%= t("pgbus.jobs.enqueued_table.metadata_labels.visible_at") %></strong> <%= j[:vt] %></p><% end %>
|
|
46
|
+
<% if j[:last_read_at] %><p><strong><%= t("pgbus.jobs.enqueued_table.metadata_labels.last_read") %></strong> <%= j[:last_read_at] %></p><% end %>
|
|
47
47
|
</div>
|
|
48
48
|
</div>
|
|
49
49
|
</div>
|
|
50
50
|
<details class="mt-2">
|
|
51
|
-
<summary class="text-xs font-medium text-gray-500 cursor-pointer hover:text-gray-700"
|
|
51
|
+
<summary class="text-xs font-medium text-gray-500 cursor-pointer hover:text-gray-700"><%= t("pgbus.jobs.enqueued_table.full_json_payload") %></summary>
|
|
52
52
|
<pre class="text-xs text-gray-600 bg-white dark:bg-gray-800 rounded p-2 mt-1 overflow-x-auto max-h-96"><%= JSON.pretty_generate(payload) rescue j[:message] %></pre>
|
|
53
53
|
</details>
|
|
54
54
|
<% if j[:headers] %>
|
|
55
55
|
<details class="mt-2">
|
|
56
|
-
<summary class="text-xs font-medium text-gray-500 cursor-pointer hover:text-gray-700"
|
|
56
|
+
<summary class="text-xs font-medium text-gray-500 cursor-pointer hover:text-gray-700"><%= t("pgbus.jobs.enqueued_table.headers_section") %></summary>
|
|
57
57
|
<pre class="text-xs text-gray-600 bg-white dark:bg-gray-800 rounded p-2 mt-1 overflow-x-auto"><%= JSON.pretty_generate(JSON.parse(j[:headers])) rescue j[:headers] %></pre>
|
|
58
58
|
</details>
|
|
59
59
|
<% end %>
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
</tr>
|
|
64
64
|
<% end %>
|
|
65
65
|
<% if @jobs.empty? %>
|
|
66
|
-
<tr><td colspan="5" class="px-4 py-8 text-center text-sm text-gray-400"
|
|
66
|
+
<tr><td colspan="5" class="px-4 py-8 text-center text-sm text-gray-400"><%= t("pgbus.jobs.enqueued_table.empty") %></td></tr>
|
|
67
67
|
<% end %>
|
|
68
68
|
</tbody>
|
|
69
69
|
</table>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<turbo-frame id="jobs-failed" data-auto-refresh src="<%= pgbus.jobs_path(frame: 'failed') %>">
|
|
2
2
|
<div class="mb-8">
|
|
3
|
-
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-3"
|
|
3
|
+
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-3"><%= t("pgbus.jobs.failed_table.title") %></h2>
|
|
4
4
|
<div class="overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
5
5
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
6
6
|
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
7
7
|
<tr>
|
|
8
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
9
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
10
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
11
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
12
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"
|
|
13
|
-
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500"
|
|
8
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.failed_table.headers.id") %></th>
|
|
9
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.failed_table.headers.queue") %></th>
|
|
10
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.failed_table.headers.error") %></th>
|
|
11
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.failed_table.headers.retries") %></th>
|
|
12
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.failed_table.headers.failed") %></th>
|
|
13
|
+
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500"><%= t("pgbus.jobs.failed_table.headers.actions") %></th>
|
|
14
14
|
</tr>
|
|
15
15
|
</thead>
|
|
16
16
|
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
<td class="px-4 py-3 text-sm text-gray-500"><%= f["retry_count"] %></td>
|
|
27
27
|
<td class="px-4 py-3 text-sm text-gray-500"><%= pgbus_time_ago(f["failed_at"]) %></td>
|
|
28
28
|
<td class="px-4 py-3 text-sm text-right space-x-2">
|
|
29
|
-
<%= button_to "
|
|
29
|
+
<%= button_to t("pgbus.jobs.failed_table.retry"), pgbus.retry_job_path(f["id"]), method: :post,
|
|
30
30
|
class: "text-xs text-indigo-600 hover:text-indigo-800 font-medium",
|
|
31
31
|
data: { turbo_frame: "_top" } %>
|
|
32
|
-
<%= button_to "
|
|
32
|
+
<%= button_to t("pgbus.jobs.failed_table.discard"), pgbus.discard_job_path(f["id"]), method: :post,
|
|
33
33
|
class: "text-xs text-red-600 hover:text-red-800 font-medium",
|
|
34
|
-
data: { turbo_confirm: "
|
|
34
|
+
data: { turbo_confirm: t("pgbus.jobs.failed_table.discard_confirm"), turbo_frame: "_top" } %>
|
|
35
35
|
</td>
|
|
36
36
|
</tr>
|
|
37
37
|
<% end %>
|
|
38
38
|
<% if @failed.empty? %>
|
|
39
|
-
<tr><td colspan="6" class="px-4 py-8 text-center text-sm text-gray-400"
|
|
39
|
+
<tr><td colspan="6" class="px-4 py-8 text-center text-sm text-gray-400"><%= t("pgbus.jobs.failed_table.empty") %></td></tr>
|
|
40
40
|
<% end %>
|
|
41
41
|
</tbody>
|
|
42
42
|
</table>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<div class="flex items-center justify-between mb-6">
|
|
2
|
-
<h1 class="text-2xl font-bold text-gray-900 dark:text-white"
|
|
2
|
+
<h1 class="text-2xl font-bold text-gray-900 dark:text-white"><%= t("pgbus.jobs.index.title") %></h1>
|
|
3
3
|
<% if @failed.any? %>
|
|
4
4
|
<div class="flex space-x-2">
|
|
5
|
-
<%= button_to "
|
|
5
|
+
<%= button_to t("pgbus.jobs.index.retry_all"), pgbus.retry_all_jobs_path, method: :post,
|
|
6
6
|
class: "rounded-md bg-indigo-600 px-3 py-2 text-sm font-medium text-white hover:bg-indigo-500",
|
|
7
|
-
data: { turbo_confirm: "
|
|
8
|
-
<%= button_to "
|
|
7
|
+
data: { turbo_confirm: t("pgbus.jobs.index.retry_all_confirm") } %>
|
|
8
|
+
<%= button_to t("pgbus.jobs.index.discard_all"), pgbus.discard_all_jobs_path, method: :post,
|
|
9
9
|
class: "rounded-md bg-red-600 px-3 py-2 text-sm font-medium text-white hover:bg-red-500",
|
|
10
|
-
data: { turbo_confirm: "
|
|
10
|
+
data: { turbo_confirm: t("pgbus.jobs.index.discard_all_confirm") } %>
|
|
11
11
|
</div>
|
|
12
12
|
<% end %>
|
|
13
13
|
</div>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
<div class="mb-6">
|
|
2
|
-
<%= link_to "
|
|
2
|
+
<%= link_to "\u2190 #{t("pgbus.jobs.show.back")}", pgbus.jobs_path, class: "text-sm text-indigo-600 hover:text-indigo-500" %>
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<% if @job %>
|
|
6
|
-
<h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-6"
|
|
6
|
+
<h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-6"><%= t("pgbus.jobs.show.title", id: @job["id"]) %></h1>
|
|
7
7
|
|
|
8
8
|
<div class="rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700 p-6 mb-6">
|
|
9
9
|
<dl class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
10
10
|
<div>
|
|
11
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
11
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.jobs.show.labels.queue") %></dt>
|
|
12
12
|
<dd class="text-sm text-gray-900 dark:text-white"><%= @job["queue_name"] %></dd>
|
|
13
13
|
</div>
|
|
14
14
|
<div>
|
|
15
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
15
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.jobs.show.labels.failed_at") %></dt>
|
|
16
16
|
<dd class="text-sm text-gray-900 dark:text-white"><%= @job["failed_at"] %></dd>
|
|
17
17
|
</div>
|
|
18
18
|
<div>
|
|
19
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
19
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.jobs.show.labels.error_class") %></dt>
|
|
20
20
|
<dd class="text-sm text-red-600 font-medium"><%= @job["error_class"] %></dd>
|
|
21
21
|
</div>
|
|
22
22
|
<div>
|
|
23
|
-
<dt class="text-sm font-medium text-gray-500"
|
|
23
|
+
<dt class="text-sm font-medium text-gray-500"><%= t("pgbus.jobs.show.labels.retry_count") %></dt>
|
|
24
24
|
<dd class="text-sm text-gray-900 dark:text-white"><%= @job["retry_count"] %></dd>
|
|
25
25
|
</div>
|
|
26
26
|
</dl>
|
|
27
27
|
</div>
|
|
28
28
|
|
|
29
29
|
<div class="rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700 p-6 mb-6">
|
|
30
|
-
<h2 class="text-sm font-medium text-gray-500 mb-2"
|
|
30
|
+
<h2 class="text-sm font-medium text-gray-500 mb-2"><%= t("pgbus.jobs.show.error_message") %></h2>
|
|
31
31
|
<p class="text-sm text-red-700"><%= @job["error_message"] %></p>
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<% if @job["backtrace"].present? %>
|
|
35
35
|
<div class="rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700 p-6 mb-6">
|
|
36
|
-
<h2 class="text-sm font-medium text-gray-500 mb-2"
|
|
36
|
+
<h2 class="text-sm font-medium text-gray-500 mb-2"><%= t("pgbus.jobs.show.backtrace") %></h2>
|
|
37
37
|
<pre class="text-xs text-gray-600 bg-gray-50 dark:bg-gray-900 rounded p-4 overflow-x-auto max-h-96"><%= @job["backtrace"] %></pre>
|
|
38
38
|
</div>
|
|
39
39
|
<% end %>
|
|
40
40
|
|
|
41
41
|
<div class="rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700 p-6 mb-6">
|
|
42
|
-
<h2 class="text-sm font-medium text-gray-500 mb-2"
|
|
42
|
+
<h2 class="text-sm font-medium text-gray-500 mb-2"><%= t("pgbus.jobs.show.payload") %></h2>
|
|
43
43
|
<pre class="text-xs text-gray-600 bg-gray-50 dark:bg-gray-900 rounded p-4 overflow-x-auto"><%= JSON.pretty_generate(JSON.parse(@job["payload"])) rescue @job["payload"] %></pre>
|
|
44
44
|
</div>
|
|
45
45
|
|
|
46
46
|
<div class="flex space-x-2">
|
|
47
|
-
<%= button_to "
|
|
47
|
+
<%= button_to t("pgbus.jobs.show.retry"), pgbus.retry_job_path(@job["id"]), method: :post,
|
|
48
48
|
class: "rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-500" %>
|
|
49
|
-
<%= button_to "
|
|
49
|
+
<%= button_to t("pgbus.jobs.show.discard"), pgbus.discard_job_path(@job["id"]), method: :post,
|
|
50
50
|
class: "rounded-md bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-500",
|
|
51
|
-
data: { turbo_confirm: "
|
|
51
|
+
data: { turbo_confirm: t("pgbus.jobs.show.discard_confirm") } %>
|
|
52
52
|
</div>
|
|
53
53
|
<% else %>
|
|
54
54
|
<div class="text-center py-12">
|
|
55
|
-
<p class="text-gray-400"
|
|
55
|
+
<p class="text-gray-400"><%= t("pgbus.jobs.show.not_found") %></p>
|
|
56
56
|
</div>
|
|
57
57
|
<% end %>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<div class="mb-6">
|
|
2
|
-
<h1 class="text-2xl font-bold text-gray-900 dark:text-white"
|
|
3
|
-
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400"
|
|
2
|
+
<h1 class="text-2xl font-bold text-gray-900 dark:text-white"><%= t("pgbus.locks.index.title") %></h1>
|
|
3
|
+
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400"><%= t("pgbus.locks.index.description") %></p>
|
|
4
4
|
</div>
|
|
5
5
|
|
|
6
6
|
<div class="overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow ring-1 ring-gray-200 dark:ring-gray-700">
|
|
7
7
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
8
8
|
<thead class="bg-gray-50 dark:bg-gray-900">
|
|
9
9
|
<tr>
|
|
10
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
11
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
12
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
13
|
-
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
14
|
-
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
15
|
-
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"
|
|
10
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.locks.index.headers.lock_key") %></th>
|
|
11
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.locks.index.headers.job_class") %></th>
|
|
12
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.locks.index.headers.state") %></th>
|
|
13
|
+
<th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.locks.index.headers.owner") %></th>
|
|
14
|
+
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.locks.index.headers.age") %></th>
|
|
15
|
+
<th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500 dark:text-gray-400"><%= t("pgbus.locks.index.headers.expires") %></th>
|
|
16
16
|
</tr>
|
|
17
17
|
</thead>
|
|
18
18
|
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
<td class="px-4 py-3 text-sm text-gray-700 dark:text-gray-300"><%= lock[:job_class] %></td>
|
|
23
23
|
<td class="px-4 py-3 text-sm">
|
|
24
24
|
<% if lock[:state] == "executing" %>
|
|
25
|
-
<span class="inline-flex items-center rounded-full bg-blue-100 dark:bg-blue-900/50 px-2.5 py-0.5 text-xs font-medium text-blue-800 dark:text-blue-300"
|
|
25
|
+
<span class="inline-flex items-center rounded-full bg-blue-100 dark:bg-blue-900/50 px-2.5 py-0.5 text-xs font-medium text-blue-800 dark:text-blue-300"><%= t("pgbus.locks.index.executing") %></span>
|
|
26
26
|
<% else %>
|
|
27
|
-
<span class="inline-flex items-center rounded-full bg-yellow-100 dark:bg-yellow-900/50 px-2.5 py-0.5 text-xs font-medium text-yellow-800 dark:text-yellow-300"
|
|
27
|
+
<span class="inline-flex items-center rounded-full bg-yellow-100 dark:bg-yellow-900/50 px-2.5 py-0.5 text-xs font-medium text-yellow-800 dark:text-yellow-300"><%= t("pgbus.locks.index.queued") %></span>
|
|
28
28
|
<% end %>
|
|
29
29
|
</td>
|
|
30
30
|
<td class="px-4 py-3 text-sm text-gray-500 dark:text-gray-400">
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</tr>
|
|
47
47
|
<% end %>
|
|
48
48
|
<% if @locks.empty? %>
|
|
49
|
-
<tr><td colspan="6" class="px-4 py-8 text-center text-sm text-gray-400 dark:text-gray-500"
|
|
49
|
+
<tr><td colspan="6" class="px-4 py-8 text-center text-sm text-gray-400 dark:text-gray-500"><%= t("pgbus.locks.index.empty") %></td></tr>
|
|
50
50
|
<% end %>
|
|
51
51
|
</tbody>
|
|
52
52
|
</table>
|