rails-pg-extras 5.6.2 → 5.6.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21c0ff8a8e1818bb1d7fc215bfcafd23089f4a49ef74315f3af4c2d6b12bf92f
4
- data.tar.gz: b8ebb0ad86f7c82282725fcb891173070ed64d4cffd7d96898dade903942e5ef
3
+ metadata.gz: c64f0e93ed959cd497aa7bfd471eb4dcf5e8327e31d46891d68f436ef63a9be6
4
+ data.tar.gz: 88778283a0b42e9a697dae56229e048ad35f657b7db58caed44f5b244cca4205
5
5
  SHA512:
6
- metadata.gz: 24fe4c44c558895843b59d6317f4e63ffefcd6a5fb52596c7d18a37b1996a4db7f4a444c0a1ccf4d0680d50a873d06ace2929e45b1b31193b2947fedd684f667
7
- data.tar.gz: 0c8504f1e2dd0487a3a3a3a652389ed7161c261d5ce52e0570a2308e63bc028e00a8185b922a4300542fdb02c2346f4fc915a218636a704348c3bc66c5b64fc4
6
+ metadata.gz: facfda5f88e9dd06f9ec11229bb40e399879d2c92f02b6eaa45d60bb853ddd9d768bc551881de9115386d3b5eb28ea5cbb3d6ca59e42cfda8f3cddb8e18de3d4
7
+ data.tar.gz: 859539a5d63c299acf366c799faacaf433f300c7737935fab678f48a4d2981c383954b5972f3ba921373fd2c0a8890ec027e2769012343d7f81fbfca1b1b0623
@@ -6,7 +6,7 @@
6
6
  <link href="/pg-extras-tailwind.min.css" rel="stylesheet">
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
- <body class="p-5 text-xs">
9
+ <body class="p-5 text-sm">
10
10
  <% if flash[:notice] %>
11
11
  <div class="bg-green-100 border-l-4 border-green-500 text-green-700 p-4 mb-4" role="alert">
12
12
  <p class="font-bold">Notice</p>
@@ -1,9 +1,26 @@
1
- <h1 class="font-bold text-xl my-5">Diagnose</h1>
2
- <table class="w-full font-mono border-collapse border my-5">
3
- <% RailsPgExtras.diagnose(in_format: :hash).each do |diagnosis| %>
4
- <tr class="<%= diagnosis[:ok] ? "bg-green-300" : "bg-red-300" %>">
5
- <td class='p-1 border font-bold'><%= diagnosis[:check_name] %></td>
6
- <td class='p-1 border'><%= diagnosis[:message] %></td>
1
+ <h1 class="font-bold text-2xl my-6 text-gray-900">Diagnose
2
+ <span class='pg-extras-help'>
3
+ (<a href="https://pawelurbanek.com/postgresql-fix-performance"
4
+ class="text-blue-600 hover:text-blue-800 hover:underline" target='_blank'>Tutorial</a>)
5
+ </span>
6
+ </h1>
7
+ <div class="overflow-x-auto">
8
+ <table class="w-full border border-gray-400 shadow-md rounded-lg overflow-hidden">
9
+ <thead>
10
+ <tr class="bg-gray-200 text-gray-900 text-left uppercase text-sm font-bold">
11
+ <th class="px-4 py-3 border">Ok</th>
12
+ <th class="px-4 py-3 border">Check Name</th>
13
+ <th class="px-4 py-3 border">Message</th>
7
14
  </tr>
8
- <% end %>
15
+ </thead>
16
+ <tbody>
17
+ <% RailsPgExtras.diagnose(in_format: :hash).each do |diagnosis| %>
18
+ <tr class="<%= diagnosis[:ok] ? "bg-green-100 text-green-900" : "bg-red-100 text-red-900" %> hover:bg-gray-300 transition">
19
+ <td class="px-4 py-3 border font-bold"><%= diagnosis[:ok] ? "YES" : "NO" %></td>
20
+ <td class="px-4 py-3 border font-semibold"><%= diagnosis[:check_name] %></td>
21
+ <td class="px-4 py-3 border"><%= diagnosis[:message] %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
9
25
  </table>
26
+ </div>
@@ -1,21 +1,24 @@
1
- <h1 class="font-bold text-xl my-5"><%= title %></h1>
1
+ <h1 class="font-bold text-2xl my-6 text-gray-800"><%= title %></h1>
2
2
 
