[ExceptionLog] Improve index page

* Show controller/action where the exception occured
* Truncate extremely long messages. Looking at you, elasticsearch
This commit is contained in:
Earlopain 2022-10-05 17:44:54 +02:00
parent 714fba3541
commit b1964f25c3
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897

View File

@ -4,6 +4,7 @@
<th style="width: 200px">Created At</th>
<th>Code</th>
<th style="width: 100px">Commit</th>
<th>Controller/Action</th>
<th>Class Name</th>
<th>Message</th>
<th>Stacktrace</th>
@ -11,15 +12,14 @@
</thead>
<tbody>
<%- @exception_logs.each do |exception_log| %>
<tr style="cursor: click;">
<tr>
<td><%= exception_log.created_at.strftime("%b %d, %Y %l:%M %p") %></td>
<td><%= exception_log.code %></td>
<td><%= link_to exception_log.version, Danbooru.config.commit_url(exception_log.version) %></td>
<td><%= exception_log.extra_params.dig("params", "controller") %>/<%= exception_log.extra_params.dig("params", "action") %></td>
<td><%= exception_log.class_name %></td>
<td><%= exception_log.message %></td>
<td>
<%= link_to "View", admin_exception_path(exception_log) %>
</td>
<td><%= truncate(exception_log.message, length: 500) %></td>
<td><%= link_to "View", admin_exception_path(exception_log) %></td>
</tr>
<% end %>
</tbody>