1 {% extends
"menu_base.html" %}
5 {% block title %}{%trans
"Overview" %}{% endblock %}
8 <script type=
"text/javascript" src=
"{{STATIC_URL}}/js/jquery.ajax.delete.js"></script>
9 <script type=
"text/javascript" src=
"{{STATIC_URL}}/js/jquery.tablesorter.min.js"></script>
10 <script type=
"text/javascript" src=
"{{STATIC_URL}}/js/jquery.progressbar.js"></script>
11 <script src=
"{{STATIC_URL}}/js/disableSingletonDropdown.js"
12 type=
"text/javascript"></script>
13 <script type=
"text/javascript">
14 var CLUSTER_RESOURCES_PBAR
= {
17 textFormat
: 'fraction',
18 // XXX there's issue, bars doesn't scale the progress to the given width
20 boxImage
: '{{STATIC_URL}}/images/progressbar/progressbar.gif',
22 0: '{{STATIC_URL}}/images/progressbar/progressbg_green.gif',
23 30: '{{STATIC_URL}}/images/progressbar/progressbg_yellow.gif',
24 50: '{{STATIC_URL}}/images/progressbar/progressbg_orange.gif',
25 75: '{{STATIC_URL}}/images/progressbar/progressbg_red.gif'
28 $(document
).ready(function() {
29 $("#clusters .ram, #clusters .disk").each(function(){
31 if ($this.html() != 'unknown') {
32 $this.progressBar(CLUSTER_RESOURCES_PBAR
);
35 { $this.html("<div align='center'><i>unknown</i></div>");
38 $("#clusters").tablesorter();
39 $("#errors_list table").tablesorter();
40 $("#errors_list a.clear").live("click", function(event
){
41 event
.preventDefault();
42 var row
= this.parentNode
.parentNode
;
43 $.post(this.href
, function(){
45 if($("#errors_list tr").length
==0) {
46 $("#errors_list").remove();
51 $("#usage_summary select").change(function(){
52 var val
= $(this).val();
53 $.get("{% url used_resources %}", {id
:val
}, function(html
){
54 $("#usage_summary table").replaceWith(html
);
57 $("#usage_summary select").attr("id","user_select");
65 <h1>{% trans
"Overview" %}
</h1>
67 {% if admin or create_vm %}
68 <div id=
"cluster_summary">
69 <h2>{% trans
"Cluster Status" %}
</h2>
70 <table id=
"clusters" class=
"sorted">
73 <th>{% trans
"Cluster" %}
</th>
74 <th>{% trans
"Version" %}
</th>
75 <th>{% trans
"Memory Allocated [GiB]" %}
</th>
76 <th>{% trans
"Disk Allocated [GiB]" %}
</th>
77 <th>{% trans
"Nodes" %}
</th>
78 <th>{% trans
"VMs" %}
</th>
82 {% for cluster in cluster_list %}
83 {% with cluster.info as info %}
84 <tr id=
"cluster_{{cluster.id}}">
86 {% if cluster.error %}
<div class=
"icon_error" title='{% trans
"Ganeti API Error" %}: {{cluster.error}}'
></div>{% endif %}
87 <a href=
"{% url cluster-detail cluster.slug %}">
88 {{ cluster.hostname|abbreviate_fqdn }}
92 {% if info.software_version %}
93 v{{ info.software_version }}
98 <td class=
"ram">{% cluster_memory cluster %}
</td>
99 <td class=
"disk">{% cluster_disk cluster %}
</td>
100 <td title=
"Running/All">{% format_online_nodes cluster %}
</td>
101 <td title=
"Running/All">{% format_running_vms cluster %}
</td>
105 <tr class=
"none"><td colspan=
"100%">{% trans
"No Clusters" %}
</td></tr>
112 <div id=
"vm_summary">
113 <h2>{% trans
"Virtual Machine Status" %}
</h2>
117 <th>{% trans
"Cluster" %}
</th>
118 <th>{% trans
"Running" %}
</th>
119 <th>{% trans
"Total" %}
</th>
123 {% for hostname, dict in vm_summary.items %}
126 {% if view_cluster %}
127 <a href=
"{% url cluster-detail dict.cluster__slug %}">
128 {{hostname|abbreviate_fqdn}}
131 {{hostname|abbreviate_fqdn}}
134 <td>{{dict.running}}
</td>
135 <td>{{dict.total}}
</td>
138 <tr><td colspan=
"100%" class=
"none">{% trans
"You do not have access to any virtual machines" %}
</td></tr>
144 <div id=
"usage_summary">
145 <h2>{% trans
"Resource Usage" %}:
148 {% for persona in personas %}
149 <option value=
"{{persona.clusteruser_ptr_id}}">{{persona.name}}
</option>
154 {% include
"ganeti/overview/used_resources.html" %}
157 {% if orphaned or import_ready or missing %}
158 <div id=
"administration">
159 <h2>{% trans
"Administration" %}
</h2>
160 <table style=
"width: auto;">
163 <th>Orphaned VMs
</th>
164 <td><a href=
"{% url import-orphans %}">{% trans
"Adopt" %} {{ orphaned }}
</a></td>
168 {% if import_ready %}
170 <th>{% trans
"VMs ready to import" %}
</th>
171 <td><a href=
"{% url import-missing_db %}">{% trans
"Import" %} {{ import_ready }}
</a></td>
177 <th>{% trans
"VMs missing from ganeti" %}
</th>
178 <td><a href=
"{% url import-missing %}">{% trans
"Remove" %} {{ missing }}
</a></td>