Revision 5e5df8fe
b/ui/templates/machines_single.html | ||
---|---|---|
90 | 90 |
</div> |
91 | 91 |
</div> |
92 | 92 |
<div class="single-actions"> |
93 |
<div class="single-action action-start">{% trans "Start" %}</a></div> |
|
94 |
<div class="single-action action-reboot">{% trans "Reboot" %}</a></div> |
|
95 |
<div class="single-action action-shutdown">{% trans "Shutdown" %}</a></div> |
|
96 |
<div class="single-action action-console">{% trans "Console" %}</a></div> |
|
97 |
<div class="single-action action-destroy">{% trans "Destroy" %}</a></div> |
|
98 |
</div> |
|
99 |
<div class="confirm_single"> |
|
100 |
<button class="yes">{% trans "Confirm" %}</button> |
|
101 |
<button class="no">X</button> |
|
93 |
<div class="action-container start"> |
|
94 |
<div class="single-action action-start">{% trans "Start" %}</div> |
|
95 |
<div class="confirm_single"> |
|
96 |
<button class="yes">{% trans "Confirm" %}</button> |
|
97 |
<button class="no">X</button> |
|
98 |
</div> |
|
99 |
</div> |
|
100 |
<div class="action-container reboot"> |
|
101 |
<div class="single-action action-reboot">{% trans "Reboot" %}</div> |
|
102 |
<div class="confirm_single"> |
|
103 |
<button class="yes">{% trans "Confirm" %}</button> |
|
104 |
<button class="no">X</button> |
|
105 |
</div> |
|
106 |
</div> |
|
107 |
<div class="action-container shutdown"> |
|
108 |
<div class="single-action action-shutdown">{% trans "Shutdown" %}</div> |
|
109 |
<div class="confirm_single"> |
|
110 |
<button class="yes">{% trans "Confirm" %}</button> |
|
111 |
<button class="no">X</button> |
|
112 |
</div> |
|
113 |
</div> |
|
114 |
<div class="action-container console"> |
|
115 |
<div class="single-action action-console">{% trans "Console" %}</div> |
|
116 |
<div class="confirm_single"> |
|
117 |
<button class="yes">{% trans "Confirm" %}</button> |
|
118 |
<button class="no">X</button> |
|
119 |
</div> |
|
120 |
</div> |
|
121 |
<div class="action-container destroy"> |
|
122 |
<div class="single-action action-destroy">{% trans "Destroy" %}</div> |
|
123 |
<div class="confirm_single"> |
|
124 |
<button class="yes">{% trans "Confirm" %}</button> |
|
125 |
<button class="no">X</button> |
|
126 |
</div> |
|
127 |
</div> |
|
102 | 128 |
</div> |
103 | 129 |
<div class="action_error" align="center"> |
104 |
{% trans "<span class='orange'>Error</span> on" %} <span class="action">{% trans "error action" %}</span>
|
|
130 |
{% trans "<span>Error</span> on" %} <span class="action">{% trans "error action" %}</span> |
|
105 | 131 |
<span class="code"></span> |
106 | 132 |
<span class="message"></span> |
107 | 133 |
<button class="details">{% trans "Details" %}</button> |
... | ... | |
129 | 155 |
<div class="column3"> |
130 | 156 |
<div class="controls"> |
131 | 157 |
<div class="previous" style="display:none;"> |
132 |
<div class="prev-arrow"> |
|
133 |
|
|
134 |
</div> |
|
158 |
<div class="prev-arrow"></div> |
|
135 | 159 |
{% trans "previous" %} |
136 | 160 |
</div> |
137 | 161 |
<div class="next" style="display:none;"> |
138 | 162 |
{% trans "next" %} |
139 |
<div class="next-arrow"> |
|
140 |
|
|
141 |
</div> |
|
163 |
<div class="next-arrow"></div> |
|
142 | 164 |
</div> |
143 | 165 |
</div> |
144 | 166 |
<div class="separator"> |
... | ... | |
180 | 202 |
|
181 | 203 |
//confirm action |
182 | 204 |
$("#machinesview-single.single div.confirm_single .yes").live('click', function(){ |
183 |
var serverID = $(this).parent().parent().parent().attr("id");
|
|
205 |
var serverID = $(this).closest(".single-container").attr("id");
|
|
184 | 206 |
console.info(serverID); |
185 | 207 |
for (i=0;i<pending_actions.length;i++){ // if there is a pending action for this server execute it |
186 | 208 |
if (pending_actions[i][1]==serverID){ |
... | ... | |
209 | 231 |
$(this).parent().hide(); |
210 | 232 |
$(this).parent().parent().children('div.actions').children('a').removeClass('selected'); |
211 | 233 |
$(this).parent().parent().children('.state').children('.spinner').show() |
212 |
$(this).parent().parent().children('div.actions').removeClass('display'); |
|
213 | 234 |
update_confirmations(); |
214 | 235 |
return false; |
215 | 236 |
}); |
... | ... | |
217 | 238 |
|
218 | 239 |
// intercept start click |
219 | 240 |
$("#machinesview-single.single div.action-start").live('click', function(){ |
220 |
var serverID = $(this).parent().parent().parent().attr("id");
|
|
221 |
var serverName = $(this).parent().parent().parent().find(".machine-details div.name").text();
|
|
241 |
var serverID = $(this).closest(".single-container").attr("id");
|
|
242 |
var serverName = $(this).closest("div.upper").find(".machine-details div.name").text();
|
|
222 | 243 |
var found = false; |
223 | 244 |
$(this).parent().children('a').removeClass('selected'); |
224 | 245 |
$(this).addClass('selected'); |
225 |
$(this).parent().addClass('display') |
|
226 | 246 |
$(this).parent().parent().find('.action_error').hide(); |
227 | 247 |
|
228 | 248 |
for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it |
... | ... | |
239 | 259 |
|
240 | 260 |
// intercept shutdown click |
241 | 261 |
$("#machinesview-single.single div.action-shutdown").live('click', function(){ |
242 |
var serverID = $(this).parent().parent().parent().attr("id");
|
|
243 |
var serverName = $(this).parent().parent().parent().find(".machine-details div.name").text();
|
|
262 |
var serverID = $(this).closest(".single-container").attr("id");
|
|
263 |
var serverName = $(this).closest("div.upper").find(".machine-details div.name").text();
|
|
244 | 264 |
var found = false; |
245 | 265 |
$(this).parent().children('a').removeClass('selected'); |
246 | 266 |
$(this).addClass('selected'); |
247 |
$(this).parent().addClass('display') |
|
248 | 267 |
$(this).parent().parent().find('.action_error').hide(); |
249 | 268 |
|
250 | 269 |
for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it |
... | ... | |
261 | 280 |
|
262 | 281 |
// intercept reboot click |
263 | 282 |
$("#machinesview-single.single div.action-reboot").live('click', function(){ |
264 |
var serverID = $(this).parent().parent().parent().attr("id");
|
|
265 |
var serverName = $(this).parent().parent().parent().find(".machine-details div.name").text();
|
|
283 |
var serverID = $(this).closest(".single-container").attr("id");
|
|
284 |
var serverName = $(this).closest("div.upper").find(".machine-details div.name").text();
|
|
266 | 285 |
var found = false; |
267 | 286 |
|
268 | 287 |
$(this).parent().children('a').removeClass('selected'); |
269 | 288 |
$(this).addClass('selected'); |
270 |
$(this).parent().addClass('display'); |
|
271 | 289 |
$(this).parent().parent().find('.action_error').hide(); |
272 | 290 |
for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it |
273 | 291 |
if (pending_actions[i][1]==serverID){ |
... | ... | |
283 | 301 |
|
284 | 302 |
// intercept destroy click |
285 | 303 |
$("#machinesview-single.single div.action-destroy").live('click', function(){ |
286 |
var serverID = $(this).parent().parent().parent().attr("id");
|
|
287 |
var serverName = $(this).parent().parent().parent().find(".machine-details div.name").text();
|
|
304 |
var serverID = $(this).closest(".single-container").attr("id");
|
|
305 |
var serverName = $(this).closest("div.upper").find(".machine-details div.name").text();
|
|
288 | 306 |
var found = false; |
289 | 307 |
|
290 | 308 |
$(this).parent().children('a').removeClass('selected'); |
291 | 309 |
$(this).addClass('selected'); |
292 |
$(this).parent().addClass('display') |
|
293 | 310 |
$(this).parent().parent().find('.action_error').hide(); |
294 | 311 |
for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it |
295 | 312 |
if (pending_actions[i][1]==serverID){ |
... | ... | |
305 | 322 |
|
306 | 323 |
// intercept console click |
307 | 324 |
$("#machinesview-single.single div.action-console").live('click', function(){ |
308 |
var serverID = $(this).parent().parent().parent().attr("id");
|
|
309 |
var serverName = $(this).parent().parent().parent().find(".machine-details div.name").text();
|
|
325 |
var serverID = $(this).closest(".single-container").attr("id");
|
|
326 |
var serverName = $(this).closest("div.upper").find(".machine-details div.name").text();
|
|
310 | 327 |
var found = false; |
311 | 328 |
$(this).parent().children('a').removeClass('selected'); |
312 | 329 |
$(this).addClass('selected'); |
313 |
$(this).parent().addClass('display') |
|
314 | 330 |
$(this).parent().parent().find('.action_error').hide(); |
315 | 331 |
|
316 | 332 |
for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it |
Also available in: Unified diff