mirror of
https://github.com/unraid/webgui.git
synced 2026-01-28 20:49:04 -06:00
Merge pull request #554 from bergware/master
Add shares: slashes are not allowed in share name
This commit is contained in:
@@ -4,9 +4,9 @@ Icon="icon-docker"
|
||||
Tag="icon-docker"
|
||||
---
|
||||
<?PHP
|
||||
/* Copyright 2005-2018, Lime Technology
|
||||
* Copyright 2014-2018, Guilherme Jardim, Eric Schultz, Jon Panozzo.
|
||||
* Copyright 2012-2018, Bergware International.
|
||||
/* Copyright 2005-2019, Lime Technology
|
||||
* Copyright 2014-2019, Guilherme Jardim, Eric Schultz, Jon Panozzo.
|
||||
* Copyright 2012-2019, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
@@ -133,7 +133,7 @@ span.disabled{color:#404040}
|
||||
</style>
|
||||
<span class="status vhshift"><input type="checkbox" class="advancedview"></span>
|
||||
|
||||
<form markdown="1" id="settingsForm" name="settingsForm" method="POST" action="/update.php" target="progressFrame" onsubmit="prepareDocker(this)">
|
||||
<form markdown="1" id="settingsForm" name="settingsForm" method="POST" action="/update.php" target="progressFrame" onsubmit="return prepareDocker(this)">
|
||||
<input type="hidden" name="#file" value="<?=$docker_cfgfile?>">
|
||||
<input type="hidden" name="#include" value="/plugins/dynamix.docker.manager/include/PruneConfig.php">
|
||||
<input type="hidden" name="#command" value="/plugins/dynamix/scripts/emcmd">
|
||||
@@ -165,7 +165,7 @@ Docker vDisk size:
|
||||
> To resize an existing image file, specify the new size here. Next time the Docker service is started the file (and file system) will increased to the new size (but never decreased).
|
||||
|
||||
Docker vDisk location:
|
||||
: <input id="DOCKER_IMAGE_FILE" type="text" name="DOCKER_IMAGE_FILE" value="<?=$dockercfg['DOCKER_IMAGE_FILE']?>" placeholder="e.g. /mnt/disk1/docker.img" data-pickcloseonfile="true" data-pickfilter="img" data-pickroot="/mnt/" data-pickfolders="true" required="required">
|
||||
: <input id="DOCKER_IMAGE_FILE" type="text" name="DOCKER_IMAGE_FILE" value="<?=$dockercfg['DOCKER_IMAGE_FILE']?>" placeholder="e.g. /mnt/disk1/docker.img" data-pickcloseonfile="true" data-pickfilter="img" data-pickroot="/mnt/" data-pickfolders="true" required="required" pattern="^[^\\]*\.(img|IMG)$">
|
||||
<?if (file_exists($dockercfg['DOCKER_IMAGE_FILE'])):?>
|
||||
<span id="deletePanel"><label><input type="checkbox" id="deleteCheckbox"> Delete Image File</label></span>
|
||||
<?endif;?>
|
||||
@@ -180,7 +180,7 @@ Docker vDisk location:
|
||||
> It is recommended to create this image file outside the array, e.g. on the Cache pool. For best performance SSD devices are preferred.
|
||||
|
||||
Default appdata storage location:
|
||||
: <input id="DOCKER_APP_CONFIG_PATH" type="text" name="DOCKER_APP_CONFIG_PATH" value="<?=$dockercfg['DOCKER_APP_CONFIG_PATH']?>" placeholder="e.g. /mnt/user/appdata" data-pickfilter="HIDE_FILES_FILTER" data-pickroot="<?=(is_dir('/mnt/user/') ? '/mnt/user/' : '/mnt/')?>" data-pickfolders="true">
|
||||
: <input id="DOCKER_APP_CONFIG_PATH" type="text" name="DOCKER_APP_CONFIG_PATH" value="<?=$dockercfg['DOCKER_APP_CONFIG_PATH']?>" placeholder="e.g. /mnt/user/appdata" data-pickfilter="HIDE_FILES_FILTER" data-pickroot="<?=(is_dir('/mnt/user/') ? '/mnt/user/' : '/mnt/')?>" data-pickfolders="true" pattern="^[^\\]*/$">
|
||||
<?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($dockercfg['DOCKER_APP_CONFIG_PATH'])):?>
|
||||
@@ -560,6 +560,14 @@ btrfs scrub status:
|
||||
<script src="<?autov('/webGui/javascript/jquery.switchbutton.js')?>"></script>
|
||||
<script>
|
||||
function prepareDocker(form) {
|
||||
var bye = false;
|
||||
$(form).find('input[type="text"]').each(function(){
|
||||
if ($(this).attr('pattern')) {
|
||||
var pattern = new RegExp($(this).attr('pattern'));
|
||||
if (!pattern.test($(this).val())) {$(this).css('color','red'); bye = true;}
|
||||
}
|
||||
});
|
||||
if (bye) return false;
|
||||
$(form).find('input:hidden[name^="DOCKER_DHCP_"]').each(function(){
|
||||
var id = '#'+$(this).attr('name')+'_';
|
||||
if ($(id+'dhcp').prop('checked') && $(id+'edit').prop('checked')) {
|
||||
@@ -631,6 +639,7 @@ function prepareDocker(form) {
|
||||
}
|
||||
$(size6).prop('disabled',true);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
function changeEdit(id,ip) {
|
||||
var checked = $('#'+id).prop('checked');
|
||||
|
||||
@@ -4,9 +4,9 @@ Icon="icon-virtualization"
|
||||
Tag="columns"
|
||||
---
|
||||
<?PHP
|
||||
/* Copyright 2005-2018, Lime Technology
|
||||
* Copyright 2015-2018, Derek Macias, Eric Schultz, Jon Panozzo.
|
||||
* Copyright 2012-2018, Bergware International.
|
||||
/* Copyright 2005-2019, Lime Technology
|
||||
* Copyright 2015-2019, Derek Macias, Eric Schultz, Jon Panozzo.
|
||||
* Copyright 2012-2019, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
@@ -118,18 +118,18 @@ Libvirt vdisk size:
|
||||
> 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).
|
||||
|
||||
Libvirt storage location:
|
||||
: <input id="IMAGE_FILE" type="text" name="IMAGE_FILE" value="<?=htmlspecialchars($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>
|
||||
: <input id="IMAGE_FILE" type="text" name="IMAGE_FILE" value="<?=htmlspecialchars($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 pattern="^[^\\]*\.(img|IMG)$"> <?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>
|
||||
|
||||
> You must specify an image file for Libvirt. The system will automatically create this file when the Libvirt service is first started.
|
||||
|
||||
<?endif;?>
|
||||
Default VM storage path:
|
||||
: <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="<?=htmlspecialchars($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;?>
|
||||
: <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="<?=htmlspecialchars($domain_cfg['DOMAINDIR'])?>" placeholder="Click to Select" pattern="^[^\\]*/$"> <?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;?>
|
||||
|
||||
> Specify a user share that contains all your VM subdirectories with vdisks
|
||||
|
||||
Default ISO storage path:
|
||||
: <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="<?=htmlspecialchars($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;?>
|
||||
: <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="<?=htmlspecialchars($domain_cfg['MEDIADIR'])?>" placeholder="Click to Select" pattern="^[^\\]*/$"> <?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;?>
|
||||
|
||||
> Specify a user share that contains all your installation media for operating systems
|
||||
|
||||
@@ -154,7 +154,7 @@ Default Windows VirtIO driver ISO <span style="font-weight: normal">(optional)</
|
||||
}
|
||||
echo mk_option($strMatch, '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="<?=htmlspecialchars($domain_cfg['VIRTIOISO'])?>"<?if ($var['fsState'] == "Started"):?> placeholder="Click to Select"><i class="fa fa-trash" id="remove_button" title="Remove Windows VirtIO driver ISO"> <span>Remove</span></i><i class="fa fa-download" id="download_button" title="Download Windows VirtIO driver ISO"> <span>Download</span></i><span id="download_status"></span<?endif;?>>
|
||||
</select><input type="text" id="winvirtio" name="VIRTIOISO" data-pickfilter="iso" data-pickcloseonfile="true" data-pickroot="<?= (is_dir('/mnt/user/') ? '/mnt/user/' : '/mnt/') ?>" value="<?=htmlspecialchars($domain_cfg['VIRTIOISO'])?>"<?if ($var['fsState'] == "Started"):?> placeholder="Click to Select" pattern="^[^\\]*\.(iso|ISO)$"><i class="fa fa-trash" id="remove_button" title="Remove Windows VirtIO driver ISO"> <span>Remove</span></i><i class="fa fa-download" id="download_button" title="Download Windows VirtIO driver ISO"> <span>Download</span></i><span id="download_status"></span<?endif;?>>
|
||||
|
||||
> 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://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads" target="_blank">fedoraproject.org</a>
|
||||
@@ -291,10 +291,17 @@ $(function(){
|
||||
$("#removeForm").submit();
|
||||
return;
|
||||
}
|
||||
var run = true;
|
||||
$("#settingsForm").find('input[type="text"]').each(function(){
|
||||
if ($(this).attr('pattern')) {
|
||||
var pattern = new RegExp($(this).attr('pattern'));
|
||||
if (!pattern.test($(this).val())) {$(this).css('color','red'); run = false;}
|
||||
}
|
||||
});
|
||||
<?if ($safemode):?>
|
||||
$("#settingsForm").submit();
|
||||
if (run) $("#settingsForm").submit();
|
||||
<?else:?>
|
||||
$.post("/plugins/dynamix.vm.manager/include/VMajax.php", {action:'syslinux',pcie:$('#pcie_acs_override').val(),vfio:$('#vfio_allow_unsafe').val()}, function(data){
|
||||
if (run) $.post("/plugins/dynamix.vm.manager/include/VMajax.php", {action:'syslinux',pcie:$('#pcie_acs_override').val(),vfio:$('#vfio_allow_unsafe').val()}, function(data){
|
||||
$("#settingsForm").submit();
|
||||
});
|
||||
<?endif;?>
|
||||
|
||||
@@ -93,7 +93,7 @@ foreach ($rows as $row) echo $row;
|
||||
<input type="hidden" name="shareNameOrig" value="<?=htmlspecialchars($share['nameOrig'])?>">
|
||||
|
||||
Share name:
|
||||
: <input type="text" name="shareName" maxlength="40" value="<?=htmlspecialchars($name)?>">
|
||||
: <input type="text" name="shareName" maxlength="40" value="<?=htmlspecialchars($name)?>" pattern="^[^/\\]*$" title="Slashes are not allowed">
|
||||
|
||||
> The share name can be up to 40 characters, and is case-sensitive with these restrictions:
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user