Ticket #5721 - Saving vm edit sometimes hangs on "set params"
[ganeti_webmgr.git] / ganeti_web / templates / cluster / detail.html
blob886be36d5de8d63597e61b71047ac64dcb6c4e6f
1 {% extends "menu_base.html" %}
2 {% block title %}Cluster {{ cluster.id }}: {{ cluster.hostname|safe }}{% endblock %}
3 {% load i18n %}
4 {% block head %}
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">
10 var PBAR_CONF = {
11 steps: 0,
12 showText: true,
13 textFormat: 'fraction',
14 boxImage: '/media/images/progressbar/progressbar.gif',
15 barImage: {
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() {
24 $('#tabs').tabs({
25 spinner: false,
26 select: function(event, ui) {
27 window.location.hash = ui.tab.hash;
28 var loadingMsg = '{% trans "Loading" %}';
29 var tabID = ui.panel;
30 if (tabID.id != "overview") {
31 $(tabID).html("<div class='spinner'><br/>"+loadingMsg+"...<br/><br/><img src='{{MEDIA_URL}}/images/ajax-loader.gif'></div>");
34 ajaxOptions: {
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" %}.");
39 });
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 %}";
52 });
54 return false;
55 });
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?')) {
63 return false;
65 $.post(this.href, action_response);
67 });
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);
73 {% else %}
74 {% if cluster.error %}
75 display_ganeti_error("{{cluster.error}}");
76 {% endif %}
77 {% endif %}
78 });
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');
88 } else {
89 poll_job_status(result['id'], job_complete);
90 display_job(result);
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);
101 </script>
103 {% include "job_status.html" %}
104 {% endblock %}
106 {% block content %}
107 <h1><a class="breadcrumb" href="{% url cluster-list %}">{% trans "Cluster" %}</a> : {{ cluster.hostname }}</h1>
109 <ul id="messages">
110 {%if cluster.error%}<li class="error">{% trans "Error in Ganeti API" %}:<p>{{cluster.error}}</p></li>{%endif%}
111 </ul>
112 <div id="tabs">
113 <ul>
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>
117 {% if admin %}
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>
120 {%endif%}
121 </ul>
122 <div id="overview" class="tab_content">
123 <ul id="actions">
124 {% if admin %}
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>
128 {% endif %}
129 </ul>
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 }}
140 {% else %}
141 <em>{% trans "unknown" %}</em>
142 {% endif %}
143 </td></tr>
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>
147 {% endwith %}
148 </table>
149 </div>
150 </div>
151 {% endblock %}