Commit fc3d79dd by Kálmán Viktor

dashboard: rewrite with_reload js side

- don't refresh the page immediately when the response
  comes back, wait til all the activity finishes
parent 250c4b3d
......@@ -51,7 +51,8 @@ $(function() {
if(data.success) {
$('a[href="#activity"]').trigger("click");
if(data.with_reload) {
location.reload();
// when the activity check stops the page will reload
reload_vm_detail = true;
}
/* if there are messages display them */
......
var show_all = false;
var in_progress = false;
var activity_hash = 5;
var reload_vm_detail = false;
$(function() {
/* do we need to check for new activities */
......@@ -404,6 +405,7 @@ function checkNewActivity(runs) {
);
} else {
in_progress = false;
if(reload_vm_detail) location.reload();
}
$('a[href="#activity"] i').removeClass('fa-spin');
},
......
......@@ -374,6 +374,7 @@ class VmDiskResizeView(FormOperationMixin, VmOperationView):
op = 'resize_disk'
form_class = VmDiskResizeForm
show_in_toolbar = False
with_reload = True
icon = 'arrows-alt'
effect = "success"
......@@ -401,6 +402,7 @@ class VmCreateDiskView(FormOperationMixin, VmOperationView):
icon = 'hdd-o'
effect = "success"
is_disk_operation = True
with_reload = True
class VmDownloadDiskView(FormOperationMixin, VmOperationView):
......@@ -411,6 +413,7 @@ class VmDownloadDiskView(FormOperationMixin, VmOperationView):
icon = 'download'
effect = "success"
is_disk_operation = True
with_reload = True
class VmMigrateView(VmOperationView):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment