mirror of
https://github.com/unraid/webgui.git
synced 2026-03-20 20:02:44 -05:00
VM edit: rebuild correctly graphic cards
This commit is contained in:
@@ -1431,9 +1431,15 @@ $(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
|
||||
// remove unused graphic cards
|
||||
var gpus = [], i = 0;
|
||||
do {
|
||||
var gpu = $button.closest('form').find('select[name="gpu['+(i++)+'][id]"] option:selected').val();
|
||||
if (gpu) gpus.push(gpu);
|
||||
} while (gpu);
|
||||
$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">');
|
||||
var gpu = $(this).val();
|
||||
if (gpu != 'vnc' && !gpus.includes(gpu)) $('form#vmform').append('<input type="hidden" name="pci[]" value="'+gpu+'#remove">');
|
||||
});
|
||||
<?endif?>
|
||||
var postdata = $button.closest('form').find('input,select').serialize().replace(/'/g,"%27");
|
||||
|
||||
@@ -1124,9 +1124,15 @@ $(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
|
||||
// remove unused graphic cards
|
||||
var gpus = [], i = 0;
|
||||
do {
|
||||
var gpu = $button.closest('form').find('select[name="gpu['+(i++)+'][id]"] option:selected').val();
|
||||
if (gpu) gpus.push(gpu);
|
||||
} while (gpu);
|
||||
$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">');
|
||||
var gpu = $(this).val();
|
||||
if (gpu != 'vnc' && !gpus.includes(gpu)) $('form#vmform').append('<input type="hidden" name="pci[]" value="'+gpu+'#remove">');
|
||||
});
|
||||
<?endif?>
|
||||
var postdata = $button.closest('form').find('input,select').serialize().replace(/'/g,"%27");
|
||||
|
||||
@@ -1126,9 +1126,15 @@ $(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
|
||||
// remove unused graphic cards
|
||||
var gpus = [], i = 0;
|
||||
do {
|
||||
var gpu = $button.closest('form').find('select[name="gpu['+(i++)+'][id]"] option:selected').val();
|
||||
if (gpu) gpus.push(gpu);
|
||||
} while (gpu);
|
||||
$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">');
|
||||
var gpu = $(this).val();
|
||||
if (gpu != 'vnc' && !gpus.includes(gpu)) $('form#vmform').append('<input type="hidden" name="pci[]" value="'+gpu+'#remove">');
|
||||
});
|
||||
<?endif?>
|
||||
var postdata = $button.closest('form').find('input,select').serialize().replace(/'/g,"%27");
|
||||
|
||||
Reference in New Issue
Block a user