mirror of
https://github.com/unraid/webgui.git
synced 2026-04-22 10:08:25 -05:00
VM Settings: show warnings next to paths when array is stopped or when they are invalid; hide vdisk size under advanced view
This commit is contained in:
@@ -119,16 +119,15 @@ if ($boolACSEnabled != $boolACSInSyslinux) {
|
||||
<select id="SERVICE" name="SERVICE" class="narrow">
|
||||
<?= mk_option($libvirt_service, 'disable', 'No'); ?>
|
||||
<?= mk_option($libvirt_service, 'enable', 'Yes'); ?>
|
||||
</select> <?if ($var['fsState'] != "Started"):?><span id="arraystopped"><i class="fa fa-warning icon warning"></i> <?=($libvirt_service=='enable')?'VMs will be available after Array is Started':'Apply to activate VMs after Array is Started'?></span><?endif;?>
|
||||
</select> <?if ($var['fsState'] != "Started"):?><span id="arraystopped"><i class="fa fa-warning icon warning"></i> <?=($libvirt_service=='enable')?'VMs will be available after Array is Started':'Apply to activate VMs after Array is Started'?></span><?elseif (!is_dir(dirname($domain_cfg['IMAGE_FILE'])) || !is_dir($domain_cfg['DOMAINDIR']) || !is_dir($domain_cfg['MEDIADIR'])):?><span class="basic" style="display:inline"><i class="fa fa-warning icon warning"></i> One or more paths do not exist (<a href="#" onclick="$('.advancedview').switchButton('option','checked',true); return false">view</a>)</span><?endif;?>
|
||||
</dd>
|
||||
</dl>
|
||||
<blockquote class="inline_help">
|
||||
<p>Stopping the VM Manager will first attempt to shutdown all running VMs. After 40 seconds, any remaining VM instances will be terminated.</p>
|
||||
</blockquote>
|
||||
|
||||
<?if ($libvirt_running == 'yes'):?>
|
||||
|
||||
<div class="advanced">
|
||||
<?if ($libvirt_running == 'yes'):?>
|
||||
<dl>
|
||||
<dt>Libvirt version:</dt>
|
||||
<dd><? $libvirt_info = libvirt_version('libvirt'); echo $libvirt_info['libvirt.major'].'.'.$libvirt_info['libvirt.minor'].'.'.$libvirt_info['libvirt.release']; ?></dd>
|
||||
@@ -147,19 +146,18 @@ if ($boolACSEnabled != $boolACSInSyslinux) {
|
||||
<p>This is the libvirt volume.</p>
|
||||
</blockquote>
|
||||
<?else: /* Libvirt is stopped */ ?>
|
||||
<dl>
|
||||
<dt>Libvirt vdisk size:</dt>
|
||||
<dd><input id="IMAGE_SIZE" type="number" min="1" name="IMAGE_SIZE" value="<?=$domain_cfg['IMAGE_SIZE'];?>" style="width:50px;" required="required" />GB <span id="SIZE_ERROR" class="errortext"></span></dd>
|
||||
</dl>
|
||||
<blockquote class="inline_help">
|
||||
<p>If the system needs to create a new libvirt image file, this is the default size to use specified in GB.</p>
|
||||
<p>To resize an existing image file, specify the new size here. Next time the Libvirt service is started the file (and file system) will increased to the new size (but never decreased).</p>
|
||||
</blockquote>
|
||||
<dl>
|
||||
<dt>Libvirt vdisk size:</dt>
|
||||
<dd><input id="IMAGE_SIZE" type="number" min="1" name="IMAGE_SIZE" value="<?=$domain_cfg['IMAGE_SIZE'];?>" style="width:50px;" required="required" />GB <span id="SIZE_ERROR" class="errortext"></span></dd>
|
||||
</dl>
|
||||
<blockquote class="inline_help">
|
||||
<p>If the system needs to create a new libvirt image file, this is the default size to use specified in GB.</p>
|
||||
<p>To resize an existing image file, specify the new size here. Next time the Libvirt service is started the file (and file system) will increased to the new size (but never decreased).</p>
|
||||
</blockquote>
|
||||
|
||||
<div class="advanced">
|
||||
<dl>
|
||||
<dt>Libvirt storage location:</dt>
|
||||
<dd><input id="IMAGE_FILE" type="text" name="IMAGE_FILE" value="<?=$domain_cfg['IMAGE_FILE'];?>" placeholder="e.g. /mnt/user/system/libvirt/libvirt.img" data-pickcloseonfile="true" data-pickfilter="img" data-pickroot="/mnt/" data-pickfolders="true" required="required" /> <?php if (file_exists($domain_cfg['IMAGE_FILE'])) { ?><span id="deletePanel"><label><input type="checkbox" id="deleteCheckbox" /> Delete Image File</label></span><?php } ?> <span id="IMAGE_ERROR" class="errortext"></span></dd>
|
||||
<dd><input id="IMAGE_FILE" type="text" name="IMAGE_FILE" value="<?=$domain_cfg['IMAGE_FILE'];?>" placeholder="e.g. /mnt/user/system/libvirt/libvirt.img" data-pickcloseonfile="true" data-pickfilter="img" data-pickroot="/mnt/" data-pickfolders="true" required="required" /> <?php if (file_exists($domain_cfg['IMAGE_FILE'])) { ?><span id="deletePanel"><label><input type="checkbox" id="deleteCheckbox" /> Delete Image File</label></span><?php } ?> <?if ($var['fsState'] != "Started"):?><span><i class="fa fa-warning icon warning"></i> Modify with caution: unable to validate path until Array is Started</span><?elseif (!is_dir(dirname($domain_cfg['IMAGE_FILE']))):?><span><i class="fa fa-warning icon warning"></i> Path does not exist</span><?endif;?> <span id="IMAGE_ERROR" class="errortext"></span></dd>
|
||||
</dl>
|
||||
<blockquote class="inline_help">
|
||||
<p>You must specify an image file for Libvirt. The system will automatically create this file when the Libvirt service is first started.</p>
|
||||
@@ -168,7 +166,7 @@ if ($boolACSEnabled != $boolACSInSyslinux) {
|
||||
|
||||
<dl>
|
||||
<dt>Default VM storage path:</dt>
|
||||
<dd><input type="text" id="domaindir" data-pickfolders="true" data-pickfilter="NO_FILES_FILTER" data-pickroot="<?= (is_dir('/mnt/user/') ? '/mnt/user/' : '/mnt/') ?>" name="DOMAINDIR" value="<?=$domain_cfg['DOMAINDIR']?>" placeholder="Click to Select"></dd>
|
||||
<dd><input type="text" id="domaindir" data-pickfolders="true" data-pickfilter="NO_FILES_FILTER" data-pickroot="<?= (is_dir('/mnt/user/') ? '/mnt/user/' : '/mnt/') ?>" name="DOMAINDIR" value="<?=$domain_cfg['DOMAINDIR']?>" placeholder="Click to Select"> <?if ($var['fsState'] != "Started"):?><span><i class="fa fa-warning icon warning"></i> Modify with caution: unable to validate path until Array is Started</span><?elseif (!is_dir($domain_cfg['DOMAINDIR'])):?><span><i class="fa fa-warning icon warning"></i> Path does not exist</span><?endif;?></dd>
|
||||
</dl>
|
||||
<blockquote class="inline_help">
|
||||
<p>Specify a user share that contains all your VM subdirectories with vdisks</p>
|
||||
@@ -176,55 +174,53 @@ if ($boolACSEnabled != $boolACSInSyslinux) {
|
||||
|
||||
<dl>
|
||||
<dt>Default ISO storage path:</dt>
|
||||
<dd><input type="text" id="mediadir" data-pickfolders="true" data-pickfilter="NO_FILES_FILTER" data-pickroot="<?= (is_dir('/mnt/user/') ? '/mnt/user/' : '/mnt/') ?>" name="MEDIADIR" value="<?=$domain_cfg['MEDIADIR']?>" placeholder="Click to Select"></dd>
|
||||
<dd><input type="text" id="mediadir" data-pickfolders="true" data-pickfilter="NO_FILES_FILTER" data-pickroot="<?= (is_dir('/mnt/user/') ? '/mnt/user/' : '/mnt/') ?>" name="MEDIADIR" value="<?=$domain_cfg['MEDIADIR']?>" placeholder="Click to Select"> <?if ($var['fsState'] != "Started"):?><span><i class="fa fa-warning icon warning"></i> Modify with caution: unable to validate path until Array is Started</span><?elseif (!is_dir($domain_cfg['MEDIADIR'])):?><span><i class="fa fa-warning icon warning"></i> Path does not exist</span><?endif;?></dd>
|
||||
</dl>
|
||||
<blockquote class="inline_help">
|
||||
<p>Specify a user share that contains all your installation media for operating systems</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<dl>
|
||||
<dt>Default Windows VirtIO driver ISO <span style="font-weight: normal">(optional)</span>:</dt>
|
||||
<dd>
|
||||
<select id="winvirtio_select" class="narrow">
|
||||
<?
|
||||
$iso_dir = $domain_cfg['MEDIADIR'];
|
||||
if (empty($iso_dir) || !is_dir($iso_dir)) {
|
||||
$iso_dir = '/mnt/user/isos/';
|
||||
} else {
|
||||
$iso_dir = str_replace('//', '/', $iso_dir.'/');
|
||||
}
|
||||
|
||||
$strManual = '';
|
||||
if (!empty($domain_cfg['MEDIADIR']) &&
|
||||
!empty($domain_cfg['VIRTIOISO']) &&
|
||||
dirname($domain_cfg['VIRTIOISO']) != '.' &&
|
||||
strpos($iso_dir, dirname($domain_cfg['VIRTIOISO'])) !== 0) {
|
||||
$strManual = 'manual';
|
||||
}
|
||||
|
||||
$strMatch = $strManual;
|
||||
foreach ($virtio_isos as $key => $value) {
|
||||
if (empty($strMatch) &&
|
||||
(basename($domain_cfg['VIRTIOISO']) == $value['name']) &&
|
||||
is_file($iso_dir.$value['name'])
|
||||
) {
|
||||
$strMatch = $value['name'];
|
||||
<dl>
|
||||
<dt>Default Windows VirtIO driver ISO <span style="font-weight: normal">(optional)</span>:</dt>
|
||||
<dd>
|
||||
<select id="winvirtio_select" class="narrow">
|
||||
<?
|
||||
$iso_dir = $domain_cfg['MEDIADIR'];
|
||||
if (empty($iso_dir) || !is_dir($iso_dir)) {
|
||||
$iso_dir = '/mnt/user/isos/';
|
||||
} else {
|
||||
$iso_dir = str_replace('//', '/', $iso_dir.'/');
|
||||
}
|
||||
echo mk_option($strMatch, $value['name'], $value['name']);
|
||||
}
|
||||
|
||||
echo mk_option($strManual, 'manual', 'Manual');
|
||||
?>
|
||||
</select><input type="text" id="winvirtio" name="VIRTIOISO" data-pickfilter="iso" data-pickcloseonfile="true" data-pickroot="<?= (is_dir('/mnt/user/') ? '/mnt/user/' : '/mnt/') ?>" value="<?=$domain_cfg['VIRTIOISO']?>"<?if ($var['fsState'] == "Started"):?> placeholder="Click to Select"><i class="fa fa-download" id="download_button" title="Download Windows VirtIO driver ISO"> <span>Download</span></i><span id="download_status"></span<?endif;?>>
|
||||
</dd>
|
||||
</dl>
|
||||
<blockquote class="inline_help">
|
||||
<p>Specify the virtual CD-ROM (ISO) that contains the VirtIO Windows drivers as provided by the Fedora Project. Download the latest ISO from here: <a href="https://fedoraproject.org/wiki/Windows_Virtio_Drivers#Direct_download" target="_blank">https://fedoraproject.org/wiki/Windows_Virtio_Drivers#Direct_download</a></p>
|
||||
<p>When installing Windows, you will reach a step where no disk devices will be found. There is an option to browse for drivers on that screen. Click browse and locate the additional CD-ROM in the menu. Inside there will be various folders for the different versions of Windows. Open the folder for the version of Windows you are installing and then select the AMD64 subfolder inside (even if you are on an Intel system, select AMD64). Three drivers will be found. Select them all, click next, and the vDisks you have assigned will appear.</p>
|
||||
</blockquote>
|
||||
$strManual = '';
|
||||
if (!empty($domain_cfg['MEDIADIR']) &&
|
||||
!empty($domain_cfg['VIRTIOISO']) &&
|
||||
dirname($domain_cfg['VIRTIOISO']) != '.' &&
|
||||
strpos($iso_dir, dirname($domain_cfg['VIRTIOISO'])) !== 0) {
|
||||
$strManual = 'manual';
|
||||
}
|
||||
|
||||
$strMatch = $strManual;
|
||||
foreach ($virtio_isos as $key => $value) {
|
||||
if (empty($strMatch) &&
|
||||
(basename($domain_cfg['VIRTIOISO']) == $value['name']) &&
|
||||
is_file($iso_dir.$value['name'])
|
||||
) {
|
||||
$strMatch = $value['name'];
|
||||
}
|
||||
echo mk_option($strMatch, $value['name'], $value['name']);
|
||||
}
|
||||
|
||||
echo mk_option($strManual, 'manual', 'Manual');
|
||||
?>
|
||||
</select><input type="text" id="winvirtio" name="VIRTIOISO" data-pickfilter="iso" data-pickcloseonfile="true" data-pickroot="<?= (is_dir('/mnt/user/') ? '/mnt/user/' : '/mnt/') ?>" value="<?=$domain_cfg['VIRTIOISO']?>"<?if ($var['fsState'] == "Started"):?> placeholder="Click to Select"><i class="fa fa-download" id="download_button" title="Download Windows VirtIO driver ISO"> <span>Download</span></i><span id="download_status"></span<?endif;?>>
|
||||
</dd>
|
||||
</dl>
|
||||
<blockquote class="inline_help">
|
||||
<p>Specify the virtual CD-ROM (ISO) that contains the VirtIO Windows drivers as provided by the Fedora Project. Download the latest ISO from here: <a href="https://fedoraproject.org/wiki/Windows_Virtio_Drivers#Direct_download" target="_blank">https://fedoraproject.org/wiki/Windows_Virtio_Drivers#Direct_download</a></p>
|
||||
<p>When installing Windows, you will reach a step where no disk devices will be found. There is an option to browse for drivers on that screen. Click browse and locate the additional CD-ROM in the menu. Inside there will be various folders for the different versions of Windows. Open the folder for the version of Windows you are installing and then select the AMD64 subfolder inside (even if you are on an Intel system, select AMD64). Three drivers will be found. Select them all, click next, and the vDisks you have assigned will appear.</p>
|
||||
</blockquote>
|
||||
|
||||
<div class="advanced">
|
||||
<dl>
|
||||
<dt>Default network bridge:</dt>
|
||||
<dd>
|
||||
|
||||
Reference in New Issue
Block a user