<div class="middle">
  <div class="netconfig">
    <div class="col">
      <div class="logo"></div>

      <div class="field not-bottom">
        <label for="mongbat_maxev">STRENGTH</label>
        <input type="hidden" name="mongbat_maxev" value="2" id="mongbat_maxev"/>
        <div class="slider"></div>
        <div class="ui-slider-legend">
          <p>1</p>
          <p class="left">2</p>
          <p class="left">3</p>
          <p class="left">4</p>
        </div>
      </div>

      <div class="inline-fields">
        <div class="field interface">
          <label for="netconfig_src_ip">INTERFACE</label><br />
          <select id="netconfig_iface" name="netconfig_iface">
            <% select_first_option = true %>
            <% @p4.interfaces.sort_by{|int|
                m = int.match(/(\w+?)(\d+)/)
                m ? [m[1], m[2].to_i] : [int, 0]
              }.each do |interface| %>
              <option <% if select_first_option %>selected="selected"<% end %>><%= interface %></option>
              <% select_first_option = false %>
            <% end %>
          </select>
        </div>
        <p class="field ip_range">
          <label for="netconfig_src_ip">EVADER IP RANGE</label><br />
          <input type="text" id="netconfig_src_ip" name="netconfig_src_ip" placeholder="10.211.55.6 - 10.211.55.12" />
        </p>          
      </div>      
    </div>
    
    <div class="col">
      <h3>DEVICE UNDER TEST</h3>
      
      <% if @config.networks.size < 2 %>
        <p class="gateway_needed_options">
          <input type="radio" name="gateway_needed" value="yes" id="gateway_needed_yes" class="gateway_needed" checked="checked" />
          <label for="gateway_needed_yes"><span></span>Next Generation Firewall Layer 3</label>
          <br />
          <input type="radio" name="gateway_needed" value="no" id="gateway_needed_no" class="gateway_needed" />
          <label for="gateway_needed_no"><span></span>Intrusion Prevention System Layer 2</label>
        </p>
      <% else %>
        <div class="presets network">
          <label for="network_presets" class="label">Network Preset</label>
          <select id="network_presets">
            <% @config.networks.each do |network| %>
              <option><%= network.name %></option>
            <% end %>
          </select>
          <div class="hidden network_presets_json">
            <%= @config.networks.map{|n|
                  {
                    :iface => n.iface, :src_ip => n.src_ip, :src_mask => n.src_mask,
                    :dst_ip => n.dst_ip, :gw => n.gw, :name => n.name
                  }
                }.to_json %>
          </div>
          <input type="hidden" name="netconfig_src_mask" id="netconfig_src_mask" />
        </div>
      <% end %>
      
      <p class="field">
        <label for="netconfig_gateway">LAYER 3 DEVICE UNDER TEST IP</label><br />
        <input type="text" id="netconfig_gateway" name="netconfig_gateway" placeholder="10.211.55.1" />          
      </p>      
    </div>
      
    <div class="col">
      <h3>TARGET SYSTEM</h3>

      <% if @config.hosts.size > 0 %>
        <div class="target presets">
          <label for="target_presets" class="label">Host Preset</label>
          <select id="target_presets">
            <% @config.hosts.each do |host| %>
              <option><%= host.name %></option>
            <% end %>
          </select>
          <div class="hidden target_presets_json">
            <%= @config.hosts.map{|h|
                  {
                    :ip_end => h.ip_end, :ipv6_end => h.ipv6_end, :name => h.name
                  }
                }.to_json %>
          </div>
        </div>
      <% end %>

      <p class="field">
        <label for="netconfig_dst_ip">TARGET IP</label><br />
        <input type="text" id="netconfig_dst_ip" name="netconfig_dst_ip" placeholder="10.211.55.5" />          
      </p>      
    </div>
  </div>
</div>

<div class="bottom">&nbsp;</div>