_vm-migrate.html 1.27 KB
Newer Older
1 2 3
{% load i18n %}
{% load sizefieldtags %}

4
<form method="POST" action="{% url "dashboard.views.vm-migrate" pk=vm.pk %}">
5 6
  {% csrf_token %}
  <ul id="vm-migrate-node-list">
7
  {% with current=vm.node.pk selected=vm.select_node.pk %}
8 9 10 11
    {% for n in nodes %}
      <li class="panel panel-default"><div class="panel-body">
        <label for="migrate-to-{{n.pk}}">
          <strong>{{ n }}</strong>
12
          {% if current == n.pk %}<div class="label label-info">{% trans "current" %}</div>{% endif %}
13
          {% if selected == n.pk %}<div class="label label-success">{% trans "recommended" %}</div>{% endif %}
14
        </label>
15
        <input id="migrate-to-{{n.pk}}" type="radio" name="node" value="{{ n.pk }}" style="float: right;"
16 17
        {% if current == n.pk %}disabled="disabled"{% endif %}
        {% if selected == n.pk %}checked="checked"{% endif %} />
18 19 20 21 22 23
        <span class="vm-migrate-node-property">{% trans "CPU load" %}: {{ n.cpu_usage }}</span>
        <span class="vm-migrate-node-property">{% trans "RAM usage" %}: {{ n.byte_ram_usage|filesize }}/{{ n.ram_size|filesize }}</span>
        <div style="clear: both;"></div>
      </div></li>
    {% endfor %}
  {% endwith %}
24 25 26
  </ul>
  <button type="submit" class="btn btn-primary btn-sm"><i class="icon-truck"></i> Migrate</button>
</form>