Added js handling of create vm form submission
This commit is contained in:
parent
ca5a99ccf5
commit
e14ed0c69f
1 changed files with 33 additions and 13 deletions
|
@ -1,7 +1,27 @@
|
|||
$(document).ready(function () {
|
||||
var create_vm_form = $('#virtual_machine_create_form');
|
||||
create_vm_form.submit(function () {
|
||||
$.ajax({
|
||||
url: create_vm_form.attr('action'),
|
||||
type: 'POST',
|
||||
data: create_vm_form.serialize(),
|
||||
success: function (data) {
|
||||
if (data.status === true) {
|
||||
fa_icon = $('.modal-icon > .fa');
|
||||
fa_icon.attr('class', 'fa fa-check');
|
||||
$('.modal-header > .close').attr('class', 'close');
|
||||
$('#createvm-modal-title').text(data.msg_title);
|
||||
$('#createvm-modal-body').text(data.msg_body);
|
||||
$('#createvm-modal').on('hidden.bs.modal', function () {
|
||||
window.location = data.redirect;
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('#confirm-cancel').on('click', '.btn-ok', function(e) {
|
||||
$('#confirm-cancel').on('click', '.btn-ok', function (e) {
|
||||
$('#virtual_machine_cancel_form').trigger('submit');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue