<commit_before><% var networkName = network.get('name') %>
<legend class="networks"><%- networkName != 'fixed' ? networkName : 'VM Networks (Fixed)' %></legend>

<% var disabled = locked ? 'disabled' : '' %>
<% var vlanManager = net_manager == 'VlanManager' ? '' : 'hide' %>
<% var labels = {
  'ip_ranges': 'IP Range',
  'vlan_start': 'VLAN ID',
  'netmask': 'Netmask',
  'gateway': 'Gateway',
  'cidr': 'CIDR',
  'amount': 'Number of Networks',
  'network_size': 'Size of Networks',
  'vlan_range': 'VLAN ID range'
} %>

<div data-network-id="<%- network.id %>" class="<%- networkName %>">
  <% var shownAttributes = network.getAttributes() %>
  <% var attributes = _.sortBy(_.keys(network.attributes), function(attribute) {return _.indexOf(shownAttributes, attribute)}) %>
  <% _.each(attributes, function(attribute) { %>
    <div class="network-attribute">
    <% var hidden = _.contains(shownAttributes, attribute) ? '' : 'hide' %>
    <% if (attribute == 'ip_ranges') { %>
      <div class="range-row-header <%= hidden %>">
        <div>Start</div><div>End</div>
      </div>
      <div class="networks-sub-title parameter-name range-name <%= hidden %>"><%= labels[attribute] %></div>
      <% _.each(network.get(attribute), function(ip_range) { %>
        <div class="range-row ip-range-row clearfix <%= hidden %>">
          <label class="parameter-box clearfix setting">
            <div class="parameter-control <%- attribute %>">
              <input type="text" name="<%- attribute %>-start" placeholder="127.0.0.1" value="<%- _.first(ip_range) %>" <%= disabled %> />
            </div>
          </label>
          <label class="parameter-box clearfix setting">
          <div class="parameter-control <%- attribute %>">
            <input type="text" name="<%- attribute %>-end" placeholder="127.0.0.1" value="<%- _.last(ip_range) %>" <%= disabled %> />
          </div>
          </label>
          <div class="ip-ranges-control">
            <button class="btn btn-link ip-ranges ip-ranges-add <%= disabled %>"><i class="icon-plus-circle"></i></button>
          </div>
          <div class="ip-ranges-control <%= network.get(attribute).length > 1 ? '' : 'hide' %>">
            <button class="btn btn-link ip-ranges ip-ranges-delete <%= disabled %>"><i class="icon-minus-circle"></i></button>
          </div>
          <div class="error"><span class="help-inline"></span></div>
        </div>
      <% }) %>
    <% } else if (_.contains(['netmask', 'gateway', 'cidr', 'amount'], attribute)) { %>
        <label class="parameter-box clearfix setting <%= hidden %> <%= vlanManager && attribute == 'amount' ? 'hide' : '' %>">
          <div class="networks-sub-title parameter-name"><%= labels[attribute] %></div>
          <div class="parameter-control <%- attribute %>">
            <input type="text" class="<%= !vlanManager && attribute == 'amount' ? 'range' : '' %>" name="<%- networkName %>-<%- attribute %>" value="<%- network.get(attribute) %>" <%= disabled %> />
          </div>
          <div class="error"><span class="help-inline"></span></div>
        </label>
    <% } else if (attribute == 'vlan_start') { %>
      <% if (networkName == 'fixed' && !vlanManager) { %>
        <div class="range-row-header mini <%= hidden %>">
          <div>Start</div><div>End</div>
        </div>
        <label class="parameter-box clearfix setting">
          <div class="networks-sub-title parameter-name"><%= labels.vlan_range %></div>
          <div class="range-row">
            <div class="parameter-control vlan_start">
              <input type="text" class="mini range" name="fixed-vlan_range-start" value="<%- network.get('vlan_start') %>" <%= disabled %> />
            </div>
            <div class="parameter-control vlan_end">
              <input type="text" class="mini" name="fixed-vlan_range-end" value="<%= network.get('vlan_start') + network.get('amount') - 1 %>" disabled />
            </div>
            <div class="error"><span class="help-inline"></span></div>
          </div>
        </label>
      <% } else { %>
        <% var vlan = network.get(attribute) %>
        <% var isFloating = networkName == 'floating' ? 'disabled' : '' %>
        <div class="networks-sub-title parameter-name">Use VLAN Tagging</div>
        <div class="range-row clearfix" style="height: 40px">
          <label class="parameter-box clearfix setting">
            <div class="parameter-control" style="width: 106px">
              <div class="custom-tumbler">
                <input type="checkbox" class="use-vlan-tagging" <%= _.isNull(vlan) ? '' : 'checked' %> <%= isFloating || disabled %>>
                <!-- [if !IE |(gte IE 9)]> --><span>&nbsp;</span><!-- <![endif] -->
              </div>
            </div>
          </label>
          <label class="parameter-box clearfix setting">
            <div class="parameter-control <%- attribute %>" <%= _.isNull(vlan) ? 'style="display:none"' : '' %>>
              <input type="text" value="<%- _.isNull(vlan) ? '' : vlan %>" name="<%- networkName %>-<%- attribute %>" class="input-small" <%= isFloating || disabled %>>
            </div>
          </label>
          <div class="error"><span class="help-inline"></span></div>
        </div>
      <% } %>
    <% } else if (attribute == 'network_size') { %>
      <label class="parameter-box clearfix setting <%= hidden %> <%= vlanManager %>">
        <div class="networks-sub-title parameter-name"><%= labels[attribute] %></div>
        <div class="parameter-control <%- attribute %>">
          <select name="<%- networkName %>-<%- attribute %>" <%= disabled %>>
            <% _.each([4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048], function(size) { %>
              <option value="<%= size %>" <%= network.get('network_size') == size ? 'selected' : '' %>><%= size %></option>
            <% }) %>
          </select>
        </div>
        <div class="error"><span class="help-inline"></span></div>
      </label>
    <% } %>
    </div>
  <% }) %>
