<% content_for :title, "Network Ranges - #{@project.name}" %>

Network Ranges

Browse and manage network ranges with intelligence data

<%= link_to "IP Lookup", lookup_network_ranges_path, class: "inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50" %> <%= link_to "Add Range", new_network_range_path, class: "inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700" %>
<% if params[:asn].present? || params[:country].present? || params[:company].present? || params[:datacenter].present? || params[:vpn].present? || params[:proxy].present? || params[:source].present? || params[:search].present? %>

Active Filters

<% if params[:asn].present? %> ASN: <%= params[:asn] %> <%= link_to "×", network_ranges_path, class: "ml-2 text-blue-600 hover:text-blue-800" %> <% end %> <% if params[:country].present? %> Country: <%= params[:country] %> <%= link_to "×", network_ranges_path, class: "ml-2 text-blue-600 hover:text-blue-800" %> <% end %> <% if params[:company].present? %> Company: <%= params[:company] %> <%= link_to "×", network_ranges_path, class: "ml-2 text-blue-600 hover:text-blue-800" %> <% end %> <% if params[:datacenter].present? %> Datacenter <%= link_to "×", network_ranges_path, class: "ml-2 text-blue-600 hover:text-blue-800" %> <% end %> <% if params[:vpn].present? %> VPN <%= link_to "×", network_ranges_path, class: "ml-2 text-blue-600 hover:text-blue-800" %> <% end %> <% if params[:proxy].present? %> Proxy <%= link_to "×", network_ranges_path, class: "ml-2 text-blue-600 hover:text-blue-800" %> <% end %> <% if params[:source].present? %> Source: <%= params[:source] %> <%= link_to "×", network_ranges_path, class: "ml-2 text-blue-600 hover:text-blue-800" %> <% end %> <% if params[:search].present? %> Search: <%= params[:search] %> <%= link_to "×", network_ranges_path, class: "ml-2 text-blue-600 hover:text-blue-800" %> <% end %>
<%= link_to "Clear All", network_ranges_path, class: "text-sm text-blue-600 hover:text-blue-800 font-medium" %>
<% end %>
Total Ranges
<%= number_with_delimiter(@total_ranges) %>
With Intelligence
<%= number_with_delimiter(@ranges_with_intelligence) %>
Datacenters
<%= number_with_delimiter(@datacenter_ranges) %>
VPNs
<%= number_with_delimiter(@vpn_ranges) %>
Proxies
<%= number_with_delimiter(@proxy_ranges) %>

Filters & Search

<%= form_with url: network_ranges_path, method: :get, class: "space-y-4" do |form| %>
<%= form.label :search, "Search", class: "block text-sm font-medium text-gray-700" %> <%= form.text_field :search, value: params[:search], placeholder: "CIDR, Company, ASN...", class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
<%= form.label :country, "Country", class: "block text-sm font-medium text-gray-700" %> <%= form.select :country, options_for_select([["All Countries", ""]] + @top_countries.map { |c, _| [c, c] }), { selected: params[:country] }, { class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" } %>
<%= form.label :source, "Source", class: "block text-sm font-medium text-gray-700" %> <%= form.select :source, options_for_select([["All Sources", ""], "production_import", "user_created", "api_imported", "manual", "auto:scanner_detected"], params[:source]), { }, { class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" } %>
<%= form.label :flags, "Flags", class: "block text-sm font-medium text-gray-700" %>
<%= form.submit "Apply Filters", class: "inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700" %> <%= link_to "Clear", network_ranges_path, class: "ml-3 inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50" %>
<% end %>

Network Ranges

Showing <%= @network_ranges.count %> of <%= number_with_delimiter(@total_ranges) %> ranges

<% if @network_ranges.empty? %>

No network ranges found

Get started by importing network data or creating ranges manually.

<%= link_to "Add Network Range", new_network_range_path, class: "inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700" %>
<% end %>
<% if @pagy.present? %>
<%= pagy_nav(@pagy) %>
<% end %>