42 lines
1.8 KiB
Plaintext
42 lines
1.8 KiB
Plaintext
<%# Compact rule display for showing rules on network range pages %>
|
|
<div class="flex items-center justify-between text-sm py-1.5 hover:bg-gray-50 px-2 -mx-2 rounded">
|
|
<div class="flex items-center space-x-2 min-w-0 flex-1">
|
|
<%= link_to rule, class: "flex items-center space-x-2 min-w-0 hover:text-blue-600" do %>
|
|
<%# Action badge %>
|
|
<% action_classes = case rule.waf_action
|
|
when 'deny' then 'bg-red-100 text-red-800'
|
|
when 'allow' then 'bg-green-100 text-green-800'
|
|
when 'redirect' then 'bg-blue-100 text-blue-800'
|
|
when 'challenge' then 'bg-yellow-100 text-yellow-800'
|
|
when 'log' then 'bg-gray-100 text-gray-800'
|
|
else 'bg-gray-100 text-gray-800'
|
|
end %>
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium <%= action_classes %>">
|
|
<%= rule.waf_action.upcase %>
|
|
</span>
|
|
|
|
<%# Network CIDR %>
|
|
<span class="font-mono text-gray-900 truncate"><%= rule.network_range.cidr %></span>
|
|
|
|
<%# Priority %>
|
|
<span class="text-xs text-gray-500">P:<%= rule.priority %></span>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="flex items-center space-x-2 flex-shrink-0">
|
|
<%# Disabled badge %>
|
|
<% unless rule.enabled? %>
|
|
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs bg-gray-200 text-gray-600" title="<%= rule.metadata_hash['disabled_reason'] %>">
|
|
Disabled
|
|
</span>
|
|
<% end %>
|
|
|
|
<%# Policy badge if policy-generated %>
|
|
<% if rule.waf_policy.present? %>
|
|
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs bg-purple-100 text-purple-800" title="<%= rule.waf_policy.name %>">
|
|
Policy
|
|
</span>
|
|
<% end %>
|
|
</div>
|
|
</div>
|