</div><commit_msg>Network size in VLAN mode starts from 4<commit_after><% var networkName = network.get('name') %>
<legend class="networks"><%- networkName != 'fixed' ? networkName : 'VM Networks (Fixed)' %></legend>

<% var disabled = locked ? 'disabled' : '' %>
<% var vlanManager = net_manager == 'VlanManager' ? '' : 'hide' %>
<% var labels = {
  'ip_ranges': 'IP Range',
  'vlan_start': 'VLAN ID',
  'netmask': 'Netmask',
  'gateway': 'Gateway',
  'cidr': 'CIDR',
  'amount': 'Number of Networks',
  'network_size': 'Size of Networks',
  'vlan_range': 'VLAN ID range'
} %>

<div data-network-id="<%- network.id %>" class="<%- networkName %>">
  <% var shownAttributes = network.getAttributes() %>
  <% var attributes = _.sortBy(_.keys(network.attributes), function(attribute) {return _.indexOf(shownAttributes, attribute)}) %>
  <% _.each(attributes, function(attribute) { %>
    <div class="network-attribute">
    <% var hidden = _.contains(shownAttributes, attribute) ? '' : 'hide' %>
    <% if (attribute == 'ip_ranges') { %>
      <div class="range-row-header <%= hidden %>">
        <div>Start</div><div>End</div>
      </div>
      <div class="networks-sub-title parameter-name range-name <%= hidden %>"><%= labels[attribute] %></div>
      <% _.each(network.get(attribute), function(ip_range) { %>
        <div class="range-row ip-range-row clearfix <%= hidden %>">
          <label class="parameter-box clearfix setting">
            <div class="parameter-control <%- attribute %>">
              <input type="text" name="<%- attribute %>-start" placeholder="127.0.0.1" value="<%- _.first(ip_range) %>" <%= disabled %> />
            </div>
          </label>
          <label class="parameter-box clearfix setting">
          <div class="parameter-control <%- attribute %>">
            <input type="text" name="<%- attribute %>-end" placeholder="127.0.0.1" value="<%- _.last(ip_range) %>" <%= disabled %> />
          </div>
          </label>
          <div class="ip-ranges-control">
            <button class="btn btn-link ip-ranges ip-ranges-add <%= disabled %>"><i class="icon-plus-circle"></i></button>
          </div>
          <div class="ip-ranges-control <%= network.get(attribute).length > 1 ? '' : 'hide' %>">
            <button class="btn btn-link ip-ranges ip-ranges-delete <%= disabled %>"><i class="icon-minus-circle"></i></button>
          </div>
          <div class="error"><span class="help-inline"></span></div>
        </div>
      <% }) %>
    <% } else if (_.contains(['netmask', 'gateway', 'cidr', 'amount'], attribute)) { %>
        <label class="parameter-box clearfix setting <%= hidden %> <%= vlanManager && attribute == 'amount' ? 'hide' : '' %>">
          <div class="networks-sub-title parameter-name"><%= labels[attribute] %></div>
          <div class="parameter-control <%- attribute %>">
            <input type="text" class="<%= !vlanManager && attribute == 'amount' ? 'range' : '' %>" name="<%- networkName %>-<%- attribute %>" value="<%- network.get(attribute) %>" <%= disabled %> />
          </div>
          <div class="error"><span class="help-inline"></span></div>
        </label>
    <% } else if (attribute == 'vlan_start') { %>
      <% if (networkName == 'fixed' && !vlanManager) { %>
        <div class="range-row-header mini <%= hidden %>">
          <div>Start</div><div>End</div>
        </div>
        <label class="parameter-box clearfix setting">
          <div class="networks-sub-title parameter-name"><%= labels.vlan_range %></div>
          <div class="range-row">
            <div class="parameter-control vlan_start">
              <input type="text" class="mini range" name="fixed-vlan_range-start" value="<%- network.get('vlan_start') %>" <%= disabled %> />
            </div>
            <div class="parameter-control vlan_end">
              <input type="text" class="mini" name="fixed-vlan_range-end" value="<%= network.get('vlan_start') + network.get('amount') - 1 %>" disabled />
            </div>
            <div class="error"><span class="help-inline"></span></div>
          </div>
        </label>
      <% } else { %>
        <% var vlan = network.get(attribute) %>
        <% var isFloating = networkName == 'floating' ? 'disabled' : '' %>
        <div class="networks-sub-title parameter-name">Use VLAN Tagging</div>
        <div class="range-row clearfix" style="height: 40px">
          <label class="parameter-box clearfix setting">
            <div class="parameter-control" style="width: 106px">
              <div class="custom-tumbler">
                <input type="checkbox" class="use-vlan-tagging" <%= _.isNull(vlan) ? '' : 'checked' %> <%= isFloating || disabled %>>
                <!-- [if !IE |(gte IE 9)]> --><span>&nbsp;</span><!-- <![endif] -->
              </div>
            </div>
          </label>
          <label class="parameter-box clearfix setting">
            <div class="parameter-control <%- attribute %>" <%= _.isNull(vlan) ? 'style="display:none"' : '' %>>
              <input type="text" value="<%- _.isNull(vlan) ? '' : vlan %>" name="<%- networkName %>-<%- attribute %>" class="input-small" <%= isFloating || disabled %>>
            </div>
          </label>
          <div class="error"><span class="help-inline"></span></div>
        </div>
      <% } %>
    <% } else if (attribute == 'network_size') { %>
      <label class="parameter-box clearfix setting <%= hidden %> <%= vlanManager %>">
        <div class="networks-sub-title parameter-name"><%= labels[attribute] %></div>
        <div class="parameter-control <%- attribute %>">
          <select name="<%- networkName %>-<%- attribute %>" <%= disabled %>>
            <% _.each([8, 16, 32, 64, 128, 256, 512, 1024, 2048], function(size) { %>
              <option value="<%= size %>" <%= network.get('network_size') == size ? 'selected' : '' %>><%= size %></option>
            <% }) %>
          </select>
        </div>
        <div class="error"><span class="help-inline"></span></div>
      </label>
    <% } %>
    </div>
  <% }) %>
</div>
{'fraction_non_alphanumeric': 0.21733344423188888, 'fraction_numerical': 0.0074856524993761955, 'mean_word_length': 2.680440771349862, 'pattern_counts': {'":': 0, '<': 377, '<?xml version=': 0, '>': 379, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6637690', 'n_tokens_mistral': 3966, 'n_tokens_neox': 3585, 'n_words': 761}