Merge branch 'develop' into feature/search_autocomplete_haste
[ganeti_webmgr.git] / ganeti / templates / virtual_machine / inner_table.html
blob6d94496aa9aeaae329a147f08fa2c3922c33b7b3
1 {% load webmgr_tags %}
2 {% load i18n %}
3 <table id="vmlist" class="sorted">
4 <thead>
5 <tr>
6 <th class="status" order_by="status"></th>
7 <th order_by="hostname">{% trans "Name" %}</th>
8 {% if not cluster %}
9 <th order_by="cluster__hostname">{% trans "Cluster" %}</th>
10 {% endif %}
11 <th order_by="cluster__hostname">{% trans "Node" %}</th>
12 <th order_by="operating_system">{% trans "OS" %}</th>
13 <th order_by="ram">{% trans "RAM" %}</th>
14 <th order_by="disk_size">{% trans "Disk Space" %}</th>
15 <th order_by="virtual_cpus">{% trans "vCPUs" %}</th>
16 </tr>
17 </thead>
18 <tbody id="vms">
19 {% for vm in vms.object_list %}
20 {% if not vm.deleted %}
21 {% with vm.info as info %}
22 <tr>
23 <td class="status">
24 {% if vm.error %}
25 <div class="icon_error" title="{% trans "Ganeti API Error" %}: {{vm.error}}, last status was {{ vm.status|render_instance_status }}"></div>
26 {% else %}
27 {% if vm.pending_delete %}
28 <div class="icon_deleting" title="delete in progress"></div>
29 {% else %}
30 {% if info.admin_state %}
31 {% if info.oper_state %}
32 <div class="icon_running" title="running"></div>
33 {% else %}
34 <div class="icon_error" title="{{ vm.status|render_instance_status }}"></div>
35 {% endif %}
36 {% else %}
37 {% if info.oper_state %}
38 <div class="icon_error" title="{{ vm.status|render_instance_status }}"></div>
39 {% else %}
40 <div class="icon_stopped" title="stopped"></div>
41 {% endif %}
42 {% endif %}
43 {% endif %}
44 {% endif %}
45 </td>
47 <td class="name">
48 <a href="{% url instance-detail vm.cluster.slug vm.hostname %}">
49 {{ vm.hostname }}
50 </a>
51 </td>
52 {% if not cluster %}
53 <td>
54 {% if view_cluster %}
55 <a href="{% url cluster-detail vm.cluster.slug %}">
56 {{ vm.cluster|abbreviate_fqdn }}
57 </a>
58 {% else %}
59 {{ vm.cluster|abbreviate_fqdn }}
60 {% endif %}
61 </td>
62 {% endif %}
63 <td>{{ info.pnode|abbreviate_fqdn }}</td>
64 <td>{{ vm.operating_system|render_os }}</td>
65 <td>{{ vm.ram|render_storage }}</td>
66 <td>{{ vm.disk_size|render_storage }}</td>
67 <td>{{ vm.virtual_cpus }}</td>
68 {% endwith %}
69 {% endif %}
70 {% empty %}
71 <tr class="none"><td colspan="100%">{% trans "No Virtual Machines" %}</td></tr>
72 {% endfor %}
73 </tbody>
74 </table>
76 <ul class="pagination">
77 {% if vms.has_previous %}
78 <li class="previous">
79 <a href="{% url virtualmachine-table %}?page={{ vms.previous_page_number }}">&laquo; {% trans "Previous" %}</a>
80 </li>
81 {% endif %}
83 {% for page in vms.paginator.page_range %}
84 <li class="{%if page == vms.number%}active{%endif%} page">{{ page }}</li>
85 {% endfor %}
87 {% if vms.has_next %}
88 <li class="next">
89 <a href="{% url virtualmachine-table %}?page={{ vms.next_page_number }}">{% trans "Next" %} &raquo;</a>
90 </li>
91 {% endif %}
92 </ul>