Add a rules controller
This commit is contained in:
@@ -44,7 +44,7 @@ class ProjectsController < ApplicationController
|
||||
|
||||
# Apply filters
|
||||
@events = @events.by_ip(params[:ip]) if params[:ip].present?
|
||||
@events = @events.by_action(params[:action]) if params[:action].present?
|
||||
@events = @events.by_waf_action(params[:action]) if params[:action].present?
|
||||
@events = @events.where(country_code: params[:country]) if params[:country].present?
|
||||
|
||||
# Debug info
|
||||
@@ -81,8 +81,8 @@ class ProjectsController < ApplicationController
|
||||
# Action distribution
|
||||
@action_stats = @project.events
|
||||
.where(timestamp: @time_range.hours.ago..Time.current)
|
||||
.group(:action)
|
||||
.select('action, COUNT(*) as count')
|
||||
.group(:waf_action)
|
||||
.select('waf_action as action, COUNT(*) as count')
|
||||
.order('count DESC')
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user