1 {% extends
"menu_base.html" %}
5 <!-- "import" the CSS and javascript for this template -->
6 <link href=
"{{STATIC_URL}}/css/jquery-ui.css" rel=
"stylesheet" type=
"text/css"/>
7 <script type=
"text/javascript" src=
"{{STATIC_URL}}/js/jquery-ui.min.js"></script>
8 <script type=
"text/javascript" src=
"{{STATIC_URL}}/js/jquery.form.js"></script>
9 <script type=
"text/javascript" src=
"{{STATIC_URL}}/js/jquery.progressbar.js"></script>
10 <script type=
"text/javascript" src=
"{{STATIC_URL}}/js/ajax_tab_handler.js"></script>
11 <script type=
"text/javascript" src=
"{{STATIC_URL}}/js/job_status.js"></script>
12 <script type=
"text/javascript">
14 var actions_enabled
= true;
18 textFormat
: 'fraction',
19 boxImage
: '/static/images/progressbar/progressbar.gif',
21 0: '{{STATIC_URL}}/images/progressbar/progressbg_green.gif',
22 30: '{{STATIC_URL}}/images/progressbar/progressbg_yellow.gif',
23 50: '{{STATIC_URL}}/images/progressbar/progressbg_orange.gif',
24 75: '{{STATIC_URL}}/images/progressbar/progressbg_red.gif'
28 $(document
).ready(function() {
31 cache
: false, // no-cache b/c we want data to update
33 select: function(event
, ui
) {
34 window
.location
.hash
= ui
.tab
.hash
;
36 load: function(event
, ui
) {
37 init_ajax_tab_handler(event
, ui
, ".pagination a, .sortable a");
40 error: function(xhr
, status
, index
, anchor
) {
41 $(anchor
.hash
).html("{% trans "Couldn
't load this tab. We'll
try to fix
this as soon as possible
" %}.");
46 $(".ram, .disk").progressBar(PBAR_CONF
);
48 $(".modify, .migrate, .evacuate").click(function(event
){
49 event
.preventDefault();
50 if (actions_enabled
) {
51 $('.qtip').qtip('destroy');
55 if ($this.hasClass("modify")) {
56 title
= "{% trans "Modify Role
" %}";
57 } else if ($this.hasClass("migrate")) {
58 title
= "{% trans "Migrate Primary Virtual Machines
" %}";
60 title
= "{% trans "Evacuate Secondary Virtual Machines
" %}";
66 title
: {text
:title
, button
:"close"}
70 target
:'center', tooltip
:'center'
79 show
: {when
:false, ready
:true},
80 hide
: {fixed
: true, when
:false},
81 api
:{onShow:function(){
82 $(".ajax_form input[type!=hidden], " +
83 ".ajax_form select").first().focus();
89 $(".node_role_form, .node_migrate_form, .node_evacuate_form")
90 .live("submit", function(event
){
91 event
.preventDefault();
93 $(this).ajaxSubmit({success
: node_form_response
});
97 var job_status_url
= "{% url node-job-status node.id %}";
98 var cluster_detail_url
= "{% url cluster-detail cluster.slug %}";
99 job_poller
= new JobPoller();
100 job_poller
.init(job_status_url
, cluster_detail_url
, job_complete
);
101 {% if node
.last_job_id
%}
102 job_poller
.get_jobs();
106 display_ganeti_error("{{node.error}}");
111 function node_action_response(result
) {
112 if (result
.ops
== undefined) {
113 display_ganeti_error(result
[1]);
114 actions_enabled
= true;
115 $('#actions a').removeClass('disabled');
117 job_poller
.render_job(result
);
118 job_poller
.poll(FAST
);
122 function job_complete() {
123 window
.location
.reload();
126 function node_form_response(responseText
, statusText
, xhr
, $form
) {
127 if (responseText
["opstatus"] == undefined) {
128 // no opstatus, must be an error
130 for (var key
in responseText
) {
131 $("#errors").append("<li>"+ responseText
[key
] +"</li>");
134 $('.qtip').qtip("hide");
135 job_poller
.poll(job_poller
.FAST
);
139 function display_ganeti_error(msg
) {
140 $("#messages").empty();
141 var html
= "<li class='error'>{% trans "Error
" %}:<p>" + msg
+ "</p></li>";
142 $("#messages").append(html
);
148 <h1 class=
"breadcrumb">
149 <a href=
"{% url cluster-detail cluster.slug %}">{{cluster.hostname}}
</a>
153 <ul id=
"messages"></ul>
156 <li><a href=
"#detail"><span>{% trans
"Detail" %}
</span></a></li>
157 {% if not readonly %}
160 href=
"{% url node-primary-vms cluster.slug node.hostname %}">
161 <span>{% trans
"Primary" %}
</span>
166 href=
"{% url node-secondary-vms cluster.slug node.hostname %}">
167 <span>{% trans
"Secondary" %}
</span>
172 href=
"{% url node-object_log cluster.slug node.hostname %}">
173 <span>{% trans
"Log" %}
</span>
180 {% if node_count
> 1 %}
182 <a class=
"button modify" title=
"modifies the role of this node"
183 href=
"{% url node-role cluster.slug node.hostname %}">
184 {% trans
"Change Role" %}
188 <a class=
"button migrate"
189 title=
"migrates all primary instances of this node"
190 href=
"{% url node-migrate cluster.slug node.hostname %}">
191 {% trans
"Migrate" %}
195 Disabling this button for now till this is fixed upstream
198 <a class=
"button evacuate"
199 title=
"migrates all secondary instances off this node"
200 href=
"{% url node-evacuate cluster.slug node.hostname %}">
201 {% trans
"Evacuate" %}
207 <table id=
"nodes" class=
"overview horizontal">
208 <tr><th>Status
</th><td class=
"status">
209 {% if node.info.offline %}
210 <div class=
"icon_stopped" title=
"Offline"></div>
212 <div class=
"icon_running" title=
"Online"></div>
216 <tr><th>{% trans
"Primary IP" %}
</th><td>{{node.info.pip}}
</td></tr>
217 <tr><th>{% trans
"Secondary IP" %}
</th><td>{{node.info.sip}}
</td></tr>
218 <tr><th>{% trans
"Role" %}
</th><td>{{node.info.role|node_role}}
</td></tr>
220 <th>{% trans
"Master Candidate" %}
</th>
221 <td>{{node.info.master_candidate|checkmark}}
</td>
223 <tr><th>{% trans
"Drained" %}
</th><td>{{node.info.drained|checkmark}}
</td></tr>
224 <tr><th>{% trans
"CPUs" %}
</th><td>{{ node.cpus|default:
"unknown" }}
</td></tr>
225 <tr><th>{% trans
"Allocated CPUs" %}
</th><td>{{ node.allocated_cpus }}
</td></tr>
226 <tr><th>{% trans
"Ram Allocated [GiB]" %}
</th><td class=
"ram">{% node_memory node %}
</td></tr>
227 <tr><th>{% trans
"Ram Used [GiB]" %}
</th><td class=
"ram">{% node_memory node
0 %}
</td></tr>
228 <tr><th>{% trans
"Disk Allocated [GiB]" %}
</th><td class=
"disk">{% node_disk node %}
</td></tr>
229 <tr><th>{% trans
"Disk Used [GiB]" %}
</th><td class=
"disk">{% node_disk node
0 %}
</td></tr>
232 <th>{% trans
"Virtual Machines" %}
</th>
233 <td>{{ node.info.pinst_cnt }} / {{ node.info.sinst_cnt }}
</td>