summaryrefslogtreecommitdiff
path: root/django-nova/src/django_nova/templates/django_nova/volumes/index.html
blob: 2f03a06682b0dec74decccc3d82ebe27d1aa9130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{% extends "django_nova/volumes/base.html" %}

{% block title %} - Cloud Computing{% endblock %}

{% block content %}
  <div id="page_head">
    <h2 id="page_heading">Volumes</h2>
    <p id="page_description">Volumes provide persistent block storage. Creating a new volume gives you a raw block device which you may format with your choice of filesystems (ext3 is recommended). A volume may only be attached to a single instance at a time.</p>
  </div>

  {% include "django_nova/_messages.html" %}

  {% if volumes %}
  <table style="width: 100%">
    <tr>
      <th>ID</th>
      <th>Size</th>
      <th colspan="2">Status</th>
    </tr>
    {% for volume in volumes %}
      <tr class="{% cycle 'odd' 'even' %}">
        <td id="volume_{{ volume.id }}">{{ volume.id }} {{ volume.displayName }}</td>
        <td id="volume_{{ volume.id }}_size" class="odd">{{ volume.size }}GB</td>
        <td id="volume_{{ volume.id }})_status">
          {% if volume.status == "in-use" %}
            {% if volume.attachment_state == "attached" %}
            attached: {{ volume.attach_data.instance_id }}
            {% else %}
            {{ volume.attachment_state }}
            {% endif %}
          {% else %}
            {{ volume.status }}
          {% endif %}
        </td>
        {% if volume.attachment_state == "attached" %}
          <td class="odd">
            <form class="volume" action="{% url nova_volumes_detach project.projectname volume.id %}" method="post">
              {% csrf_token %}
              <input id="detach_{{ volume.id }}" class="detach" type="submit" value="Detach">
             </form>
           </td>
        {% else %}
          <td class="odd">
            <form class="volume" action="{% url nova_volumes_delete project.projectname volume.id %}" method="post">
              {% csrf_token %}
              <input id="delete_{{ volume.id }}" class="delete" type="submit" value="Delete">
             </form>
           </td>
        {% endif %}
      </tr>
    {% endfor %}
  </table>
  {% else %}
  <div class="ui-widget">
    <div class="ui-state-highlight ui-corner-all">
      <p>
        <span class="ui-icon ui-icon-info"></span>
        No volumes currently exist.
      </p>
    </div>
  </div>
  {% endif %}
  <div class="dash_block first">
    <form id="new_volume_form" method="post" action="{% url nova_volumes_add project.projectname %}">
      {% csrf_token %}
      <fieldset>
        <h3>Create New Volume</h3>
        {% include "django_nova/volumes/_create_form.html" %}
        <input id="create_volume" class="create" type="submit" value="Create" />
      </fieldset>
    </form>
  </div>

  <div class="dash_block">
    <form id="new_volume_form" method="post" action="{% url nova_volumes_attach project.projectname %}">
      {% csrf_token %}
      <fieldset>
        <h3>Attach Volume</h3>
        {% include "django_nova/volumes/_attach_form.html" %}
        <input id="attach_volume" class="attach" type="submit" value="Attach" />
      </fieldset>
    </form>
  </div>
{% endblock %}