<div class="row form-group">
  <div class="col-sm-12 col-md-2 form-label">
    <label for="privileged" class="form-control-static">Privileged</label>
  </div>
  <div class="col-sm-12 col-md-3 form-label">
    <div class="checkbox form-control-static text-left">
      <label for="privileged">{{input type="checkbox" id="privileged" checked=instance.privileged}} Full access to the host</label>
    </div>
  </div>

  <div class="col-sm-12 col-md-2 form-label">
    <label for="pidHost" class="form-control-static">PID Mode</label>
  </div>
  <div class="col-sm-12 col-md-3 form-label">
    <div class="checkbox form-control-static text-left">
      <label for="pidHost">{{input type="checkbox" id="pidHost" checked=pidHost}} Host</label>
    </div>
  </div>
</div>

<div class="row form-group">
  <div class="col-sm-12 col-md-2 form-label">
    <label for="memoryMb" class="form-control-static">Memory Limit</label>
  </div>
  <div class="col-sm-12 col-md-3">
    <div class="input-group">
      {{input id="memoryMb" type="number" min="1" step="1" value=memoryMb classNames="form-control" placeholder="Unlimited"}}
      <div class="input-group-addon">MB</div>
    </div>
  </div>

  <div class="col-sm-12 col-md-2 form-label">
    <label for="swapMb" class="form-control-static">+ Swap Limit</label>
  </div>
  <div class="col-sm-12 col-md-3">
    <div class="input-group">
      {{input id="swapMb" type="number" min="1" step="1" value=swapMb classNames="form-control" placeholder=(if memoryMb 'Unlimited' 'Requires Memory Limit') disabled=(not memoryMb)}}
      <div class="input-group-addon">MB</div>
    </div>
  </div>
</div>

<div class="row form-group">
  <div class="col-sm-12 col-md-2 form-label">
    <label for="cpuSet" class="form-control-static">CPU Pinning</label>
  </div>


  <div class="col-sm-12 col-md-3">
    {{input id="cpuSet" type="text" value=instance.cpuSet classNames="form-control" placeholder="e.g. 0,3; Default: All"}}
  </div>
  <div class="col-sm-12 col-md-2 form-label">
    <label for="cpuShares" class="form-control-static">Shares</label>
  </div>
  <div class="col-sm-12 col-md-3">
    {{input id="cpuShares" type="number" value=instance.cpuShares step=128 min=0 classNames="form-control" placeholder="1024"}}
  </div>
</div>

<div class="row">
  <div class="col-sm-12 col-md-2 form-label">
    <label class="form-control-static">Capabilities</label>
  </div>

  <div class="col-sm-12 col-md-4">
    {{view "select" class="form-control select-cap-add" content=capabilityChoices selection=instance.capAdd multiple="true" optionValuePath="content" optionLabelPath="content"}}
  </div>

  <div class="col-sm-12 col-md-4">
    {{view "select" class="form-control select-cap-drop" content=capabilityChoices selection=instance.capDrop multiple="true" optionValuePath="content" optionLabelPath="content"}}
  </div>
</div>
<div class="row">
  <div class="col-sm-12 col-md-8 col-md-offset-2">
    <span class="help-block">
      Capabilities allow you to provide fine-grained control over superuser privileges available to the container.
      <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html" target="_blank">More information</a>
    </span>
  </div>
</div>

<div class="row">
  <div class="col-sm-12 col-md-2 form-label">
    <label class="form-control-static">Device Binding</label>
  </div>

  <div class="col-sm-12 col-md-8">
    <div class="form-control-static">
      <button class="btn-circle-plus" {{action "addDevice" target="view"}}></button>
    </div>
    {{#if devicesArray.length}}
      <table class="table fixed no-lines no-top-padding tight small">
        <tr class="text-muted">
          <th>Path in Host</th>
          <th width="30">&nbsp;</th>
          <th>Path in Container</th>
          <th width="30">&nbsp;</th>
          <th>Permissions</th>
          <th width="30">&nbsp;</th>
        </tr>
        {{#each devicesArray as |device|}}
          <tr>
            <td>
              {{input class="form-control input-sm device-host" type="text" value=device.host placeholder="e.g. /dev/sdc"}}
            </td>
            <td style="text-align: center">
              <p class="form-control-static input-sm"><i class="icon icon-arrow-right"></i></p>
            </td>
            <td>
              {{input class="form-control input-sm" type="text" value=device.container placeholder="e.g. /dev/xsdc"}}
            </td>
            <td>&nbsp;</td>
            <td>
              {{device-permissions buttonClass="btn-sm" selectionAsString=device.permissions}}
            </td>
            <td class="text-right">
              <button {{action "removeDevice" device}} class="btn-circle-x" type="button" tabindex="-1"></button>
            </td>
          </tr>
        {{/each}}
      </table>
    {{/if}}
  </div>
</div>
