summaryrefslogtreecommitdiff
path: root/horizon/horizon/dashboards/nova/templates/nova/instances/_list.html
blob: 52e5180b7c0bad73f9338582154a27f85218a7ca (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
<!-- TODO(termie): move most of this to horizon -->
{% load sizeformat %}
{%load i18n%}
<table id='instances' class="wide">
  <tr id='headings'>
    <th>{% trans "ID"%}</th>
    <th>{% trans "Name"%}</th>
    <th>{% trans "Groups"%}</th>
    <th>{% trans "Image"%}</th>
    <th>{% trans "Size"%}</th>
    <th>{% trans "IPs"%}</th>
    <th>{% trans "State"%}</th>
    <th>{% trans "Actions"%}</th>
  </tr>
  <tbody class='main'>
    {% for instance in instances %}
      <tr class="{% cycle 'odd' 'even' %}">
          <td>{{instance.id}}</td>
          <td class="name">
            <a href="{% url horizon:nova:instances:detail instance.id %}">
              {{instance.name}}
              {% if instance.attrs.key_name %}
                  <br/>
                  <small> ({{instance.attrs.key_name}}) </small>
              {% endif %}
            </a>
          </td>
          <td>
            <ul>
              {% for group in instance.attrs.security_groups %}
                <li>{{group}}</li>
              {% endfor %}
            <ul>
          </td>
          <td>{{instance.image_name}}</td>
          <td>
            <ul>
              <li>{{instance.attrs.memory_mb|mbformat}} Ram</li>
              <li>{{instance.attrs.vcpus}} VCPU</li>
              <li>{{instance.attrs.disk_gb}}GB Disk</li>
            </ul>
          </td>
          <td class="ip_list">
            {% for ip_group, addresses in instance.addresses.items %}
              {% if instance.addresses.items|length > 1 %}
              <h4>{{ip_group}}</h4>
              <ul>
                {% for address in addresses %}
                  <li>{{address.addr}}</li>
                {% endfor %}
              </ul>
              {% else %}
              <ul>
                {% for address in addresses %}
                  <li>{{address.addr}}</li>
                {% endfor %}
              </ul>
              {% endif %}
            {% endfor %}
          </td>
          <td>{{instance.status|lower|capfirst}}</td>
          <td id="actions">
            <ul>
              <li class="form">{% include "horizon/common/instances/_terminate.html" with form=terminate_form %}</li>
              <li class="form">{% include "horizon/common/instances/_reboot.html" with form=reboot_form %}</li>
              <li><a target="_blank" href="{% url horizon:nova:instances:console instance.id %}">{% trans "Log"%}</a></li>
              <li><a target="_blank" href="{% url horizon:nova:instances:vnc instance.id %}">{% trans "VNC Console"%}</a></li>
              <li><a href="{% url horizon:nova:instances:update instance.id %}">{% trans "Edit"%}</a></li>
              <li><a href="{% url horizon:nova:snapshots:create instance.id %}">{% trans "Snapshot"%}</a></li>
            </ul>
        </td>
      </tr>
    {% endfor %}
  </tbody>
</table>