diff --git a/hosting/static/hosting/js/virtual_machine_detail.js b/hosting/static/hosting/js/virtual_machine_detail.js index d9345e0c..7ea408ae 100644 --- a/hosting/static/hosting/js/virtual_machine_detail.js +++ b/hosting/static/hosting/js/virtual_machine_detail.js @@ -1,6 +1,7 @@ $(document).ready(function () { var create_vm_form = $('#virtual_machine_create_form'); create_vm_form.submit(function () { + $('#btn-create-vm').prop('disabled', true); $.ajax({ url: create_vm_form.attr('action'), type: 'POST', @@ -16,6 +17,13 @@ $(document).ready(function () { window.location = data.redirect; }) } + }, + error: function (xmlhttprequest, textstatus, message) { + fa_icon = $('.modal-icon > .fa'); + fa_icon.attr('class', 'fa fa-error'); + $('.modal-header > .close').attr('class', 'close'); + $('#createvm-modal-title').text(create_vm_error_message); + $('#btn-create-vm').prop('disabled', false); } }); return false; diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index 3b46f566..2a3c32b7 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -202,7 +202,7 @@