Merge pull request #689 from bergware/mutli-language

Fix regression error
This commit is contained in:
tom mortensen
2020-05-18 07:49:39 -07:00
committed by GitHub
5 changed files with 58 additions and 33 deletions
+30 -1
View File
@@ -2042,4 +2042,33 @@ IMPORTANT NOTE: If adjusting port mappings, do not modify the settings for the
:docker_privileged_help:
For containers that require the use of host-device access directly or need full exposure to host capabilities, this option will need to be selected.
For more information, see this link: <a href="https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities" target="_blank">https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities</a>
:end
:end
; sysdevs help - added May 18, 2020
:sysdevs_iommu_groups_help:
This displays a list of IOMMU groups available on your system along with the output of the `lspci` command for each IOMMU group. The numeric identifiers are used to configure PCI pass-through.
Devices you select will be bound to the vfio-pci driver at boot, which makes them available for assignment to a virtual machine, and also prevents the Linux kernel from automatically binding them to any present host driver.
**Note that selecting a device will bind not only the specified device(s), but *all* other devices in the same IOMMU group as well.**
&nbsp;<i class="fa fa-circle orb green-orb middle"></i>&nbsp;This symbol indicates the device is currently bound to the vfio-pci driver.
&nbsp;<i class="fa fa-retweet grey-orb middle"></i>&nbsp;&nbsp;&nbsp;This symbol indicates the device supports FLR (Function Level Reset).
<input type="checkbox" value="" disabled>&nbsp;&nbsp;If a checkbox is greyed out it means the device is in use by Unraid and can not be passed through.
:end
:sysdevs_thread_pairings_help:
This displays a list of CPU thread pairings.
:end
:sysdevs_usb_devices_help:
This displays the output of the `lsusb` command. The numeric identifiers are used to configure PCI pass-through.
:end
:sysdevs_scsi_devices_help:
This displays the output of the `lsscsi` command. The numeric identifiers are used to configure PCI pass-through.
Note that linux groups ATA, SATA and SAS devices with true SCSI devices.
:end
+13 -25
View File
@@ -29,7 +29,7 @@ $(function(){
$('#t4').load('/webGui/include/SysDevs.php',{table:'t4'});
});
function applyCfg() {
var message = "System Devices: A reboot is required to apply changes";
var message = "_(System Devices)_: _(A reboot is required to apply changes)_";
var string = "BIND=";
var elements = document.getElementById("vfiopci").elements;
for (var i = 0, element; element = elements[i++];) {
@@ -44,53 +44,41 @@ function applyCfg() {
.done(function(d) {
if (d==1) {
addRebootNotice(message);
document.getElementById("warning").innerHTML = "<b>ALERT: Changes saved. Reboot to take effect.</b>";
document.getElementById("warning").innerHTML = "<b>_(ALERT)_: _(Changes saved)_. _(Reboot to take effect)_.</b>";
} else {
removeRebootNotice(message);
document.getElementById("warning").innerHTML = "<b>No changes.</b>";
document.getElementById("warning").innerHTML = "<b>_(No changes)_.</b>";
}
});
}
</script>
**PCI Devices and IOMMU Groups**
**_(PCI Devices and IOMMU Groups)_**
> This displays a list of IOMMU groups available on your system along with the output of the `lspci` command for each IOMMU group. The numeric identifiers are used to configure PCI pass-through.
>
> Devices you select will be bound to the vfio-pci driver at boot, which makes them available for assignment to a virtual machine, and also prevents the Linux kernel from automatically binding them to any present host driver.
>
> **Note that selecting a device will bind not only the specified device(s), but *all* other devices in the same IOMMU group as well.**
>
> &nbsp;<i class="fa fa-circle orb green-orb middle"></i>&nbsp;This symbol indicates the device is currently bound to the vfio-pci driver.
>
> &nbsp;<i class="fa fa-retweet grey-orb middle"></i>&nbsp;&nbsp;&nbsp;This symbol indicates the device supports FLR (Function Level Reset).
>
> <input type="checkbox" value="" disabled>&nbsp;&nbsp;If a checkbox is greyed out it means the device is in use by Unraid and can not be passed through.
:sysdevs_iommu_groups_help:
<?if (strpos(file_get_contents('/proc/cmdline'), 'pcie_acs_override=') !== false):?>
<p class="notice" style="line-height:30px;height:auto">Warning: Your system has booted with the PCIe ACS Override setting enabled. The below list doesn't not reflect the way IOMMU would naturally group devices.<br>
To see natural IOMMU groups for your hardware, go to the <b><a href="/Settings/VMSettings">VM Manager</a></b> page and set the <b>PCIe ACS override</b> setting to <b>Disabled</b>.</p>
<p class="notice" style="line-height:30px;height:auto">_(Warning)_: _(Your system has booted with the PCIe ACS Override setting enabled)_. _(The below list doesn't not reflect the way IOMMU would naturally group devices)_.<br>
<?=my_hyperlink(_("To see natural IOMMU groups for your hardware, go to the [VM Manager] page and set the **PCIe ACS override** setting to **Disabled**"),'/Settings/VMSettings')?>.</p>
<?endif;?>
<pre><form id="vfiopci" onsubmit="return false"><table id='t1' class='pre'><tr><td><div class="spinner"></div></td></tr></table></form></pre><br>
**CPU Thread Pairings**
**_(CPU Thread Pairings)_**
> This displays a list of CPU thread pairings.
:sysdevs_thread_pairings_help:
<pre><table id='t2' class='pre'><tr><td><div class="spinner"></div></td></tr></table></pre><br>
**USB Devices**
**_(USB Devices)_**
> This displays the output of the `lsusb` command. The numeric identifiers are used to configure PCI pass-through.
:sysdevs_usb_devices_help:
<pre><table id='t3' class='pre'><tr><td><div class="spinner"></div></td></tr></table></pre><br>
**SCSI Devices**
**_(SCSI Devices)_**
> This displays the output of the `lsscsi` command. The numeric identifiers are used to configure PCI pass-through.
>
> Note that linux groups ATA, SATA and SAS devices with true SCSI devices.
:sysdevs_scsi_devices_help:
<pre><table id='t4' class='pre'><tr><td><div class="spinner"></div></td></tr></table></pre>
<input type="button" value="_(Done)_" onclick="done()">
@@ -72,7 +72,7 @@ if ($themes2) {
}
$notes = '/var/tmp/unRAIDServer.txt';
if (!file_exists($notes)) file_put_contents($notes,shell_exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin changes $docroot/plugins/unRAIDServer/unRAIDServer.plg"));
$notes = "&nbsp;<a href='#' title=\""._('View Release Notes')."\" onclick=\"openBox('/plugins/dynamix.plugin.manager/include/ShowChanges.php?tmp=1&file=$notes',\""._('Release Notes')."\",600,900);return false\"><span class='fa fa-info-circle fa-fw'></span></a>"
$notes = "&nbsp;<a href='#' title=\""._('View Release Notes')."\" onclick=\"openBox('/plugins/dynamix.plugin.manager/include/ShowChanges.php?tmp=1&file=$notes','"._('Release Notes')."',600,900);return false\"><span class='fa fa-info-circle fa-fw'></span></a>"
?>
</style>
+3
View File
@@ -59,6 +59,9 @@ function my_disk($name,$raw=false) {
function my_disks($disk) {
return strpos($disk['status'],'_NP')===false;
}
function my_hyperlink($text,$link) {
return str_replace(['[',']'],["<a href=\"$link\">","</a>"],$text);
}
function prefix($key) {
return preg_replace('/\d+$/','',$key);
}
+11 -6
View File
@@ -11,6 +11,11 @@
*/
?>
<?
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
// add translations
$_SERVER['REQUEST_URI'] = 'tools';
require_once "$docroot/webGui/include/Translations.php";
switch ($_POST['table']) {
case 't1':
exec('for group in $(ls /sys/kernel/iommu_groups/ -1|sort -n);do echo "IOMMU group $group";for device in $(ls -1 "/sys/kernel/iommu_groups/$group"/devices/);do echo -n $\'\t\';lspci -ns "$device"|awk \'BEGIN{ORS=" "}{print "["$3"]"}\';lspci -s "$device";done;done',$groups);
@@ -69,14 +74,14 @@ case 't1':
echo ($append)?"":"<tr><td></td><td>";
exec("lspci -v -s $pciaddress", $outputvfio);
if (preg_grep("/vfio-pci/i", $outputvfio)) {
echo "<i class=\"fa fa-circle orb green-orb middle\" title=\"Kernel driver in use: vfio-pci\"></i>";
echo "<i class=\"fa fa-circle orb green-orb middle\" title=\""._('Kernel driver in use: vfio-pci')."\"></i>";
$isbound = "true";
}
echo "</td><td>";
if ((strpos($line, 'Host bridge') === false) && (strpos($line, 'PCI bridge') === false)) {
if (file_exists('/sys/kernel/iommu_groups/'.$iommu.'/devices/0000:'.$pciaddress.'/reset')) echo "<i class=\"fa fa-retweet grey-orb middle\" title=\"Function Level Reset (FLR) supported.\"></i>";
if (file_exists('/sys/kernel/iommu_groups/'.$iommu.'/devices/0000:'.$pciaddress.'/reset')) echo "<i class=\"fa fa-retweet grey-orb middle\" title=\""._('Function Level Reset (FLR) supported').".\"></i>";
echo "</td><td>";
echo in_array($iommu, $iommuinuse) ? ' <input type="checkbox" value="" title="In use by Unraid" disabled ' : ' <input type="checkbox" class="iommu'.$iommu.'" value="'.$pciaddress.'" ';
echo in_array($iommu, $iommuinuse) ? ' <input type="checkbox" value="" title="'._('In use by Unraid').'" disabled ' : ' <input type="checkbox" class="iommu'.$iommu.'" value="'.$pciaddress.'" ';
echo (strpos($file, $pciaddress) !== false) ? " checked>" : ">";
} else { echo "</td><td>"; }
echo '</td><td title="';
@@ -86,7 +91,7 @@ case 't1':
switch (true) {
case (strpos($line, 'USB controller') !== false):
if ($isbound) {
echo '<tr><td></td><td></td><td></td><td></td><td style="padding-left: 50px;">This controller is bound to vfio, connected USB devices are not visible.</td></tr>';
echo '<tr><td></td><td></td><td></td><td></td><td style="padding-left: 50px;">'._('This controller is bound to vfio, connected USB devices are not visible').'.</td></tr>';
} else {
exec('for usb_ctrl in $(find /sys/bus/usb/devices/usb* -maxdepth 0 -type l);do path="$(realpath "${usb_ctrl}")";if [[ $path == *'.$pciaddress.'* ]];then bus="$(cat "${usb_ctrl}/busnum")";lsusb -s $bus:|sort;fi;done',$getusb);
foreach($getusb as $usbdevice) {
@@ -103,7 +108,7 @@ case 't1':
case (strpos($line, 'Mass storage controller') !== false):
case (strpos($line, 'Non-Volatile memory controller') !== false):
if ($isbound) {
echo '<tr><td></td><td></td><td></td><td></td><td style="padding-left: 50px;">This controller is bound to vfio, connected drives are not visible.</td></tr>';
echo '<tr><td></td><td></td><td></td><td></td><td style="padding-left: 50px;">'._('This controller is bound to vfio, connected drives are not visible').'.</td></tr>';
} else {
exec('ls -al /sys/block/sd* | grep -i "'.$pciaddress.'"',$getsata);
exec('ls -al /sys/block/hd* | grep -i "'.$pciaddress.'"',$getsata);
@@ -125,7 +130,7 @@ case 't1':
$append = false;
}
}
echo '<tr><td></td><td></td><td></td><td></td><td><br><input id="applycfg" type="submit" value="Bind selected to VFIO at Boot" onclick="applyCfg();" '.(($noiommu) ? "style=\"display:none\"" : "").'><span id="warning"></span></td></tr>';
echo '<tr><td></td><td></td><td></td><td></td><td><br><input id="applycfg" type="submit" value="'._('Bind selected to VFIO at Boot').'" onclick="applyCfg();" '.($noiommu ? "style=\"display:none\"" : "").'><span id="warning"></span></td></tr>';
}
break;
case 't2':