pg_reports 0.6.0 → 0.6.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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +45 -0
  3. data/README.md +143 -378
  4. data/app/controllers/pg_reports/dashboard_controller.rb +21 -21
  5. data/app/views/layouts/pg_reports/application.html.erb +65 -8
  6. data/app/views/pg_reports/dashboard/_show_modals.html.erb +22 -22
  7. data/app/views/pg_reports/dashboard/_show_scripts.html.erb +55 -57
  8. data/app/views/pg_reports/dashboard/_show_styles.html.erb +18 -0
  9. data/app/views/pg_reports/dashboard/index.html.erb +109 -106
  10. data/app/views/pg_reports/dashboard/show.html.erb +26 -26
  11. data/config/locales/en.yml +488 -0
  12. data/config/locales/ru.yml +481 -0
  13. data/config/locales/uk.yml +481 -0
  14. data/lib/pg_reports/annotation_parser.rb +13 -1
  15. data/lib/pg_reports/compatibility.rb +3 -3
  16. data/lib/pg_reports/dashboard/reports_registry.rb +83 -12
  17. data/lib/pg_reports/definitions/schema_analysis/always_null_columns.yml +31 -0
  18. data/lib/pg_reports/definitions/schema_analysis/unused_columns.yml +32 -0
  19. data/lib/pg_reports/definitions/tables/unused_tables.yml +30 -0
  20. data/lib/pg_reports/definitions/tables/update_hotspots.yml +32 -0
  21. data/lib/pg_reports/module_generator.rb +2 -1
  22. data/lib/pg_reports/modules/schema_analysis.rb +261 -2
  23. data/lib/pg_reports/modules/system.rb +3 -3
  24. data/lib/pg_reports/query_monitor.rb +2 -6
  25. data/lib/pg_reports/report_definition.rb +20 -24
  26. data/lib/pg_reports/sql/schema_analysis/always_null_columns.sql +25 -0
  27. data/lib/pg_reports/sql/schema_analysis/unused_columns.sql +36 -0
  28. data/lib/pg_reports/sql/tables/unused_tables.sql +19 -0
  29. data/lib/pg_reports/sql/tables/update_hotspots.sql +26 -0
  30. data/lib/pg_reports/version.rb +1 -1
  31. metadata +9 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div class="report-page">
4
4
  <nav class="breadcrumb">
5
- <%= link_to "Dashboard", root_path %>
5
+ <%= link_to t("pg_reports.ui.navigation.dashboard"), root_path %>
6
6
  <span>/</span>
7
7
  <span><%= @categories[@category][:name] %></span>
8
8
  <span>/</span>
@@ -17,40 +17,40 @@
17
17
 
18
18
  <div class="report-actions">
19
19
  <button class="btn btn-primary" onclick="runReport('<%= @category %>', '<%= @report_key %>', this)">
20
- Run Report
20
+ <%= t("pg_reports.ui.actions.run_report") %>
21
21
  </button>
22
22
 
23
23
  <!-- Export dropdown -->
24
24
  <div class="dropdown" id="download-dropdown" style="display: none;">
25
25
  <button class="btn btn-secondary" onclick="toggleDropdown()">
26
- Export
26
+ <%= t("pg_reports.ui.actions.export") %>
27
27
  </button>
28
28
  <div class="dropdown-menu" id="dropdown-menu">
29
- <a href="#" onclick="downloadReport('txt'); return false;">📄 Text (.txt)</a>
30
- <a href="#" onclick="downloadReport('csv'); return false;">📊 CSV (.csv)</a>
31
- <a href="#" onclick="downloadReport('json'); return false;">📋 JSON (.json)</a>
29
+ <a href="#" onclick="downloadReport('txt'); return false;"><%= t("pg_reports.ui.actions.download_text") %></a>
30
+ <a href="#" onclick="downloadReport('csv'); return false;"><%= t("pg_reports.ui.actions.download_csv") %></a>
31
+ <a href="#" onclick="downloadReport('json'); return false;"><%= t("pg_reports.ui.actions.download_json") %></a>
32
32
  <% if @documentation && @documentation[:ai_prompt].present? %>
33
33
  <div class="dropdown-divider"></div>
34
- <a href="#" id="ai-prompt-btn" onclick="copyAiPrompt(this); return false;"><span class="ai-icon">AI</span> Copy Prompt</a>
34
+ <a href="#" id="ai-prompt-btn" onclick="copyAiPrompt(this); return false;"><span class="ai-icon">AI</span> <%= t("pg_reports.ui.actions.copy_ai_prompt") %></a>
35
35
  <% end %>
36
36
  </div>
37
37
  </div>
38
38
 
39
39
  <% if PgReports.config.telegram_configured? %>
40
40
  <button class="btn btn-telegram" onclick="sendToTelegram('<%= @category %>', '<%= @report_key %>', this)" id="telegram-btn" style="display: none;">
41
- 📨 Telegram
41
+ <%= t("pg_reports.ui.actions.send_telegram") %>
42
42
  </button>
43
43
  <% end %>
44
- <button class="btn btn-icon" onclick="showIdeSettingsModal()" title="IDE Settings">
44
+ <button class="btn btn-icon" onclick="showIdeSettingsModal()" title="<%= t("pg_reports.ui.actions.ide_settings_button_title") %>">
45
45
  ⚙️
46
46
  </button>
47
- <%= link_to "← Back", root_path, class: "btn btn-secondary" %>
47
+ <%= link_to t("pg_reports.ui.navigation.back"), root_path, class: "btn btn-secondary" %>
48
48
  </div>
49
49
  </div>
50
50
 
51
51
  <% if @error %>
