Fix some blocked/allow laggards after migrating. Add DuckDB for outstanding analyitcs performance. Start adding an import for all bot networks
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<p class="mt-2 text-gray-600">Create a WAF rule to allow, block, or rate limit traffic</p>
|
||||
</div>
|
||||
|
||||
<div class="bg-white shadow rounded-lg">
|
||||
<div class="bg-white shadow rounded-lg" data-controller="rule-form">
|
||||
<%= form_with(model: @rule, local: true, class: "space-y-6") do |form| %>
|
||||
<% if @rule.errors.any? %>
|
||||
<div class="rounded-md bg-red-50 p-4">
|
||||
@@ -54,7 +54,8 @@
|
||||
<%= form.select :waf_action,
|
||||
options_for_select(@waf_actions.map { |action, _| [action.humanize, action] }, @rule.waf_action),
|
||||
{ prompt: "Select action" },
|
||||
{ class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" } %>
|
||||
{ class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
|
||||
data: { rule_form_target: "actionSelect", action: "change->rule-form#updateActionSections" } } %>
|
||||
<p class="mt-2 text-sm text-gray-500">What action to take when this rule matches</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -158,6 +159,27 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add Header Fields (shown for add_header action) -->
|
||||
<div id="add_header_section" class="hidden space-y-4" data-rule-form-target="addHeaderSection">
|
||||
<div>
|
||||
<%= label_tag :header_name, "Header Name", class: "block text-sm font-medium text-gray-700" %>
|
||||
<%= text_field_tag :header_name, "",
|
||||
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
|
||||
placeholder: "X-Bot-Agent",
|
||||
id: "header_name_input" %>
|
||||
<p class="mt-2 text-sm text-gray-500">The HTTP header name to add (e.g., X-Bot-Agent, X-Network-Type)</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= label_tag :header_value, "Header Value", class: "block text-sm font-medium text-gray-700" %>
|
||||
<%= text_field_tag :header_value, "",
|
||||
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
|
||||
placeholder: "BingBot",
|
||||
id: "header_value_input" %>
|
||||
<p class="mt-2 text-sm text-gray-500">The value for the header (e.g., BingBot, GoogleBot, Unknown)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Metadata -->
|
||||
<div data-controller="json-validator" data-json-validator-valid-class="json-valid" data-json-validator-invalid-class="json-invalid" data-json-validator-valid-status-class="json-valid-status" data-json-validator-invalid-status-class="json-invalid-status">
|
||||
<%= form.label :metadata, "Metadata", class: "block text-sm font-medium text-gray-700" %>
|
||||
@@ -197,10 +219,18 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :expires_at, "Expires At", class: "block text-sm font-medium text-gray-700" %>
|
||||
<%= form.datetime_local_field :expires_at,
|
||||
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
|
||||
<p class="mt-2 text-sm text-gray-500">Leave blank for permanent rule</p>
|
||||
<div class="flex items-center mb-2">
|
||||
<%= check_box_tag :set_expiration, "1", false,
|
||||
class: "h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",
|
||||
data: { rule_form_target: "expirationCheckbox", action: "change->rule-form#toggleExpiration" } %>
|
||||
<%= label_tag :set_expiration, "Set expiration", class: "ml-2 block text-sm font-medium text-gray-700" %>
|
||||
</div>
|
||||
<div class="hidden" data-rule-form-target="expirationField">
|
||||
<%= form.label :expires_at, "Expires At", class: "block text-sm font-medium text-gray-700" %>
|
||||
<%= form.datetime_local_field :expires_at,
|
||||
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
|
||||
<p class="mt-2 text-sm text-gray-500">When this rule should automatically expire</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center pt-6">
|
||||
|
||||
Reference in New Issue
Block a user