2017-04-28 13:27:59 +08:00
|
|
|
<%
|
|
|
|
# Copyright (C) 2011 - present Instructure, Inc.
|
|
|
|
#
|
|
|
|
# This file is part of Canvas.
|
|
|
|
#
|
|
|
|
# Canvas is free software: you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU Affero General Public License as published by the Free
|
|
|
|
# Software Foundation, version 3 of the License.
|
|
|
|
#
|
|
|
|
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
|
|
# details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License along
|
|
|
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
%>
|
|
|
|
|
2019-07-01 23:34:15 +08:00
|
|
|
<%
|
|
|
|
provide :page_title, t("#titles.error_reports", "Error Reports")
|
2011-06-10 02:42:30 +08:00
|
|
|
add_crumb t("#crumbs.error_reports", "Error Reports")
|
2011-04-07 01:38:48 +08:00
|
|
|
%>
|
2011-04-29 04:41:33 +08:00
|
|
|
|
2013-10-09 03:21:53 +08:00
|
|
|
<%= form_for @current_user, :url => '/error_reports', :html => { :method => :get } do |f| %>
|
2012-08-24 04:33:40 +08:00
|
|
|
<% if error_search_enabled? %>
|
|
|
|
<%= t :message_contains, "Message contains" %>
|
|
|
|
<input type="text" name="message" value="<%= @message %>" style="width: 250px;"/>
|
|
|
|
<% end %>
|
2011-05-12 00:31:07 +08:00
|
|
|
<select name="category">
|
2012-01-20 12:29:46 +08:00
|
|
|
<%= options_for_select([[t(:all_categories, " - All Categories -"), nil]] + ErrorReport.categories, params[:category]) %>
|
2011-05-12 00:31:07 +08:00
|
|
|
</select>
|
2012-11-09 13:59:16 +08:00
|
|
|
<button type="submit" class="btn"><%= t "#buttons.search", "Search" %></button>
|
2011-04-29 04:41:33 +08:00
|
|
|
<% end %>
|
|
|
|
|
2011-06-24 23:08:40 +08:00
|
|
|
<% content_for :pagination do %>
|
2012-04-07 03:12:31 +08:00
|
|
|
<% if params[:action] == 'index' %>
|
|
|
|
<%= will_paginate(@reports, :page_links => false) %>
|
2011-06-25 04:38:46 +08:00
|
|
|
<% end %>
|
2011-06-24 23:08:40 +08:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= yield :pagination %>
|
|
|
|
|
2011-02-01 09:57:29 +08:00
|
|
|
<% @reports.each do |report| %>
|
|
|
|
<div style="margin-bottom: 20px;">
|
2011-05-31 06:19:10 +08:00
|
|
|
<h3>
|
|
|
|
<%= link_to "##{report.id}", error_url(report) %>
|
|
|
|
<% if @reports.length > 1 %>
|
|
|
|
<%= truncate(report.message, :length => 80) %>
|
|
|
|
<% else %>
|
|
|
|
<%= report.message %>
|
|
|
|
<% end %>
|
|
|
|
</h3>
|
|
|
|
|
2011-05-15 23:01:44 +08:00
|
|
|
<div style="border: 1px solid #eee; -moz-border-radius: 5px; padding: 5px 20px;">
|
2012-09-18 04:37:21 +08:00
|
|
|
<% if report.account_id %>
|
|
|
|
<%= before_label :account, "account" %> <%= link_to report.account.try(:name), account_url(report.account_id) %><br />
|
|
|
|
<% end %>
|
2011-06-10 02:42:30 +08:00
|
|
|
<%= before_label :category, "category" %> <%= report.category || t(:default_category, 'default') %><br/>
|
2012-08-01 01:35:19 +08:00
|
|
|
<%= before_label :created_at, "created at" %> <%= report.created_at %><br />
|
2011-04-07 01:38:48 +08:00
|
|
|
<% if report.user_id %>
|
2012-08-01 01:35:19 +08:00
|
|
|
<%= before_label :user, "user" %> <%= link_to report.user.try(:name), user_url(report.user_id) %><br />
|
2011-04-07 01:38:48 +08:00
|
|
|
<% end %>
|
2012-10-04 23:00:47 +08:00
|
|
|
<% if report.url.present? %>
|
2017-05-12 06:32:56 +08:00
|
|
|
<%= before_label :url, "url" %>
|
|
|
|
<%=
|
|
|
|
if report.safe_url?
|
|
|
|
link_to report.url, report.url
|
|
|
|
else
|
|
|
|
report.url
|
|
|
|
end
|
|
|
|
%><br />
|
2012-10-04 23:00:47 +08:00
|
|
|
<% end %>
|
2012-08-01 01:35:19 +08:00
|
|
|
<% if report.request_context_id %>
|
2017-01-24 03:53:42 +08:00
|
|
|
<%= before_label :request_context_id, "request context id" %> <%= report.request_context_id %><br />
|
2012-08-01 01:35:19 +08:00
|
|
|
<% end %>
|
2012-09-20 05:56:39 +08:00
|
|
|
<% if report.comments %>
|
2017-01-24 03:53:42 +08:00
|
|
|
<%= before_label :comments, "comments" %> <%= report.comments %><br />
|
2012-09-20 05:56:39 +08:00
|
|
|
<% end %>
|
2012-08-01 01:35:19 +08:00
|
|
|
<% (report.data || {}).to_a.sort.each do |k,v| %>
|
|
|
|
<% next if k.to_s == "exception_message" %>
|
2011-06-10 02:42:30 +08:00
|
|
|
<br><%= before_label k.to_s %> <%= v %>
|
2011-05-11 00:48:37 +08:00
|
|
|
<% end %>
|
2012-08-01 01:35:19 +08:00
|
|
|
<br />
|
2018-03-31 03:41:33 +08:00
|
|
|
<pre style="font-size: 0.8em; margin-<%= direction('left') %>: 20px; <%= "max-height: 150px;" if @reports.length > 1 %> overflow: auto;">
|
2012-08-01 01:35:19 +08:00
|
|
|
<%= report.data.try(:[], "exception_message") %><br />
|
2011-05-11 00:48:37 +08:00
|
|
|
<%= report.backtrace %>
|
2011-02-01 09:57:29 +08:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
2011-05-11 00:48:37 +08:00
|
|
|
<% end %>
|
2011-06-24 23:08:40 +08:00
|
|
|
|
|
|
|
<%= yield :pagination %>
|