forked from e621ng/e621ng
[Admin] Allow searching by exception class
This commit is contained in:
parent
2d7e507555
commit
4acddd5941
@ -42,12 +42,16 @@ class ExceptionLog < ApplicationRecord
|
||||
def self.search(params)
|
||||
q = super
|
||||
|
||||
if params[:version].present?
|
||||
q = q.where(version: params[:version])
|
||||
if params[:commit].present?
|
||||
q = q.where(version: params[:commit])
|
||||
end
|
||||
|
||||
if params[:without_timeouts]&.truthy?
|
||||
q = q.where("class_name != 'ActiveRecord::QueryCanceled'")
|
||||
if params[:class_name].present?
|
||||
q = q.where(class_name: params[:class_name])
|
||||
end
|
||||
|
||||
if params[:without_class_name].present?
|
||||
q = q.where.not(class_name: params[:without_class_name])
|
||||
end
|
||||
|
||||
q.apply_basic_order(params)
|
||||
|
@ -1,6 +1,7 @@
|
||||
<%= form_search(path: admin_exceptions_path) do |f| %>
|
||||
<%= f.input :version, label: "Commit" %>
|
||||
<%= f.input :without_timeouts, as: :boolean %>
|
||||
<%= f.input :commit %>
|
||||
<%= f.input :class_name %>
|
||||
<%= f.input :without_class_name %>
|
||||
<% end %>
|
||||
|
||||
<table class="striped">
|
||||
|
Loading…
Reference in New Issue
Block a user