35 lines
596 B
Ruby
35 lines
596 B
Ruby
class AdminController < ApplicationController
|
|
before_action :authenticate_user!
|
|
before_action :admin_only
|
|
|
|
def status
|
|
end
|
|
|
|
def screenshots
|
|
end
|
|
|
|
def integration
|
|
end
|
|
|
|
def logs
|
|
logs = Log
|
|
|
|
if params[:search].present?
|
|
logger.debug "Searching for #{params[:search]}"
|
|
logs = logs.where("message ilike ?", "%#{params[:search]}%")
|
|
end
|
|
|
|
@logs = logs.paginate(page: params[:page], per_page: 20)
|
|
end
|
|
|
|
|
|
private
|
|
|
|
def admin_only
|
|
unless current_user.is_admin?
|
|
head :forbidden
|
|
# redirect_to :back, :alert => "Access denied."
|
|
end
|
|
end
|
|
|
|
end
|