3
- <table class="w-full font-mono border-collapse border my-5">
4
- <thead>
5
- <tr class="bg-gray-300">
6
- <% headers.each do |header| %>
7
- <th class="p-2 border text-left"><%= header %></th>
3
+ <div class="overflow-x-auto bg-white shadow-md rounded-lg">
4
+ <table class="w-full border border-gray-300 rounded-lg overflow-hidden">
5
+ <thead>
6
+ <tr class="bg-gray-100 text-gray-700 text-left uppercase text-sm font-semibold">
7
+ <% headers.each do |header| %>
8
+ <th class="px-4 py-3 border"><%= header %></th>
9
+ <% end %>
10
+ </tr>
11
+ </thead>
12
+ <tbody>
13
+ <% rows.each.with_index do |row, i| %>
14
+ <tr class="transition hover:bg-blue-100 hover:text-white <%= i.even? ? "bg-gray-50" : "bg-gray-100" %>">
15
+ <% row.each do |column| %>
16
+ <td class="px-4 py-3 border text-gray-800"><%= column %></td>
17
+ <% end %>
18
+ </tr>
8
19
  <% end %>
9
- </tr>
10
- </thead>
11
- <tbody>
12
- <% rows.each.with_index do |row, i| %>
13
- <tr class="hover:bg-gray-400 hover:text-white <%= i.even? ? "bg-gray-100" : "bg-gray-200" %>">
14
- <% row.each do |column| %>
15
- <td class="p-1 border"><%= column %></td>
16
- <% end %>
17
- </tr>
18
- <% end %>
19
- </tbody>
20
- </table>
21
- <span class="italic">run_at: <%= Time.now.utc %></span>
20
+ </tbody>
21
+ </table>
22
+ </div>
23
+
24
+ <p class="italic text-gray-500 text-sm mt-3">Run at: <%= Time.now.utc %></p>
@@ -3,6 +3,8 @@
3
3
  <%= render "unavailable_extensions_warning" if unavailable_extensions.any? %>
4
4
  <%= render "diagnose" %>
5
5
 
6
+ <br>
7
+ <br>
6
8
  <h1 class="font-bold text-xl my-5">Actions</h1>
7
9
 
8
10
  <% if RailsPgExtras::Web.action_enabled?(:kill_all) %>
@@ -1,8 +1,14 @@
1
1
  <%= content_for :title, params[:query_name].presence || "pg_extras" %>
2
2
  <%= render "rails_pg_extras/web/shared/queries_selector" %>
3
-
3
+
4
+ <br>
5
+
6
+ <a href="/pg_extras/queries"
7
+ class="inline-block bg-blue-500 text-white font-medium px-4 py-2 rounded-lg shadow-md hover:bg-blue-600 transition">
8
+ ← Back to Diagnose
9
+ </a>
4
10
  <% if @error %>
5
- <div class="text-red-500 p-3 font-mono my-5"><%= @error %></div>
11
+ <div class="text-red-500 p-3 font-mono my-5"><%= @error %></div>
6
12
  <% else %>
7
13
  <% if @result&.any? %>
8
14
  <%= render "result",
@@ -10,14 +16,14 @@
10
16
  headers: @result[0].keys,
11
17
  rows: @result.values %>
12
18
  <% else %>
13
- <div class="font-mono p-3 bg-gray-100 mt-3">No results</div>
19
+ <div class="font-mono p-3 bg-gray-100 mt-3">No results</div>
14
20
  <% end %>
15
21
  <% end %>
16
-
17
- <style>
18
- @media print {
19
- form {
20
- display: none
21
- }
22
- }
23
- </style>
22
+
23
+ <style>
24
+ @media print {
25
+ form {
26
+ display: none
27
+ }
28
+ }
29
+ </style>
@@ -1,7 +1,7 @@
1
- <%= form_tag queries_path, id: "queries", method: :get do |f| %>
2
- <%= select_tag :query_name, options_for_select(@all_queries, params[:query_name]),
3
- { prompt: "--- select query ---", class: "border p-2 font-bold", autofocus: true } %>
4
- <% end %>
1
+ <%= form_tag queries_path, id: "queries", method: :get do |f| %>
2
+ <%= select_tag :query_name, options_for_select(@all_queries, params[:query_name]),
3
+ { prompt: "diagnose", class: "border p-2 font-bold", autofocus: true } %>
4
+ <% end %>
5
5
 
6
6
  <%= javascript_tag nonce: true do -%>
7
7
  document.getElementById('queries').addEventListener('change', (e) => {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPgExtras
4
- VERSION = "5.6.2"
4
+ VERSION = "5.6.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pg-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.2
4
+ version: 5.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-11 00:00:00.000000000 Z
11
+ date: 2025-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-pg-extras
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.6.2
19
+ version: 5.6.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.6.2
26
+ version: 5.6.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement