mirror of
https://github.com/unraid/webgui.git
synced 2026-05-05 11:50:41 -05:00
Add boot order for USB and USBBoption
Add boot order field to USB devices Add OS boot setting for USB Boot.
This commit is contained in:
@@ -263,6 +263,7 @@
|
||||
$disks = $config['disk'];
|
||||
$usb = $config['usb'];
|
||||
$usbopt = $config['usbopt'];
|
||||
$usbboot = $config['usbboot'];
|
||||
$shares = $config['shares'];
|
||||
$gpus = $config['gpu'];
|
||||
$pcis = $config['pci'];
|
||||
@@ -285,6 +286,7 @@
|
||||
|
||||
$loader = '';
|
||||
$swtpm = '';
|
||||
$osbootdev = '';
|
||||
if (!empty($domain['ovmf'])) {
|
||||
if ($domain['ovmf'] == 1) {
|
||||
if (!is_file('/etc/libvirt/qemu/nvram/'.$uuid.'_VARS-pure-efi.fd')) {
|
||||
@@ -299,6 +301,7 @@
|
||||
|
||||
$loader = "<loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
|
||||
<nvram>/etc/libvirt/qemu/nvram/".$uuid."_VARS-pure-efi.fd</nvram>";
|
||||
if ($domain['usbboot'] == 'Yes') $osbootdev = "<boot dev='fd'/>" ;
|
||||
}
|
||||
if ($domain['ovmf'] == 2) {
|
||||
if (!is_file('/etc/libvirt/qemu/nvram/'.$uuid.'_VARS-pure-efi-tpm.fd')) {
|
||||
@@ -317,6 +320,7 @@
|
||||
$swtpm = "<tpm model='tpm-tis'>
|
||||
<backend type='emulator' version='2.0' persistent_state='yes'/>
|
||||
</tpm>";
|
||||
if ($domain['usbboot'] == 'Yes') $osbootdev = "<boot dev='fd'/>" ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,7 +435,7 @@
|
||||
</clock>";
|
||||
|
||||
$hyperv = '';
|
||||
if (!empty($domain['hyperv']) && $os_type == "windows") {
|
||||
if ($domain['hyperv'] == 1 && $os_type == "windows") {
|
||||
$hyperv = "<hyperv>
|
||||
<relaxed state='on'/>
|
||||
<vapic state='on'/>
|
||||
@@ -450,15 +454,18 @@
|
||||
foreach($usb as $i => $v){
|
||||
$usbx = explode(':', $v);
|
||||
$startupPolicy = '' ;
|
||||
if (isset($usbopt[$i])) {
|
||||
if (strpos($usbopt[$i], "#remove") == false) $startupPolicy = 'startupPolicy="optional"' ; else $startupPolicy = '' ;
|
||||
if (isset($usbopt[$v])) {
|
||||
if (strpos($usbopt[$v], "#remove") == false) $startupPolicy = 'startupPolicy="optional"' ; else $startupPolicy = '' ;
|
||||
}
|
||||
$usbstr .= "<hostdev mode='subsystem' type='usb'>
|
||||
<source $startupPolicy>
|
||||
<vendor id='0x".$usbx[0]."'/>
|
||||
<product id='0x".$usbx[1]."'/>
|
||||
</source>
|
||||
</hostdev>";
|
||||
</source>" ;
|
||||
if (!empty($usbboot[$v])) {
|
||||
$usbstr .= "<boot order='".$usbboot[$v]."'/>" ;
|
||||
}
|
||||
$usbstr .= "</hostdev>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -827,8 +834,8 @@
|
||||
<source>
|
||||
<address domain='0x0000' bus='0x" . $pci_bus . "' slot='0x" . $pci_slot . "' function='0x" . $pci_function . "'/>
|
||||
</source>" ;
|
||||
if (!empty($pciboot[$i])) {
|
||||
$pcidevs .= "<boot order='".$pciboot[$i]."'/>" ;
|
||||
if (!empty($pciboot[$pci_id])) {
|
||||
$pcidevs .= "<boot order='".$pciboot[$pci_id]."'/>" ;
|
||||
}
|
||||
$pcidevs .= "</hostdev>";
|
||||
|
||||
@@ -842,7 +849,7 @@
|
||||
<alias name='balloon0'/>
|
||||
</memballoon>";
|
||||
}
|
||||
|
||||
#$osbootdev = "" ;
|
||||
return "<domain type='$type' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
|
||||
<uuid>$uuid</uuid>
|
||||
<name>$name</name>
|
||||
@@ -855,6 +862,7 @@
|
||||
<os>
|
||||
$loader
|
||||
<type arch='$arch' machine='$machine'>hvm</type>
|
||||
$osbootdev
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
|
||||
@@ -1093,6 +1093,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ($lv->domain_get_boot_devices($res)[0] == "fd") $osbootdev = "Yes" ; else $osbootdev = "No" ;
|
||||
|
||||
return [
|
||||
'template' => $arrTemplateValues,
|
||||
'domain' => [
|
||||
@@ -1113,6 +1115,7 @@
|
||||
'autostart' => ($lv->domain_get_autostart($res) ? 1 : 0),
|
||||
'state' => $lv->domain_state_translate($dom['state']),
|
||||
'ovmf' => $strOVMF,
|
||||
'usbboot' => $osbootdev,
|
||||
'usbmode' => $strUSBMode
|
||||
],
|
||||
'media' => [
|
||||
@@ -1202,22 +1205,25 @@
|
||||
'id' => $data['id'],
|
||||
'name' => $data["name"],
|
||||
'checked' => '',
|
||||
'startupPolicy' => ''
|
||||
'startupPolicy' => '',
|
||||
'usbboot' => ''
|
||||
];
|
||||
}
|
||||
if ($strXML !="") {
|
||||
$VMxml = new SimpleXMLElement($strXML);
|
||||
$VMUSB=$VMxml->xpath('//devices/hostdev[@type="usb"]/source') ;
|
||||
$VMUSB=$VMxml->xpath('//devices/hostdev[@type="usb"]') ;
|
||||
foreach($VMUSB as $USB){
|
||||
$vendor=$USB->vendor->attributes()->id ;
|
||||
$product=$USB->product->attributes()->id ;
|
||||
$startupPolicy=$USB->attributes()->startupPolicy ;
|
||||
$vendor=$USB->source->vendor->attributes()->id ;
|
||||
$product=$USB->source->product->attributes()->id ;
|
||||
$startupPolicy=$USB->source->attributes()->startupPolicy ;
|
||||
$usbboot= $USB->boot->attributes()->order ;
|
||||
$id = str_replace('0x', '', $vendor . ':' . $product) ;
|
||||
$found = false ;
|
||||
foreach($arrValidUSBDevices as $key => $data) {
|
||||
if ($data['id'] == $id) {
|
||||
$array[$key]['checked'] = "checked" ;
|
||||
$array[$key]['startupPolicy'] = $startupPolicy ;
|
||||
$array[$key]['usbboot'] = $usbboot ;
|
||||
$found = true ;
|
||||
break ;
|
||||
}
|
||||
@@ -1227,7 +1233,8 @@
|
||||
'id' => $id,
|
||||
'name' => _("USB device is missing"),
|
||||
'checked' => 'checked',
|
||||
'startupPolicy' => $startupPolicy
|
||||
'startupPolicy' => $startupPolicy,
|
||||
'usbboot' => $usbboot
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@
|
||||
<tr class="advanced">
|
||||
<td>_(BIOS)_:</td>
|
||||
<td>
|
||||
<select name="domain[ovmf]" id="domain_ovmf" class="narrow" title="_(Select the BIOS)_. _(SeaBIOS will work for most)_. _(OVMF requires a UEFI-compatable OS)_ (_(e.g.)_ _(Windows 8/2012, newer Linux distros)_) _(and if using graphics device passthrough it too needs UEFI)_">
|
||||
<select name="domain[ovmf]" id="domain_ovmf" class="narrow" title="_(Select the BIOS)_. _(SeaBIOS will work for most)_. _(OVMF requires a UEFI-compatable OS)_ (_(e.g.)_ _(Windows 8/2012, newer Linux distros)_) _(and if using graphics device passthrough it too needs UEFI)_" onchange="BIOSChange(this)">
|
||||
<?
|
||||
echo mk_option($arrConfig['domain']['ovmf'], '0', _('SeaBIOS'));
|
||||
|
||||
@@ -445,7 +445,20 @@
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<?
|
||||
$usbboothidden = "hidden" ;
|
||||
if ($arrConfig['domain']['ovmf'] != '0') $usbboothidden = "" ;
|
||||
?>
|
||||
<span id="USBBoottext" class="advanced" <?=$usbboothidden?>>_(Enable USB boot)_:</span>
|
||||
|
||||
<select name="domain[usbboot]" id="domain_usbboot" class="narrow" title="_(define OS boot options" <?=$usbboothidden?>>
|
||||
<?
|
||||
echo mk_option($arrConfig['domain']['usbboot'], 'No', 'No');
|
||||
echo mk_option($arrConfig['domain']['usbboot'], 'Yes', 'Yes');
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="advanced">
|
||||
@@ -465,6 +478,10 @@
|
||||
<p>
|
||||
Once a VM is created this setting cannot be adjusted.
|
||||
</p>
|
||||
<p>
|
||||
<b>USB Boot</b><br>
|
||||
Adds support for booting from USB devices using UEFI. No device boot orders can be specified at the same time as this option.<br>
|
||||
</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
@@ -1219,7 +1236,7 @@
|
||||
|
||||
<table>
|
||||
<tr><td></td>
|
||||
<td>_(Select)_  _(Optional)_</td></tr></div>
|
||||
<td>_(Select)_  _(Optional)_  _(Boot Order)_</td></tr></div>
|
||||
<tr>
|
||||
<td>_(USB Devices)_:</td>
|
||||
<td>
|
||||
@@ -1229,7 +1246,9 @@
|
||||
foreach($arrVMUSBs as $i => $arrDev) {
|
||||
?>
|
||||
<label for="usb<?=$i?>">    <input type="checkbox" name="usb[]" id="usb<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?if (count(array_filter($arrConfig['usb'], function($arr) use ($arrDev) { return ($arr['id'] == $arrDev['id']); }))) echo 'checked="checked"';?>
|
||||
/>         <input type="checkbox" name="usbopt[]" id="usbopt<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?if ($arrDev["startupPolicy"] =="optional") echo 'checked="checked"';?>/>    <?=htmlspecialchars($arrDev['name'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
|
||||
/>         <input type="checkbox" name="usbopt[<?=htmlspecialchars($arrDev['id'])?>]" id="usbopt<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?if ($arrDev["startupPolicy"] =="optional") echo 'checked="checked"';?>/>     
|
||||
<input type="number" size="5" maxlength="5" id="usbboot<?=$i?>" class="narrow" <?=$bootdisable?> style="width: 50px;" name="usbboot[<?=htmlspecialchars($arrDev['id'])?>]" title="_(Boot order)_" value="<?=$arrDev['usbboot']?>" >
|
||||
<?=htmlspecialchars($arrDev['name'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
|
||||
<?
|
||||
}
|
||||
} else {
|
||||
@@ -1271,7 +1290,7 @@
|
||||
$intAvailableOtherPCIDevices++;
|
||||
?>
|
||||
<label for="pci<?=$i?>">    <input type="checkbox" name="pci[]" id="pci<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?=$extra?>/>  
|
||||
<input type="number" size="5" maxlength="5" id="pciboot<?=$i?>" class="narrow" <?=$bootdisable?> style="width: 50px;" name="pciboot[]" title="_(Boot order)_" value="<?=$pciboot?>" >
|
||||
<input type="number" size="5" maxlength="5" id="pciboot<?=$i?>" class="narrow" <?=$bootdisable?> style="width: 50px;" name="pciboot[<?=htmlspecialchars($arrDev['id'])?>]" title="_(Boot order)_" value="<?=$pciboot?>" >
|
||||
<?=htmlspecialchars($arrDev['name'])?> | <?=htmlspecialchars($arrDev['type'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
|
||||
<?
|
||||
}
|
||||
@@ -1371,6 +1390,19 @@ function ShareChange(share) {
|
||||
}
|
||||
}
|
||||
|
||||
function BIOSChange(bios) {
|
||||
var value = bios.value;
|
||||
if (value == "0") {
|
||||
document.getElementById("USBBoottext").style.visibility="hidden";
|
||||
document.getElementById("domain_usbboot").style.visibility="hidden";
|
||||
} else {
|
||||
document.getElementById("USBBoottext").style.display="inline";
|
||||
document.getElementById("USBBoottext").style.visibility="visible";
|
||||
document.getElementById("domain_usbboot").style.display="inline";
|
||||
document.getElementById("domain_usbboot").style.visibility="visible";
|
||||
}
|
||||
}
|
||||
|
||||
function AutoportChange(autoport) {
|
||||
if (autoport.value == "yes") {
|
||||
document.getElementById("port").style.visibility="hidden";
|
||||
|
||||
@@ -655,7 +655,7 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
<tr class="advanced">
|
||||
<td>_(BIOS)_:</td>
|
||||
<td>
|
||||
<select name="domain[ovmf]" id="domain_ovmf" class="narrow" title="_(Select the BIOS)_. _(SeaBIOS will work for most)_. _(OVMF requires a UEFI-compatable OS)_ (_(e.g.)_ _(Windows 8/2012, newer Linux distros)_) _(and if using graphics device passthrough it too needs UEFI)_">
|
||||
<select name="domain[ovmf]" id="domain_ovmf" class="narrow" title="_(Select the BIOS)_. _(SeaBIOS will work for most)_. _(OVMF requires a UEFI-compatable OS)_ (_(e.g.)_ _(Windows 8/2012, newer Linux distros)_) _(and if using graphics device passthrough it too needs UEFI)_" onchange="BIOSChange(this)">
|
||||
<?
|
||||
echo mk_option($arrConfig['domain']['ovmf'], '0', _('SeaBIOS'));
|
||||
|
||||
@@ -666,6 +666,18 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?
|
||||
$usbboothidden = "hidden" ;
|
||||
if ($arrConfig['domain']['ovmf'] != '0') $usbboothidden = "" ;
|
||||
?>
|
||||
<span id="USBBoottext" class="advanced" <?=$usbboothidden?>>_(Enable USB boot)_:</span>
|
||||
|
||||
<select name="domain[usbboot]" id="domain_usbboot" class="narrow" title="_(define OS boot options" <?=$usbboothidden?>>
|
||||
<?
|
||||
echo mk_option($arrConfig['domain']['usbboot'], 'No', 'No');
|
||||
echo mk_option($arrConfig['domain']['usbboot'], 'Yes', 'Yes');
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -682,6 +694,10 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
<p>
|
||||
Once a VM is created this setting cannot be adjusted.
|
||||
</p>
|
||||
<p>
|
||||
<b>USB Boot</b><br>
|
||||
Adds support for booting from USB devices using UEFI. No device boot orders can be specified at the same time as this option.<br>
|
||||
</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
@@ -986,7 +1002,7 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
|
||||
<table>
|
||||
<tr><td></td>
|
||||
<td>_(Select)_  _(Optional)_</td></tr></div>
|
||||
<td>_(Select)_  _(Optional)_  _(Boot Order)_</td></tr></div>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>_(USB Devices)_:</td>
|
||||
@@ -997,7 +1013,9 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
foreach($arrVMUSBs as $i => $arrDev) {
|
||||
?>
|
||||
<label for="usb<?=$i?>">    <input type="checkbox" name="usb[]" id="usb<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?if (count(array_filter($arrConfig['usb'], function($arr) use ($arrDev) { return ($arr['id'] == $arrDev['id']); }))) echo 'checked="checked"';?>
|
||||
/>         <input type="checkbox" name="usbopt[]" id="usbopt<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?if ($arrDev["startupPolicy"] =="optional") echo 'checked="checked"';?>/>    <?=htmlspecialchars($arrDev['name'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
|
||||
/>         <input type="checkbox" name="usbopt[<?=htmlspecialchars($arrDev['id'])?>]]" id="usbopt<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?if ($arrDev["startupPolicy"] =="optional") echo 'checked="checked"';?>/>     
|
||||
<input type="number" size="5" maxlength="5" id="usbboot<?=$i?>" class="narrow" <?=$bootdisable?> style="width: 50px;" name="usbboot[<?=htmlspecialchars($arrDev['id'])?>]]" title="_(Boot order)_" value="<?=$arrDev['usbboot']?>" >
|
||||
<?=htmlspecialchars($arrDev['name'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
|
||||
<?
|
||||
}
|
||||
} else {
|
||||
@@ -1039,7 +1057,7 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
$intAvailableOtherPCIDevices++;
|
||||
?>
|
||||
<label for="pci<?=$i?>">    <input type="checkbox" name="pci[]" id="pci<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?=$extra?>/>  
|
||||
<input type="number" size="5" maxlength="5" id="pciboot<?=$i?>" class="narrow" <?=$bootdisable?> style="width: 50px;" name="pciboot[]" title="_(Boot order)_" value="<?=$pciboot?>" >
|
||||
<input type="number" size="5" maxlength="5" id="pciboot<?=$i?>" class="narrow" <?=$bootdisable?> style="width: 50px;" name="pciboot[<?=htmlspecialchars($arrDev['id'])?>]" title="_(Boot order)_" value="<?=$pciboot?>" >
|
||||
<?=htmlspecialchars($arrDev['name'])?> | <?=htmlspecialchars($arrDev['type'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
|
||||
<?
|
||||
}
|
||||
@@ -1117,6 +1135,20 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
<script src="<?autov('/plugins/dynamix.vm.manager/scripts/codemirror/addon/hint/libvirt-schema.js')?>"></script>
|
||||
<script src="<?autov('/plugins/dynamix.vm.manager/scripts/codemirror/mode/xml/xml.js')?>"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function BIOSChange(bios) {
|
||||
var value = bios.value;
|
||||
if (value == "0") {
|
||||
document.getElementById("USBBoottext").style.visibility="hidden";
|
||||
document.getElementById("domain_usbboot").style.visibility="hidden";
|
||||
} else {
|
||||
document.getElementById("USBBoottext").style.display="inline";
|
||||
document.getElementById("USBBoottext").style.visibility="visible";
|
||||
document.getElementById("domain_usbboot").style.display="inline";
|
||||
document.getElementById("domain_usbboot").style.visibility="visible";
|
||||
}
|
||||
}
|
||||
|
||||
function AutoportChange(autoport) {
|
||||
if (autoport.value == "yes") {
|
||||
document.getElementById("port").style.visibility="hidden";
|
||||
|
||||
@@ -654,7 +654,7 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
<tr class="advanced">
|
||||
<td>_(BIOS)_:</td>
|
||||
<td>
|
||||
<select name="domain[ovmf]" id="domain_ovmf" class="narrow" title="_(Select the BIOS)_. _(SeaBIOS will work for most)_. _(OVMF requires a UEFI-compatable OS)_ (_(e.g.)_ _(Windows 8/2012, newer Linux distros)_) _(and if using graphics device passthrough it too needs UEFI)_">
|
||||
<select name="domain[ovmf]" id="domain_ovmf" class="narrow" title="_(Select the BIOS)_. _(SeaBIOS will work for most)_. _(OVMF requires a UEFI-compatable OS)_ (_(e.g.)_ _(Windows 8/2012, newer Linux distros)_) _(and if using graphics device passthrough it too needs UEFI)_" onchange="BIOSChange(this)">
|
||||
<?
|
||||
echo mk_option($arrConfig['domain']['ovmf'], '0', _('SeaBIOS'));
|
||||
|
||||
@@ -665,6 +665,18 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?
|
||||
$usbboothidden = "hidden" ;
|
||||
if ($arrConfig['domain']['ovmf'] != '0') $usbboothidden = "" ;
|
||||
?>
|
||||
<span id="USBBoottext" class="advanced" <?=$usbboothidden?>>_(Enable USB boot)_:</span>
|
||||
|
||||
<select name="domain[usbboot]" id="domain_usbboot" class="narrow" title="_(define OS boot options" <?=$usbboothidden?>>
|
||||
<?
|
||||
echo mk_option($arrConfig['domain']['usbboot'], 'No', 'No');
|
||||
echo mk_option($arrConfig['domain']['usbboot'], 'Yes', 'Yes');
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -681,6 +693,10 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
<p>
|
||||
Once a VM is created this setting cannot be adjusted.
|
||||
</p>
|
||||
<p>
|
||||
<b>USB Boot</b><br>
|
||||
Adds support for booting from USB devices using UEFI. No device boot orders can be specified at the same time as this option.<br>
|
||||
</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
@@ -980,7 +996,7 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
|
||||
<table>
|
||||
<tr><td></td>
|
||||
<td>_(Select)_  _(Optional)_</td></tr></div>
|
||||
<td>_(Select)_  _(Optional)_  _(Boot Order)_</td></tr></div>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>_(USB Devices)_:</td>
|
||||
@@ -991,7 +1007,9 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
foreach($arrVMUSBs as $i => $arrDev) {
|
||||
?>
|
||||
<label for="usb<?=$i?>">    <input type="checkbox" name="usb[]" id="usb<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?if (count(array_filter($arrConfig['usb'], function($arr) use ($arrDev) { return ($arr['id'] == $arrDev['id']); }))) echo 'checked="checked"';?>
|
||||
/>         <input type="checkbox" name="usbopt[]" id="usbopt<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?if ($arrDev["startupPolicy"] =="optional") echo 'checked="checked"';?>/>    <?=htmlspecialchars($arrDev['name'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
|
||||
/>         <input type="checkbox" name="usbopt[<?=htmlspecialchars($arrDev['id'])?>]]" id="usbopt<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?if ($arrDev["startupPolicy"] =="optional") echo 'checked="checked"';?>/>     
|
||||
<input type="number" size="5" maxlength="5" id="usbboot<?=$i?>" class="narrow" <?=$bootdisable?> style="width: 50px;" name="usbboot[<?=htmlspecialchars($arrDev['id'])?>]]" title="_(Boot order)_" value="<?=$arrDev['usbboot']?>" >
|
||||
<?=htmlspecialchars($arrDev['name'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
|
||||
<?
|
||||
}
|
||||
} else {
|
||||
@@ -1033,7 +1051,7 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
$intAvailableOtherPCIDevices++;
|
||||
?>
|
||||
<label for="pci<?=$i?>">    <input type="checkbox" name="pci[]" id="pci<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?=$extra?>/>  
|
||||
<input type="number" size="5" maxlength="5" id="pciboot<?=$i?>" class="narrow" <?=$bootdisable?> style="width: 50px;" name="pciboot[]" title="_(Boot order)_" value="<?=$pciboot?>" >
|
||||
<input type="number" size="5" maxlength="5" id="pciboot<?=$i?>" class="narrow" <?=$bootdisable?> style="width: 50px;" name="pciboot[<?=htmlspecialchars($arrDev['id'])?>]" title="_(Boot order)_" value="<?=$pciboot?>" >
|
||||
<?=htmlspecialchars($arrDev['name'])?> | <?=htmlspecialchars($arrDev['type'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
|
||||
<?
|
||||
}
|
||||
@@ -1111,6 +1129,20 @@ $hdrXML = "<?xml version='1.0' encoding='UTF-8'?>\n"; // XML encoding declaratio
|
||||
<script src="<?autov('/plugins/dynamix.vm.manager/scripts/codemirror/addon/hint/libvirt-schema.js')?>"></script>
|
||||
<script src="<?autov('/plugins/dynamix.vm.manager/scripts/codemirror/mode/xml/xml.js')?>"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function BIOSChange(bios) {
|
||||
var value = bios.value;
|
||||
if (value == "0") {
|
||||
document.getElementById("USBBoottext").style.visibility="hidden";
|
||||
document.getElementById("domain_usbboot").style.visibility="hidden";
|
||||
} else {
|
||||
document.getElementById("USBBoottext").style.display="inline";
|
||||
document.getElementById("USBBoottext").style.visibility="visible";
|
||||
document.getElementById("domain_usbboot").style.display="inline";
|
||||
document.getElementById("domain_usbboot").style.visibility="visible";
|
||||
}
|
||||
}
|
||||
|
||||
function AutoportChange(autoport) {
|
||||
if (autoport.value == "yes") {
|
||||
document.getElementById("port").style.visibility="hidden";
|
||||
|
||||
Reference in New Issue
Block a user