52
52
  <div class="error-message">
53
- <strong>Error:</strong> <%= @error %>
53
+ <strong><%= t("pg_reports.ui.errors.error_prefix") %></strong> <%= @error %>
54
54
  </div>
55
55
  <% end %>
56
56
 
@@ -60,26 +60,26 @@
60
60
  <details class="documentation-section">
61
61
  <summary class="documentation-toggle">
62
62
  <span class="toggle-icon">▶</span>
63
- <span>📖 What does this report show?</span>
63
+ <span><%= t("pg_reports.ui.documentation.toggle_title") %></span>
64
64
  </summary>
65
65
  <div class="documentation-content">
66
66
  <% if @documentation[:what].present? %>
67
67
  <div class="doc-block">
68
- <h4>📋 What</h4>
68
+ <h4><%= t("pg_reports.ui.documentation.what_section") %></h4>
69
69
  <p><%= @documentation[:what] %></p>
70
70
  </div>
71
71
  <% end %>
72
72
 
73
73
  <% if @documentation[:why].present? %>
74
74
  <div class="doc-block">
75
- <h4>❓ Why It Matters</h4>
75
+ <h4><%= t("pg_reports.ui.documentation.why_section") %></h4>
76
76
  <p><%= @documentation[:why] %></p>
77
77
  </div>
78
78
  <% end %>
79
79
 
80
80
  <% if @documentation[:nuances].present? %>
81
81
  <div class="doc-block">
82
- <h4>⚠️ Nuances</h4>
82
+ <h4><%= t("pg_reports.ui.documentation.nuances_section") %></h4>
83
83
  <ul class="nuances-list">
84
84
  <% @documentation[:nuances].each do |nuance| %>
85
85
  <li><%= nuance %></li>
@@ -90,15 +90,15 @@
90
90
 
91
91
  <% if @thresholds.present? %>
92
92
  <div class="thresholds-block">
93
- <h4>📊 Thresholds</h4>
93
+ <h4><%= t("pg_reports.ui.documentation.thresholds_section") %></h4>
94
94
  <div class="thresholds-grid">
95
95
  <% @thresholds.each do |field, values| %>
96
96
  <div class="threshold-item">
97
97
  <span class="threshold-field"><%= field %></span>
98
- <span class="threshold-warning">⚠️ Warning: <%= values[:warning] %></span>
99
- <span class="threshold-critical">🔴 Critical: <%= values[:critical] %></span>
98
+ <span class="threshold-warning"><%= t("pg_reports.ui.documentation.threshold_warning_label") %> <%= values[:warning] %></span>
99
+ <span class="threshold-critical"><%= t("pg_reports.ui.documentation.threshold_critical_label") %> <%= values[:critical] %></span>
100
100
  <% if values[:inverted] %>
101
- <span class="threshold-note">(lower is worse)</span>
101
+ <span class="threshold-note"><%= t("pg_reports.ui.documentation.threshold_inverted_note") %></span>
102
102
  <% end %>
103
103
  </div>
104
104
  <% end %>
@@ -115,7 +115,7 @@
115
115
  <details class="filter-details">
116
116
  <summary class="filter-toggle">
117
117
  <span class="toggle-icon">▶</span>
118
- <span>🔍 Параметры фильтрации</span>
118
+ <span><%= t("pg_reports.ui.filters.title") %></span>
119
119
  </summary>
120
120
  <div class="filter-content">
121
121
  <div class="filter-grid">
@@ -127,7 +127,7 @@
127
127
  <span class="filter-description"><%= config[:description] %></span>
128
128
  <% end %>
129
129
  <% if config[:is_threshold] && config[:current_config] %>
130
- <span class="filter-current-value">(current: <%= config[:current_config] %>)</span>
130
+ <span class="filter-current-value">(<%= t("pg_reports.ui.filters.current_value") %>: <%= config[:current_config] %>)</span>
131
131
  <% end %>
132
132
  </label>
133
133
  <input
@@ -153,17 +153,17 @@
153
153
  <!-- Saved Records Section -->
154
154
  <div class="saved-records-section" id="saved-records-section" style="display: none;">
155
155
  <div class="saved-records-header">
156
- <span class="saved-records-title">📌 Saved for Comparison</span>
157
- <button class="btn btn-small btn-muted" onclick="clearAllSavedRecords()">Clear All</button>
156
+ <span class="saved-records-title"><%= t("pg_reports.ui.saved.title") %></span>
157
+ <button class="btn btn-small btn-muted" onclick="clearAllSavedRecords()"><%= t("pg_reports.ui.actions.clear_all") %></button>
158
158
  </div>
159
159
  <div class="saved-records-list" id="saved-records-list"></div>
160
160
  </div>
161
161
 
162
162
  <div class="results-container" id="results-container">
163
163
  <div class="results-header">
164
- <span class="results-title">Results</span>
164
+ <span class="results-title"><%= t("pg_reports.ui.results.title") %></span>
165
165
  <div class="results-meta" id="results-meta">
166
- <span>Click "Run Report" to fetch data</span>
166
+ <span><%= t("pg_reports.ui.results.click_run_hint") %></span>
167
167
  </div>
168
168
  </div>
169
169
 
@@ -173,7 +173,7 @@
173
173
 
174
174
  <div id="empty-state" class="empty-state" style="display: none;">
175
175
  <div class="empty-state-icon">✓</div>
176
- <p>No issues found. Everything looks good!</p>
176
+ <p><%= t("pg_reports.ui.results.empty_message") %></p>
177
177
  </div>
178
178
 
179
179
  <div class="top-scroll-wrapper" id="top-scroll-wrapper" style="display: none;">