Statistics
| Branch: | Tag: | Revision:

root / templates / cluster.html @ 064ecc91

History | View | Annotate | Download (2.2 kB)

1
{% extends "base.html" %}
2
{% block extrahead %}
3
<script type="text/javascript" src="/static/js/jquery.dataTables.js"></script>
4
<script type="text/javascript">
5
        $(document).ready( function(){
6
                        $('#vm_instance_table').dataTable( {
7
                        "bJQueryUI": true,
8
                        "oLanguage": {
9
                                "sLengthMenu": 'Display <select><option value="25">25</option><option value="50">50</option><option value="-1">All</option></select> instances'
10
                        },
11
                        "iDisplayLength": 25,
12
        } );
13
                });
14
</script>
15
{% endblock %}
16
{% block title %}{{ object.hostname|safe }}{% endblock %}
17
{% block content %}
18

    
19
<h3>Cluster {{ object.hostname }}</h3>
20

    
21
<table class="display" width="100%" id="vm_instance_table">
22
<thead>
23
<tr><th>Name</th><th>Primary node</th>
24
<th>Memory</th><th>Current memory</th><th>Status</th></tr>
25
</thead>
26
<tbody>
27
{% for instance in object.get_instances %}
28
{% for myuser in instance.users %}
29
{% ifequal myuser user %}
30

    
31
<tr {% if  %} class="GradeA" {% else %} class="GradeX" {% endif %}><td><a href="{% url instance-detail object.slug instance.name %}">{{ instance.name }}</a></td>
32
<td>{{ instance.pnode }}</td><td>{{ instance.beparams.memory }}</td><td>{{ instance.oper_ram }}</td>
33
<td>{% ifequal instance.admin_state instance.oper_state %}
34
{{ instance.admin_state|yesno:"Running,Stopped" }}
35
{% else %}
36
{{ instance.oper_state|yesno:"Running,Stopped" }}, should be {{ instance.admin_state|yesno:"running,stopped" }}
37
{% endifequal %}
38
</td></tr>
39

    
40
{% endifequal %}
41
{% endfor %}
42
{% endfor %}
43
</tbody>
44
</table>
45
{% with object.get_cluster_info as info %}
46
<table class="instances_table" width="35%">
47
<tr><th class="table_top_header" colspan=2>Cluster Details</th></tr>
48
<tr><td class="table_title">Architecture</td><td>{{ info.architecture.0 }}</td></tr>
49
<tr><td class="table_title">Default hypervisor</td><td>{{ info.default_hypervisor }}</td></tr>
50
<tr><td class="table_title">Available hypervisors</td><td>{{ info.enabled_hypervisors|join:", " }}</td></tr>
51
<tr><td class="table_title">Master node</td><td>{{ info.master }}</td></tr>
52
<tr><td class="table_title">Created</td><td>{% if info.ctime %}{{ info.ctime|date }}{% else %}<em>unknown</em>{% endif %}</td></tr>
53
<tr><td class="table_title">Last modified</td><td>{{ info.mtime|date }}</td></tr>
54
</table>
55
{% endwith %}
56

    
57
{% endblock %}