1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Feature #3748: If Save as template takes too long, notify the user

This commit is contained in:
Tino Vazquez 2015-07-21 19:31:19 +02:00
parent 56c1ed40d4
commit 885cba9c41

View File

@ -448,7 +448,7 @@ define(function(require) {
'<span style="font-size: 14px; line-height: 20px">'+
Locale.tr("This Virtual Machine will be saved in a new Template. Only the main disk will be preserved!")+
'<br>'+
Locale.tr("You can then create a new Virtual Machine using this Template")+
Locale.tr("You can then create a new Virtual Machine using this Template.")+
'</span>'+
'</div>'+
'</div>'+
@ -483,6 +483,7 @@ define(function(require) {
name : template_name
}
},
timeout: false,
success: function(request, response){
OpenNebula.Action.clear_cache("VMTEMPLATE");
Notifier.notifyMessage(Locale.tr("VM Template") + ' ' + request.request.data[0][1].name + ' ' + Locale.tr("saved successfully"))
@ -490,7 +491,13 @@ define(function(require) {
button.removeAttr("disabled");
},
error: function(request, response){
Notifier.onError(request, response);
if(response.error.http_status == 0){ // Failed due to cloning template taking too long
OpenNebula.Action.clear_cache("VMTEMPLATE");
update_provision_vm_info(vm_id, context);
Notifier.notifyMessage(Locale.tr("VM cloning in the background. The Template will appear as soon as it is ready, and the VM unlocked."));
} else {
Notifier.onError(request, response);
}
button.removeAttr("disabled");
}
})