VM edit: rebuild correctly graphic cards

This commit is contained in:
bergware
2018-09-06 15:32:11 +02:00
parent 0e331b82fd
commit 33f06df07c
3 changed files with 12 additions and 0 deletions
@@ -1431,6 +1431,10 @@ $(function() {
$button.closest('form').find('input[name="usb[]"],input[name="pci[]"]').each(function(){
if (!$(this).prop('checked')) $(this).prop('checked',true).val($(this).val()+'#remove');
});
// remove graphic cards for automatic rebuild
$button.closest('form').find('select[name="gpu[0][id]"] option').each(function(){
if ($(this).val() != 'vnc') $('form#vmform').append('<input type="hidden" name="pci[]" value="'+$(this).val()+'#remove">');
});
<?endif?>
var postdata = $button.closest('form').find('input,select').serialize().replace(/'/g,"%27");
<?if (!$boolNew):?>
@@ -1124,6 +1124,10 @@ $(function() {
$button.closest('form').find('input[name="usb[]"],input[name="pci[]"]').each(function(){
if (!$(this).prop('checked')) $(this).prop('checked',true).val($(this).val()+'#remove');
});
// remove graphic cards for automatic rebuild
$button.closest('form').find('select[name="gpu[0][id]"] option').each(function(){
if ($(this).val() != 'vnc') $('form#vmform').append('<input type="hidden" name="pci[]" value="'+$(this).val()+'#remove">');
});
<?endif?>
var postdata = $button.closest('form').find('input,select').serialize().replace(/'/g,"%27");
<?if (!$boolNew):?>
@@ -1126,6 +1126,10 @@ $(function() {
$button.closest('form').find('input[name="usb[]"],input[name="pci[]"]').each(function(){
if (!$(this).prop('checked')) $(this).prop('checked',true).val($(this).val()+'#remove');
});
// remove graphic cards for automatic rebuild
$button.closest('form').find('select[name="gpu[0][id]"] option').each(function(){
if ($(this).val() != 'vnc') $('form#vmform').append('<input type="hidden" name="pci[]" value="'+$(this).val()+'#remove">');
});
<?endif?>
var postdata = $button.closest('form').find('input,select').serialize().replace(/'/g,"%27");
<?if (!$boolNew):?>