UI for viewing details of a specific error report

Change-Id: Ib861649aa3baa9afee503d88137939872289eeec
Reviewed-on: https://gerrit.instructure.com/2966
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
This commit is contained in:
Brian Whitmer 2011-04-06 11:38:48 -06:00
parent 785d301610
commit 339f591334
3 changed files with 13 additions and 2 deletions

View File

@ -19,6 +19,10 @@
class ErrorsController < ApplicationController
before_filter :require_user, :require_site_admin
def index
@reports = ErrorReport.find(:all, :order => 'created_at DESC', :limit => 25, :offset => params[:start] || 0)
@reports = ErrorReport.find(:all, :order => 'created_at DESC', :include => :user, :limit => 25, :offset => params[:start] || 0)
end
def show
@reports = [ErrorReport.find(params[:id])]
render :action => 'index'
end
end

View File

@ -1,8 +1,15 @@
<%
content_for :page_title, "Error Reports"
add_crumb "Error Reports"
%>
<% @reports.each do |report| %>
<div style="margin-bottom: 20px;">
<h3><%= h(report.message) %></h3>
<div style="border: 1px solid #eee; -moz-border-radius: 5px; padding: 5px 20px;">
<%= h(report.url) %><br/>
<% if report.user_id %>
<%= link_to report.user.try(:name), user_url(report.user_id) %>
<% end %>
<pre style="font-size: 0.8em; margin-left: 20px; height: 150px; overflow: auto;">
<%= h(report.backtrace) %>
</pre>

View File

@ -588,7 +588,7 @@ ActionController::Routing::Routes.draw do |map|
# end
map.errors "errors", :controller => "info", :action => "record_error", :conditions => {:method => :post}
map.resources :errors, :as => :error_reports
map.resources :errors, :as => :error_reports, :only => [:show, :index]
map.health_check "health_check", :controller => 'info', :action => 'health_check'