node-create.html 5.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
<style>
  .row {
    margin-bottom: 15px;
  }
</style>
<form method="POST" action="/dashboard/vm/create/">
{% csrf_token %}
<div class="row">
  <div class="col-sm-10">
  <select class="select form-control" id="vm-create-template-select" name="template-pk">
    <option value="-1">Choose a VM template</option>
    {% for template in templates %}
      <option value="{{ template.pk }}">{{ template.name}}</option>
    {% endfor %}
  </select>
  </div>
</div> 

<div class="row">
  <div class="col-sm-5">
    <a class="btn btn-info vm-create-advanced-btn">Advanced <i class="vm-create-advanced-icon icon-caret-down"></i></a>
  </div>
  <div class="col-sm-5 text-right">
    <button id="vm-create-submit" type="submit" class="btn btn-success "><i class="icon-play"></i> Start</button>
  </div>
</div>

<div class="vm-create-advanced">
  <div class="row">
    <div class="col-sm-12">
      <h2>Resources</h2>
    </div>
    <p class="row">
      <div class="col-sm-3">
        <label for="vm-cpu-priority-slider"><i class="icon-trophy"></i> CPU priority</label>
      </div>
      <div class="col-sm-9">
        <input name="cpu-priority" type="text" id="vm-cpu-priority-slider" class="vm-slider" value="20" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="20" data-slider-orientation="horizontal" data-slider-handle="square" data-slider-tooltip="hide"/>    
      </div>
    </p>

    <p class="row">
      <div class="col-sm-3">
        <label for="cpu-count-slider"><i class="icon-cogs"></i> CPU count</label>
      </div>
      <div class="col-sm-9">
        <input name="cpu-count" type="text" id="vm-cpu-count-slider" class="vm-slider" value="2" data-slider-min="0" data-slider-max="8" data-slider-step="1" data-slider-value="2" data-slider-orientation="horizontal" data-slider-handle="square" data-slider-tooltip="hide"/>         
      </div>
    </p>

    <p class="row">
      <div class="col-sm-3">
        <label for="ram-slider"><i class="icon-ticket"></i> RAM amount</label>
      </div>
      <div class="col-sm-9">
        <input name="ram-size" type="text" id="vm-ram-size-slider" class="vm-slider" value="512" data-slider-min="128" data-slider-max="4096" data-slider-step="128" data-slider-value="512" data-slider-orientation="horizontal" data-slider-handle="square" data-slider-tooltip="hide"/> MiB  
      </div>
    </p>
  </div>

  <!-- disk -->
  <div class="row">
    <div class="col-sm-4">
      <h2>Disks</h2>
    </div>
    <div class="col-sm-8" style="padding-top: 3px;">
      <div class="js-hidden" style="padding-top: 15px; max-width: 450px;">
        <select class="form-control" id="vm-create-disk-add-form" multiple name="disks">
          {% for d in disks %}
            <option value="{{ d.pk }}">{{ d.name }}</option>
          {% endfor %}
        </select>
      </div>
      <div class="no-js-hidden">
        <h3 id="vm-create-disk-list">
          No disks are added!
        </h3>
        <h3 id="vm-create-disk-add">
          <div class="input-group" style="max-width: 330px;">
            <select class="form-control" id="vm-create-disk-add-select">         
              <!-- options should be copied via js from above -->
            </select>
            <div class="input-group-btn">
              <!--<input type="submit" value="Add to network" class="btn btn-success"/>-->
              <a href="#" id="vm-create-disk-add-button" class="btn btn-success"><i class="icon-plus-sign"></i></a>
            </div>
          </div>
        </h3>
      </div>
    </div>
  </div>

  <!-- network -->
  <div class="row">
    <div class="col-sm-4">
      <h2>Network</h2> 
    </div>
    <style>
      /* temporary inline css for dev */
      a.hover-black {
        color:white;
      }

      .hover-black:hover {
        color: black /*#d9534f*/;
        text-decoration: none;
      }

      .no-js-hidden {
        display: none;
      }
    </style>
    <div class="col-sm-8" style="padding-top: 3px;">
      <div class="js-hidden" style="padding-top: 15px; max-width: 450px;">
        <h4>Managed networks</h4>
        <select class="form-control" id="vm-create-network-add-managed" multiple name="managed-vlans">
          {% for v in vlans %}
            <option value="{{ v.pk }}">{{ v.name }}</option>
          {% endfor %}
        </select>

        <h4>Unmanaged networks</h4>
        <select class="form-control" id="vm-create-network-add-unmanaged" multiple name="unmanaged-vlans">
          {% for v in vlans %}
            <option value="{{ v.pk }}">{{ v.name }}</option>
          {% endfor %}
        </select>
      </div>
      <div class="no-js-hidden">
        <h3 id="vm-create-network-list">
          Not added to any network!
        </h3>
        <h3 id="vm-create-network-add">
          <div class="input-group" style="max-width: 330px;">
            <select class="form-control" id="vm-create-network-add-select">         
              <!-- options should be copied via js from above -->
            </select>
            <span class="input-group-addon">
              <input id="vm-create-network-add-checkbox-managed" type="checkbox" title data-original-title="Managed network?" style="-webkit-transform: scale(1.4, 1.4); margin-top: 4px;" checked/>
            </span>
            <div class="input-group-btn">
              <!--<input type="submit" value="Add to network" class="btn btn-success"/>-->
              <a href="#" id="vm-create-network-add-button" class="btn btn-success"><i class="icon-plus-sign"></i></a>
            </div>
          </div>
        </h3>
      </div>
    </div>
  </div>
</div>
</form>