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

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

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