Statistics
| Branch: | Tag: | Revision:

root / templates / instance.html @ 064ecc91

History | View | Annotate | Download (3 kB)

1
{% extends "base.html" %}
2
{% load i18n %}
3
{% block title %}{{ instance.name }} on {{ instance.cluster.description }}{% endblock %}
4
{% block extrahead %}
5
<style type="text/css">
6
                #toolbar {
7
                padding: 10px 4px;
8
        }
9

    
10
</style>
11
<script type="text/javascript">
12
var polltimer;
13
var timer = 2500;
14
var load_data = function () {
15
        $.ajax({
16
            type: 'GET',
17
            url: '{% url instance-poll cluster.slug instance.name %}',
18
            dataType: 'html',
19
            success: function(data) {
20
                $('#actions_container').html(data);
21
                                if ($('#show_no_actions').size()==1){
22
                                        $('#conf_form').hide();
23
                                }else if ($('#show_no_actions').size()==0){
24
                                        $('#conf_form').show();
25
                                }
26
                                $("#status").html($("#instance_status").html());
27
                polltimer = setTimeout(load_data, timer);
28
            }
29
        });
30
    }
31
$(function() {
32
    load_data();
33
});
34

    
35
</script>
36
{% endblock %}
37

    
38
{% block breadcrumbs %}:: {{ instance.name }} {% endblock %}
39

    
40
{% block content %}
41
{% load disksizes %}
42

    
43

    
44
<h3>{{ instance.name }}</h3>
45
<div id="fl_l">
46
<table class="instance_det_table">
47
<tr><th class="table_top_header" colspan=2>{% trans "Details" %}</th></tr>
48
<tr><td class="table_title">{% trans "Status" %}</td><td id="status"></td></tr>
49
<tr><td class="table_title">{% trans "Cluster" %}</td><td>{{ instance.cluster.description }}</td></tr>
50
<tr><td class="table_title">{% trans "Memory" %}</td><td>{{ instance.beparams.memory|memsize }}</td></tr>
51
<tr><td class="table_title">{% trans "CPUs" %}</td><td>{{ instance.beparams.vcpus }}</td></tr>
52
<tr><td class="table_title">Hard disk{{ instance.disk_sizes|pluralize }}</td><td>{{ instance.disk_sizes|disksizes|join:", " }}</td></tr>
53
<tr><td class="table_title">{% trans "Network cards" %}</td><td>{{ instance.nic_macs|length }}</td></tr>
54
<tr><td class="table_title">MAC address{{ instance.nic_macs|pluralize:"es" }}</td><td>{{ instance.nic_macs|join:", " }}</td></tr>
55
{% if instance.nic_ips %}
56
<tr><td class="table_title">IP address{{ instance.nic_ips|pluralize:"es" }}</td><td>{{ instance.nic_ips|join:", " }}</td></tr>
57
{% endif %}
58
<tr><td class="table_title">{% trans "Created on" %}</td><td>{{ instance.ctime|date }}</td></tr>
59
<tr><td class="table_title">{% trans "Last modified" %}</td><td>{{ instance.mtime|date }}</td></tr>
60
</table>
61
</div>
62

    
63

    
64
<div id="configuration">
65

    
66
<form method="post" align="center" id="conf_form">
67
{% csrf_token %}
68
<table class="conf_table">
69
        <tr><th colspan="2" style="text-align:center;" class="table_topper_header">{% trans "Configuration" %}</th></tr>
70
{{ configform.as_table }}
71
<tr><td colspan="2" style="text-align:center; padding: 5px;" ><input style="font-size: 12px;" id="update" type="Submit" value="Update" /></td></tr>
72

    
73
</table>
74

    
75
</form>
76

    
77
<table class="actions_table">
78
<tr><th class="table_top_header" colspan=3 style="text-align: center;">{% trans "Actions" %}</th></tr>
79
<tr>
80
        <td id="actions_container">&nbsp;</td>
81
                <!-- Here a setTimeout jquery script populates the instance control every 5 seconds -->
82
</tr>
83
</table>
84
</div>
85

    
86
{% endblock %}