1 {% extends
"menu_base.html" %}
2 {% block title %}Cluster {{ cluster.id }}: {{ cluster.hostname|safe }}{% endblock %}
5 <link href=
"{{MEDIA_URL}}/css/jquery-ui.css" rel=
"stylesheet" type=
"text/css"/>
6 <script type=
"text/javascript" src=
"{{MEDIA_URL}}/js/jquery.ajax.delete.js"></script>
7 <script src=
"{{MEDIA_URL}}/js/jquery-ui.min.js"></script>
8 <script src=
"{{MEDIA_URL}}/js/jquery.progressbar.js"></script>
9 <script type=
"text/javascript">
13 textFormat
: 'fraction',
14 boxImage
: '/media/images/progressbar/progressbar.gif',
16 0: '/media/images/progressbar/progressbg_red.gif',
17 30: '/media/images/progressbar/progressbg_orange.gif',
18 50: '/media/images/progressbar/progressbg_yellow.gif',
19 75: '/media/images/progressbar/progressbg_green.gif',
23 $(document
).ready(function() {
26 select: function(event
, ui
) {
27 window
.location
.hash
= ui
.tab
.hash
;
28 var loadingMsg
= '{% trans "Loading" %}';
30 if (tabID
.id
!= "overview") {
31 $(tabID
).html("<div class='spinner'><br/>"+loadingMsg
+"...<br/><br/><img src='{{MEDIA_URL}}/images/ajax-loader.gif'></div>");
35 error: function(xhr
, status
, index
, anchor
) {
36 $(anchor
.hash
).html("{% trans "Couldn
't load this tab. We'll
try to fix
this as soon as possible
" %}.");
41 $("a.delete").live("click", function(){
42 if (confirm("{% trans 'Are you sure you want to delete this cluster' %}?")) {
44 $("a.delete").text("{% trans 'Deleting' %}...");
45 $("a.delete").removeAttr("href");
46 $("a.delete").addClass("deleting");
47 $("a.delete").removeClass("delete");
49 href
= "{% url cluster-edit cluster.slug %}";
50 $.delete_(href
, function(){
51 window
.location
= "{% url cluster-list %}";
57 $("#actions a.redistribute-config").live("click", function(event
) {
58 event
.preventDefault();
59 if(!$(this).hasClass('disabled')) {
60 if(!confirm('Are you sure you want to '
61 +'redistribute master node config to '
62 +'all other nodes?')) {
65 $.post(this.href
, action_response
);
69 {% if cluster
.last_job_id
%}
70 {# there is a running job
, display it and poll
for status
#}
71 get_job_status({{cluster
.last_job
.job_id
}}, job_complete
);
72 poll_job_status({{cluster
.last_job
.job_id
}}, job_complete
);
74 {% if cluster
.error
%}
75 display_ganeti_error("{{cluster.error}}");
80 function job_complete() {
81 window
.location
.reload();
84 function action_response(result
) {
85 if(result
.ops
== undefined) {
86 display_ganeti_error(result
['__all__'][0]);
87 $('#actions a').removeClass('disabled');
89 poll_job_status(result
['id'], job_complete
);
94 /* XXX: temporarily (maybe permanently) using this for reporting
95 when a quota limit has been encountered on startup */
96 function display_ganeti_error(msg
) {
97 $("#messages").empty();
98 var html
= "<li class='error'>Error:<p>" + msg
+ "</p></li>";
99 $("#messages").append(html
);
103 {% include
"job_status.html" %}
107 <h1><a class=
"breadcrumb" href=
"{% url cluster-list %}">{% trans
"Cluster" %}
</a> : {{ cluster.hostname }}
</h1>
110 {%if cluster.error%}
<li class=
"error">{% trans
"Error in Ganeti API" %}:
<p>{{cluster.error}}
</p></li>{%endif%}
114 <li><a href=
"#overview"><span>{% trans
"Overview" %}
</span></a></li>
115 <li><a title=
"virtual machines" href=
"{% url cluster-vms cluster.slug %}"><span>{% trans
"Virtual Machines" %}
</span></a></li>
116 <li><a title=
"nodes" href=
"{% url cluster-nodes cluster.slug %}"><span>{% trans
"Nodes" %}
</span></a></li>
118 <li><a title=
"user" href=
"{% url cluster-users cluster.slug %}"><span>{% trans
"Users" %}
</span></a></li>
119 <li><a title=
"log" href=
"{% url cluster-object_log cluster.slug %}"><span>{% trans
"Log" %}
</span></a></li>
122 <div id=
"overview" class=
"tab_content">
125 <li><a class=
"button edit" title=
"edit cluster" href=
"{% url cluster-edit cluster.slug %}">{% trans
"Edit" %}
</a></li>
126 <li><a class=
"button delete" title=
"delete cluster" href=
"{% url cluster-edit cluster.slug %}">{% trans
"Delete" %}
</a></li>
127 <li><a class=
"button redistribute-config" title=
"redistribute cluster config" href=
"{% url cluster-redistribute-config cluster.slug %}">{% trans
"Redistribute Config" %}
</a></li>
130 <table class=
"overview">
131 {% with cluster.info as info %}
132 <tr><td>{% trans
"Architecture" %}
</td><td>{{ info.architecture
.0 }}
</td></tr>
133 <tr><td>{% trans
"Ganeti Version" %}
</td><td>{{info.software_version}}
</td></tr>
134 <tr><td>{% trans
"Default hypervisor" %}
</td><td>{{ info.default_hypervisor }}
</td></tr>
135 <tr><td>{% trans
"Available hypervisors" %}
</td><td>{{ info.enabled_hypervisors|join:
", " }}
</td></tr>
136 <tr><td>{% trans
"Master node" %}
</td><td>{{ info.master }}
</td></tr>
137 <tr><td>{% trans
"Created" %}
</td><td>
138 {% if cluster.ctime %}
139 {{ cluster.ctime|date }}
141 <em>{% trans
"unknown" %}
</em>
144 <tr><td>{% trans
"Last modified" %}
</td><td >{{ cluster.mtime|date }}
</td></tr>
145 <tr><td>{% trans
"Virtual Machines" %}
</td><td>{{ cluster.virtual_machines.count }}
</td></tr>
146 <tr><td>{% trans
"Nodes" %}
</td><td>{{ cluster.nodes.count }}
</td></tr>