resources.html 2.03 KB
Newer Older
1
{% load i18n %}
2
{% load sizefieldtags %}
3
{% load crispy_forms_tags %}
4

5 6
<form method="POST" action="{{ op.resources_change.get_url }}" id="vm-details-resources-form">
  {% csrf_token %}
7
  {% include "dashboard/_resources-sliders.html" with field_priority=resources_form.priority field_num_cores=resources_form.num_cores field_ram_size=resources_form.ram_size %}
8

9
{% if op.resources_change %}
10 11 12
    <button type="submit" class="btn btn-success btn-sm change-resources-button" 
      id="vm-details-resources-save" data-vm="{{ instance.pk }}"
      {% if op.resources_change.disabled %}disabled{% endif %}>
13 14 15
      <i class="fa fa-floppy-o"></i> {% trans "Save resources" %}
    </button>
    <span class="change-resources-help"
16
      {% if not op.resources_change.disabled %}style="display: none;"{% endif %}
17 18 19
      >{% trans "Stop your VM to change resources." %}</span>
{% endif %}
</form>
20 21 22 23


<hr />

24

25
<div class="row" id="vm-details-resources-disk">
26 27 28 29
  <div class="col-sm-11">
    <h3>
      {% trans "Disks" %}
      <div class="pull-right">
30 31
        <div id="disk-ops">
          {% include "dashboard/vm-detail/_disk-operations.html" %}
32
        </div>
33 34 35
      </div>
    </h3>

36 37 38 39 40
    <div class="row" id="vm-details-disk-add-for-form"></div>

    {% if not instance.disks.all %}
      {% trans "No disks are added!" %}
    {% endif %}
41 42
    {% for d in instance.disks.all %}
      <h4 class="list-group-item-heading dashboard-vm-details-network-h3">
43 44 45
        {% with long_remove=True %}
          {% include "dashboard/_disk-list-element.html" %}
        {% endwith %}
46 47 48 49 50
      </h4>
    {% endfor %}
  </div>
</div>

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
{% if user.is_superuser %}
<hr/>

<div class="row" id="">
  <div class="col-sm-12">
    <h3>
      {% trans "Required traits" %}
    </h3>

    {% crispy traits_form %}
  </div>
</div>

<hr/>

<div class="row" id="">
  <div class="col-sm-12">
    <h3>
      {% trans "Raw data" %}
    </h3>

    {% crispy raw_data_form %}
  </div>
</div>

{% endif %}
77

78 79 80
{% block extra_js %}
  <style>
    label {padding-top: 6px;}
81
    .form-group {margin-bottom: 8px;}
82 83
  </style>
{% endblock %}