_vm-create-1.html 3.66 KB
Newer Older
1
{% load sizefieldtags %}
2
{% load i18n %}
3 4 5 6 7 8

<div class="vm-create-template-list">
  {% for t in templates %}
  <div class="vm-create-template">
    <div class="vm-create-template-summary">
      {{ t.name }}
9
      <span class="pull-right"><i class="fa fa-{{ t.os_type }}"></i> {{ t.system }}</span>
10 11 12 13
    </div>
    <div class="vm-create-template-details">
      <ul>
        <li>
14
          <i class="fa fa-gears"></i> {% trans "CPU" %}
15
          <div class="progress pull-right">
16
            <div class="progress-bar progress-bar-success" role="progressbar"
17 18 19 20 21 22
              aria-valuenow="{{ t.num_cores }}" aria-valuemin="0" aria-valuemax="8" style="width: 80%">
              <span class="progress-bar-text">{{ t.num_cores }} cores</span>
            </div>
          </div>
        </li>
        <li>
23
          <i class="fa fa-ticket"></i> {% trans "Memory" %}
24
          <div class="progress pull-right">
25 26
            <div class="progress-bar progress-bar-info" role="progressbar"
              aria-valuenow="{{ t.ram_size }}" aria-valuemin="0" aria-valuemax="4096"
27 28 29 30 31 32
              style="width: 80%">
              <span class="progress-bar-text">{{ t.ram_size }} MB</span>
            </div>
          </div>
        </li>
        <li>
33
          <i class="fa fa-file"></i> {% trans "Disks" %}
34
          <span style="float: right; text-align: right;">
35
            {% for d in t.disks.all %}{{ d.name }} ({% if d.size %}{{ d.size|filesize }}{% endif %}){% if not forloop.last %}, {% endif %}{% endfor %}
36
          </span>
37
          <div style="clear: both;"></div>
38 39
        </li>
        <li>
40
          <i class="fa fa-globe"></i> {% trans "Network" %}
41 42 43 44 45
          <span style="float: right;">
            {% for i in t.interface_set.all %}{{ i.vlan.name }}{% if not forloop.last %}, {% endif %}{% endfor %}
          </span>
        </li>
        <li>
46
          <i class="fa fa-tag"></i> {% trans "Type" %}: {{ t.lease.name }}
47
          <span style="float: right;">
48 49
            <i class="fa fa-pause"></i> {{ t.lease.get_readable_suspend_time }}
            <i class="fa fa-times"></i> {{ t.lease.get_readable_delete_time }}
50 51 52
          </span>
        </li>
        <li>
53
          <i class="fa fa-hand-right"></i> {% trans "Description" %}:
54 55 56 57 58 59 60
          <span style="float: right; max-width: 350px;">
            {{ t.description }}
          </span>
          <div class="clearfix"></div>
        </li>
      </ul>
      <div style="margin-top: 20px; padding: 0 15px; width: 100%">
61
        {% if perms.vm.set_resources %}
62
        <a class="btn btn-primary btn-xs customize-vm" data-template-pk="{{ t.pk }}" href="{% url "dashboard.views.vm-create" %}?template={{ t.pk }}"><i class="fa fa-wrench"></i> {% trans "Customize" %}</a>
63
        {% endif %}
64 65 66
        <form class="pull-right text-right" method="POST" action="{% url "dashboard.views.vm-create" %}">
          {% csrf_token %}
          <input type="hidden" name="template" value="{{ t.pk }}"/>
67
          <button class="btn btn-success btn-xs vm-create-start" data-template-pk="{{ t.pk }}" type="submit">
68
            <i class="fa fa-play"></i> {% trans "Start" %}
69
          </button>
70
        </form>
71
        <div style="clear: both;"></div>
72 73 74
      </div>
    </div>
  </div>
Kálmán Viktor committed
75
  {% empty %}
Kálmán Viktor committed
76
    {% trans "You can't start new virtual machines because no templates are shared with you." %}
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
  {% endfor %}
</div>

<style>
  .progress {
    position: relative;
    width: 200px;
    height: 12px;
    margin-bottom: 0px;
    margin-top: 5px;
  }
  .progress-bar-text {
    position: absolute;
    display: block;
    width: 100%;
    color: white;
    /* outline */
94
    text-shadow:
95 96 97
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
98
      1px 1px 0 #000;
99 100 101
    font-size: 10px;
  }
</style>