<%= render "secondary_links" %>
<% if @ip_address %>

IP Address: <%= @ip_address.ip_addr %>

<% else %>

IP Addresses

<% end %> <%= search_form_for(ip_addresses_path) do |f| %> <%= f.input :user_id, label: "User ID", input_html: { value: params[:search][:user_id] }, hint: "Separate with spaces" %> <%= f.input :user_name, label: "User Name", input_html: { "data-autocomplete": "user", value: params[:search][:user_name] } %> <%= f.input :ip_addr, label: "IP Address", input_html: { value: params[:search][:ip_addr] }, hint: 'CIDR notation supported.'.html_safe %> <%= f.input :created_at, label: "Date", input_html: { value: params[:search][:created_at] } %> <%= f.input :model_type, label: "Source", collection: IpAddress.model_types, include_blank: true, selected: params[:search][:model_type] %> <%= f.input :group_by, label: "Group By", collection: [["User", "user"], ["IP Address", "ip_addr"]], include_blank: true, selected: params[:search][:group_by] %> <% if params[:search][:group_by] == "ip_addr" %> <%= f.input :ipv4_masklen, label: "IPv4 Subnet", collection: [["/32", 32], ["/24", 24], ["/16", 16], ["/8", 8]], include_blank: false, selected: params[:search][:ipv4_masklen], hint: "Lower to group together IPs with the same prefix." %> <%= f.input :ipv6_masklen, label: "IPv6 Subnet", collection: [["/128", 128], ["/80", 80], ["/64", 64], ["/48", 48]], include_blank: false, selected: params[:search][:ipv6_masklen] %> <% end %> <%= f.submit "Search" %> <% end %> <% if params[:search][:group_by] == "user" %> <%= render "index_by_user" %> <% elsif params[:search][:group_by] == "ip_addr" %> <%= render "index_by_ip_addr" %> <% elsif @ip_addresses.present? %> <%= render "index" %> <% end %> <%= numbered_paginator(@ip_addresses) %>