Revision 941b00d4
b/ui/templates/machines.html | ||
---|---|---|
196 | 196 |
<button> No </button> |
197 | 197 |
</div> |
198 | 198 |
|
199 |
<script type="text/javascript"> |
|
200 |
var TIMEOUT = {{timeout}}; |
|
201 |
</script> |
|
202 |
|
|
199 | 203 |
<script> |
200 | 204 |
|
205 |
|
|
206 |
|
|
201 | 207 |
// hardcoded image types |
202 | 208 |
var image_tags = { |
203 | 209 |
1: 'archlinux', |
... | ... | |
229 | 235 |
url: '/api/v1.0/servers/detail', |
230 | 236 |
type: "GET", |
231 | 237 |
//async: false, |
238 |
timeout: TIMEOUT, |
|
232 | 239 |
dataType: "json", |
233 |
timeout: {{timeout}}, |
|
234 | 240 |
error: function(data, strError) { |
235 | 241 |
$("#spinner").hide(); |
236 | 242 |
if (strError == 'timeout'){ |
... | ... | |
316 | 322 |
type: "GET", |
317 | 323 |
//async: false, |
318 | 324 |
dataType: "json", |
319 |
timeout: {{timeout}},
|
|
325 |
timeout: TIMEOUT,
|
|
320 | 326 |
error: function(data, strError) { |
321 | 327 |
if (strError == 'timeout'){ |
322 | 328 |
alert('{% trans "timeout error. Check your network connection" %}'); |
... | ... | |
547 | 553 |
var yes = buttons.index(this) === 0; |
548 | 554 |
// if user wants to proceed |
549 | 555 |
if (yes) { |
556 |
$("a#verification[rel]").overlay().close(); //close the window, no matter what happens |
|
550 | 557 |
$.ajax({ |
551 | 558 |
url: '/api/v1.0/servers/' + serverID + '/action', |
552 | 559 |
type: "POST", |
... | ... | |
555 | 562 |
}, |
556 | 563 |
//async: false, |
557 | 564 |
dataType: "json", |
558 |
error: function(){}, |
|
565 |
timeout: TIMEOUT, |
|
566 |
error: function(data, strError) { |
|
567 |
if (strError == 'timeout'){ |
|
568 |
alert('{% trans "timeout error. Check your network connection" %}'); |
|
569 |
} |
|
570 |
else { |
|
571 |
alert('{% trans "the reboot request could not be made" %}'); |
|
572 |
//get exact error with data.responseText (json) |
|
573 |
} |
|
574 |
return false; |
|
575 |
}, |
|
559 | 576 |
success: function() { |
560 |
$("a#verification[rel]").overlay().close();
|
|
577 |
alert('{% trans "the reboot request was executed!" %}');
|
|
561 | 578 |
} |
562 | 579 |
}); |
563 | 580 |
} |
b/ui/views.py | ||
---|---|---|
14 | 14 |
return HttpResponse(t.render(Context(context))) |
15 | 15 |
|
16 | 16 |
def home(request): |
17 |
context = { 'project' : '+nefo', 'request': request, 'current_lang' : get_language() or 'en' } |
|
17 |
context = { 'timeout': TIMEOUT, 'project' : '+nefo', 'request': request, 'current_lang' : get_language() or 'en' }
|
|
18 | 18 |
return template('home', context) |
19 | 19 |
|
20 | 20 |
def machines(request): |
21 |
context = {'timeout': TIMEOUT}
|
|
21 |
context = {} |
|
22 | 22 |
return template('machines', context) |
23 | 23 |
|
24 | 24 |
def machines_list(request): |
Also available in: Unified diff