resources.html 1.89 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

<hr />

23 24 25 26 27
<div id="vm-details-resources-disk">
  <h3>
    <div class="pull-right">
      <div id="disk-ops">
        {% include "dashboard/vm-detail/_disk-operations.html" %}
28
      </div>
29
    </div>
30
    {% trans "Disks" %}
31 32 33 34 35 36 37 38 39 40 41 42
  </h3>

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

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
{% 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 %}
71

72 73 74
{% block extra_js %}
  <style>
    label {padding-top: 6px;}
75
    .form-group {margin-bottom: 8px;}
76 77
  </style>
{% endblock %}