rails_error_dashboard 0.1.29 → 0.1.30
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/README.md +34 -6
- data/app/controllers/rails_error_dashboard/errors_controller.rb +22 -0
- data/app/helpers/rails_error_dashboard/application_helper.rb +79 -7
- data/app/helpers/rails_error_dashboard/backtrace_helper.rb +149 -0
- data/app/models/rails_error_dashboard/application.rb +1 -1
- data/app/models/rails_error_dashboard/error_log.rb +44 -16
- data/app/views/layouts/rails_error_dashboard.html.erb +66 -1237
- data/app/views/rails_error_dashboard/errors/_error_row.html.erb +10 -2
- data/app/views/rails_error_dashboard/errors/_source_code.html.erb +76 -0
- data/app/views/rails_error_dashboard/errors/_timeline.html.erb +18 -82
- data/app/views/rails_error_dashboard/errors/index.html.erb +64 -31
- data/app/views/rails_error_dashboard/errors/overview.html.erb +181 -3
- data/app/views/rails_error_dashboard/errors/platform_comparison.html.erb +2 -1
- data/app/views/rails_error_dashboard/errors/settings/_value_badge.html.erb +286 -0
- data/app/views/rails_error_dashboard/errors/settings.html.erb +146 -480
- data/app/views/rails_error_dashboard/errors/show.html.erb +44 -20
- data/db/migrate/20251223000000_create_rails_error_dashboard_complete_schema.rb +188 -0
- data/db/migrate/20251224000001_create_rails_error_dashboard_error_logs.rb +5 -0
- data/db/migrate/20251224081522_add_better_tracking_to_error_logs.rb +3 -0
- data/db/migrate/20251224101217_add_controller_action_to_error_logs.rb +3 -0
- data/db/migrate/20251225071314_add_optimized_indexes_to_error_logs.rb +4 -0
- data/db/migrate/20251225074653_remove_environment_from_error_logs.rb +3 -0
- data/db/migrate/20251225085859_add_enhanced_metrics_to_error_logs.rb +3 -0
- data/db/migrate/20251225093603_add_similarity_tracking_to_error_logs.rb +3 -0
- data/db/migrate/20251225100236_create_error_occurrences.rb +3 -0
- data/db/migrate/20251225101920_create_cascade_patterns.rb +3 -0
- data/db/migrate/20251225102500_create_error_baselines.rb +3 -0
- data/db/migrate/20251226020000_add_workflow_fields_to_error_logs.rb +3 -0
- data/db/migrate/20251226020100_create_error_comments.rb +3 -0
- data/db/migrate/20251229111223_add_additional_performance_indexes.rb +4 -0
- data/db/migrate/20260106094220_create_rails_error_dashboard_applications.rb +3 -0
- data/db/migrate/20260106094233_add_application_to_error_logs.rb +3 -0
- data/db/migrate/20260106094318_finalize_application_foreign_key.rb +5 -0
- data/lib/generators/rails_error_dashboard/install/install_generator.rb +32 -0
- data/lib/generators/rails_error_dashboard/install/templates/initializer.rb +37 -4
- data/lib/rails_error_dashboard/configuration.rb +160 -3
- data/lib/rails_error_dashboard/configuration_error.rb +24 -0
- data/lib/rails_error_dashboard/engine.rb +17 -0
- data/lib/rails_error_dashboard/helpers/user_model_detector.rb +138 -0
- data/lib/rails_error_dashboard/queries/dashboard_stats.rb +19 -4
- data/lib/rails_error_dashboard/queries/errors_list.rb +20 -8
- data/lib/rails_error_dashboard/services/error_normalizer.rb +143 -0
- data/lib/rails_error_dashboard/services/git_blame_reader.rb +195 -0
- data/lib/rails_error_dashboard/services/github_link_generator.rb +159 -0
- data/lib/rails_error_dashboard/services/source_code_reader.rb +214 -0
- data/lib/rails_error_dashboard/version.rb +1 -1
- data/lib/rails_error_dashboard.rb +6 -0
- metadata +13 -10
- data/app/assets/stylesheets/rails_error_dashboard/_catppuccin_mocha.scss +0 -107
- data/app/assets/stylesheets/rails_error_dashboard/_components.scss +0 -625
- data/app/assets/stylesheets/rails_error_dashboard/_layout.scss +0 -257
- data/app/assets/stylesheets/rails_error_dashboard/_theme_variables.scss +0 -203
- data/app/assets/stylesheets/rails_error_dashboard/application.css +0 -15
- data/app/assets/stylesheets/rails_error_dashboard/application.css.map +0 -7
- data/app/assets/stylesheets/rails_error_dashboard/application.scss +0 -61
- data/app/views/layouts/rails_error_dashboard/application.html.erb +0 -55
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
<%
|
|
2
|
+
# Render value badge based on type
|
|
3
|
+
case type
|
|
4
|
+
when :boolean
|
|
5
|
+
if value
|
|
6
|
+
%>
|
|
7
|
+
<span class="badge bg-success fs-6">
|
|
8
|
+
<i class="bi bi-check-circle"></i> Enabled
|
|
9
|
+
</span>
|
|
10
|
+
<%
|
|
11
|
+
else
|
|
12
|
+
%>
|
|
13
|
+
<span class="badge bg-secondary fs-6">
|
|
14
|
+
<i class="bi bi-x-circle"></i> Disabled
|
|
15
|
+
</span>
|
|
16
|
+
<%
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
when :integer
|
|
20
|
+
if value.present?
|
|
21
|
+
%>
|
|
22
|
+
<span class="badge bg-info fs-6"><%= value %><%= " #{unit}" if unit %></span>
|
|
23
|
+
<%
|
|
24
|
+
else
|
|
25
|
+
%>
|
|
26
|
+
<span class="badge bg-secondary fs-6">Not set</span>
|
|
27
|
+
<%
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
when :float
|
|
31
|
+
if value.present?
|
|
32
|
+
%>
|
|
33
|
+
<span class="badge bg-info fs-6"><%= value %><%= unit %></span>
|
|
34
|
+
<%
|
|
35
|
+
else
|
|
36
|
+
%>
|
|
37
|
+
<span class="badge bg-secondary fs-6">Not set</span>
|
|
38
|
+
<%
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
when :percentage
|
|
42
|
+
if value.present?
|
|
43
|
+
%>
|
|
44
|
+
<span class="badge bg-info fs-6"><%= (value * 100).to_i %>%</span>
|
|
45
|
+
<%
|
|
46
|
+
else
|
|
47
|
+
%>
|
|
48
|
+
<span class="badge bg-secondary fs-6">Not set</span>
|
|
49
|
+
<%
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
when :string
|
|
53
|
+
if value.present?
|
|
54
|
+
%>
|
|
55
|
+
<code class="fs-6"><%= value %></code>
|
|
56
|
+
<%
|
|
57
|
+
else
|
|
58
|
+
%>
|
|
59
|
+
<span class="badge bg-secondary fs-6">Not set</span>
|
|
60
|
+
<%
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
when :symbol
|
|
64
|
+
if value.present?
|
|
65
|
+
%>
|
|
66
|
+
<code class="fs-6">:<%= value %></code>
|
|
67
|
+
<%
|
|
68
|
+
else
|
|
69
|
+
%>
|
|
70
|
+
<span class="badge bg-secondary fs-6">Not set</span>
|
|
71
|
+
<%
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
when :url
|
|
75
|
+
if value.present?
|
|
76
|
+
%>
|
|
77
|
+
<code class="fs-6 text-truncate" style="max-width: 200px; display: inline-block;"><%= value %></code>
|
|
78
|
+
<%
|
|
79
|
+
else
|
|
80
|
+
%>
|
|
81
|
+
<span class="badge bg-secondary fs-6">Not set</span>
|
|
82
|
+
<%
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
when :array
|
|
86
|
+
if value.present? && value.any?
|
|
87
|
+
%>
|
|
88
|
+
<span class="badge bg-info fs-6"><%= value.count %> item<%= value.count != 1 ? 's' : '' %></span>
|
|
89
|
+
<%
|
|
90
|
+
else
|
|
91
|
+
%>
|
|
92
|
+
<span class="badge bg-secondary fs-6">Empty</span>
|
|
93
|
+
<%
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
when :hash
|
|
97
|
+
if value.present? && value.any?
|
|
98
|
+
%>
|
|
99
|
+
<span class="badge bg-info fs-6"><%= value.count %> rule<%= value.count != 1 ? 's' : '' %></span>
|
|
100
|
+
<%
|
|
101
|
+
else
|
|
102
|
+
%>
|
|
103
|
+
<span class="badge bg-secondary fs-6">Empty</span>
|
|
104
|
+
<%
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
when :git_sha
|
|
108
|
+
if value.present?
|
|
109
|
+
%>
|
|
110
|
+
<span class="fs-6"><%= git_commit_link(value) %></span>
|
|
111
|
+
<%
|
|
112
|
+
else
|
|
113
|
+
%>
|
|
114
|
+
<span class="badge bg-secondary fs-6">Not set</span>
|
|
115
|
+
<%
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
when :application_name
|
|
119
|
+
# Show both configured and auto-detected application name
|
|
120
|
+
configured_value = value
|
|
121
|
+
auto_detected = defined?(Rails) ? Rails.application.class.module_parent_name : nil
|
|
122
|
+
effective_value = configured_value.presence || auto_detected
|
|
123
|
+
is_auto_detected = configured_value.blank? && auto_detected.present?
|
|
124
|
+
|
|
125
|
+
if effective_value.present?
|
|
126
|
+
%>
|
|
127
|
+
<div>
|
|
128
|
+
<code class="fs-6"><%= effective_value %></code>
|
|
129
|
+
<% if is_auto_detected %>
|
|
130
|
+
<small class="text-success d-block">
|
|
131
|
+
<i class="bi bi-magic"></i> Auto-detected
|
|
132
|
+
</small>
|
|
133
|
+
<% else %>
|
|
134
|
+
<small class="text-muted d-block">(Configured)</small>
|
|
135
|
+
<% end %>
|
|
136
|
+
</div>
|
|
137
|
+
<%
|
|
138
|
+
else
|
|
139
|
+
%>
|
|
140
|
+
<div>
|
|
141
|
+
<span class="badge bg-secondary fs-6">Not set</span>
|
|
142
|
+
<small class="text-muted d-block">Rails app name unavailable</small>
|
|
143
|
+
</div>
|
|
144
|
+
<%
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
when :database_name
|
|
148
|
+
# Show the active database connection name
|
|
149
|
+
begin
|
|
150
|
+
if RailsErrorDashboard.configuration.use_separate_database
|
|
151
|
+
# Using separate database
|
|
152
|
+
db_config_name = RailsErrorDashboard.configuration.database || 'error_dashboard'
|
|
153
|
+
db_config = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: db_config_name.to_s)
|
|
154
|
+
if db_config
|
|
155
|
+
db_name = db_config.database
|
|
156
|
+
status_badge = 'bg-success'
|
|
157
|
+
status_text = "Separate DB: #{db_config_name}"
|
|
158
|
+
else
|
|
159
|
+
db_name = db_config_name
|
|
160
|
+
status_badge = 'bg-warning'
|
|
161
|
+
status_text = "Configured but not found"
|
|
162
|
+
end
|
|
163
|
+
else
|
|
164
|
+
# Using primary database
|
|
165
|
+
db_config = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: 'primary')
|
|
166
|
+
if db_config
|
|
167
|
+
db_name = db_config.database
|
|
168
|
+
status_badge = 'bg-info'
|
|
169
|
+
status_text = "Shared DB (primary)"
|
|
170
|
+
else
|
|
171
|
+
# Fallback to current connection
|
|
172
|
+
db_name = RailsErrorDashboard::ErrorLog.connection.current_database rescue 'Unknown'
|
|
173
|
+
status_badge = 'bg-info'
|
|
174
|
+
status_text = "Shared DB"
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
%>
|
|
178
|
+
<div>
|
|
179
|
+
<span class="badge <%= status_badge %> fs-6"><%= File.basename(db_name.to_s) %></span>
|
|
180
|
+
<small class="text-muted d-block"><%= status_text %></small>
|
|
181
|
+
</div>
|
|
182
|
+
<%
|
|
183
|
+
rescue => e
|
|
184
|
+
%>
|
|
185
|
+
<div>
|
|
186
|
+
<span class="badge bg-secondary fs-6">Unknown</span>
|
|
187
|
+
<small class="text-muted d-block">Unable to detect</small>
|
|
188
|
+
</div>
|
|
189
|
+
<%
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
when :user_model
|
|
193
|
+
# Show both configured and auto-detected values
|
|
194
|
+
configured_value = value
|
|
195
|
+
effective_value = RailsErrorDashboard.configuration.effective_user_model
|
|
196
|
+
is_auto_detected = configured_value.blank? && effective_value.present?
|
|
197
|
+
|
|
198
|
+
if effective_value.present?
|
|
199
|
+
%>
|
|
200
|
+
<div>
|
|
201
|
+
<code class="fs-6"><%= effective_value %></code>
|
|
202
|
+
<% if is_auto_detected %>
|
|
203
|
+
<small class="text-success d-block">
|
|
204
|
+
<i class="bi bi-magic"></i> Auto-detected
|
|
205
|
+
</small>
|
|
206
|
+
<% else %>
|
|
207
|
+
<small class="text-muted d-block">(Configured)</small>
|
|
208
|
+
<% end %>
|
|
209
|
+
</div>
|
|
210
|
+
<%
|
|
211
|
+
else
|
|
212
|
+
%>
|
|
213
|
+
<div>
|
|
214
|
+
<span class="badge bg-secondary fs-6">Not found</span>
|
|
215
|
+
<small class="text-muted d-block">No User model detected</small>
|
|
216
|
+
</div>
|
|
217
|
+
<%
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
when :total_users
|
|
221
|
+
# Show both configured and auto-detected values
|
|
222
|
+
configured_value = value
|
|
223
|
+
effective_value = RailsErrorDashboard.configuration.effective_total_users
|
|
224
|
+
is_auto_detected = configured_value.blank? && effective_value.present?
|
|
225
|
+
|
|
226
|
+
if effective_value.present?
|
|
227
|
+
%>
|
|
228
|
+
<div>
|
|
229
|
+
<span class="badge <%= is_auto_detected ? 'bg-success' : 'bg-info' %> fs-6"><%= number_with_delimiter(effective_value) %> users</span>
|
|
230
|
+
<% if is_auto_detected %>
|
|
231
|
+
<small class="text-success d-block">
|
|
232
|
+
<i class="bi bi-magic"></i> Auto-detected
|
|
233
|
+
</small>
|
|
234
|
+
<% else %>
|
|
235
|
+
<small class="text-muted d-block">(Configured)</small>
|
|
236
|
+
<% end %>
|
|
237
|
+
</div>
|
|
238
|
+
<%
|
|
239
|
+
else
|
|
240
|
+
%>
|
|
241
|
+
<div>
|
|
242
|
+
<span class="badge bg-secondary fs-6">Not available</span>
|
|
243
|
+
<small class="text-muted d-block">Unable to query count</small>
|
|
244
|
+
</div>
|
|
245
|
+
<%
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
when :retention_days
|
|
249
|
+
# Show retention configuration with manual cleanup instructions
|
|
250
|
+
if value.present?
|
|
251
|
+
%>
|
|
252
|
+
<div>
|
|
253
|
+
<span class="badge bg-warning text-dark fs-6"><%= value %> days</span>
|
|
254
|
+
<small class="text-danger d-block">
|
|
255
|
+
<i class="bi bi-exclamation-triangle"></i> Manual cleanup required
|
|
256
|
+
</small>
|
|
257
|
+
<small class="text-muted d-block mt-1">
|
|
258
|
+
Run: <code class="small">rails error_dashboard:cleanup_resolved DAYS=<%= value %></code>
|
|
259
|
+
</small>
|
|
260
|
+
</div>
|
|
261
|
+
<%
|
|
262
|
+
else
|
|
263
|
+
%>
|
|
264
|
+
<div>
|
|
265
|
+
<span class="badge bg-success fs-6"><i class="bi bi-infinity"></i> Keep Forever</span>
|
|
266
|
+
<small class="text-muted d-block">No automatic deletion</small>
|
|
267
|
+
<small class="text-muted d-block mt-1">
|
|
268
|
+
To cleanup: <code class="small">rails error_dashboard:cleanup_resolved DAYS=90</code>
|
|
269
|
+
</small>
|
|
270
|
+
</div>
|
|
271
|
+
<%
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
else
|
|
275
|
+
# Default rendering
|
|
276
|
+
if value.present?
|
|
277
|
+
%>
|
|
278
|
+
<code class="fs-6"><%= value %></code>
|
|
279
|
+
<%
|
|
280
|
+
else
|
|
281
|
+
%>
|
|
282
|
+
<span class="badge bg-secondary fs-6">Not set</span>
|
|
283
|
+
<%
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
%>
|