Compare commits

48 Commits

Author SHA1 Message Date
2ed7eb52cc „plugins/Unraid-Kernel-Helper.plg“ ändern 2021-08-10 15:56:43 +02:00
b2caf92b5a „plugins/Unraid-Kernel-Helper.plg“ ändern 2021-03-17 09:50:33 +01:00
c98b2078c8 Dateien hochladen nach „archive“ 2021-03-17 09:35:43 +01:00
d934fc7965 „source/makepkg.sh“ ändern 2021-03-12 14:16:45 +01:00
1f797c5827 „source/makepkg.sh“ ändern 2021-03-11 19:23:09 +01:00
65d7fce219 „plugins/Unraid-Kernel-Helper.plg“ ändern 2021-03-11 19:13:06 +01:00
b97be91a3b Dateien hochladen nach „archive“ 2021-03-11 19:12:51 +01:00
210cbda747 „plugins/Unraid-Kernel-Helper.plg“ ändern 2021-03-11 19:06:29 +01:00
9fdf6b1600 „plugins/Unraid-Kernel-Helper.plg“ ändern 2021-03-11 19:06:07 +01:00
78de3e5751 Dateien hochladen nach „archive“ 2021-03-11 19:05:33 +01:00
a4f78ca811 „plugins/Unraid-Kernel-Helper.plg“ ändern 2021-01-04 18:59:24 +01:00
2f440dad99 „plugins/Unraid-Kernel-Helper.plg“ ändern 2021-01-04 18:53:31 +01:00
260bf07e40 Dateien hochladen nach „archive“ 2021-01-04 18:53:02 +01:00
ac4115d862 „plugins/Unraid-Kernel-Helper.plg“ ändern 2021-01-04 18:40:52 +01:00
7c652ef30a Dateien hochladen nach „archive“ 2021-01-04 18:39:09 +01:00
85b00dc7ac Dateien hochladen nach „source/usr/local/emhttp/plugins/Unraid-Kernel-Helper“ 2020-11-04 23:23:34 +01:00
6163da9103 „plugins/Unraid-Kernel-Helper.plg“ ändern 2020-11-04 23:18:12 +01:00
582484c75a Dateien hochladen nach „archive“ 2020-11-04 23:17:58 +01:00
2dc32e1f78 fixed bug that page doesn't show up 2020-11-04 22:52:39 +01:00
87133f6d61 „plugins/Unraid-Kernel-Helper.plg“ ändern 2020-11-04 22:51:17 +01:00
26fbb5c7f3 Dateien hochladen nach „archive“ 2020-11-04 22:50:27 +01:00
47a676062c Dateien hochladen nach „source/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include“ 2020-10-28 19:03:03 +01:00
04e5981851 Dateien hochladen nach „source/usr/local/emhttp/plugins/Unraid-Kernel-Helper“ 2020-10-28 19:02:38 +01:00
aa6ff1ebf4 Dateien hochladen nach „archive“ 2020-10-28 19:01:19 +01:00
bc28370373 „plugins/Unraid-Kernel-Helper.plg“ ändern 2020-10-28 19:01:09 +01:00
cf82afa57c Added basic GUI for creation/deletion of IQNs,FileIO/Block Volumes, LUNs, ACL's 2020-10-28 18:53:16 +01:00
20ac57233b Dateien hochladen nach „archive“ 2020-10-28 18:51:47 +01:00
57103ff1df „plugins/Unraid-Kernel-Helper.plg“ ändern 2020-10-27 23:20:39 +01:00
0251f52517 added README.md 2020-10-27 23:17:44 +01:00
e0edda61c9 „README.md“ löschen 2020-10-27 23:11:01 +01:00
312fa794e1 corrected changelog 2020-10-27 23:08:12 +01:00
98b9878fa4 fixed icons 2020-10-27 23:03:43 +01:00
e3e892ec89 Dateien hochladen nach „source/usr/local/emhttp/plugins/Unraid-Kernel-Helper/images“ 2020-10-27 23:03:07 +01:00
0cc3e64221 code cleanup 2020-10-27 23:02:59 +01:00
b04695cdf0 „source/usr/local/emhttp/plugins/Unraid-Kernel-Helper/README.md“ löschen 2020-10-27 23:02:43 +01:00
751a9abdbd Dateien hochladen nach „archive“ 2020-10-27 23:02:21 +01:00
01b1a44d00 exclude README.md 2020-10-27 22:42:35 +01:00
e2df9a5984 „plugins/Unraid-Kernel-Helper.plg“ ändern 2020-07-30 19:33:30 +02:00
ffae6e883a „source/usr/local/emhttp/plugins/Unraid-Kernel-Helper/Unraid-Kernel-Helper.page“ ändern 2020-07-30 19:31:43 +02:00
9d364d3631 Dateien hochladen nach „archive“ 2020-07-30 19:31:24 +02:00
7a596f3e10 „plugins/Unraid-Kernel-Helper.plg“ ändern 2020-07-10 14:26:43 +02:00
4edf31801c Dateien hochladen nach „archive“ 2020-07-10 14:26:07 +02:00
707fe3c251 „source/usr/local/emhttp/plugins/Unraid-Kernel-Helper/Unraid-Kernel-Helper.page“ ändern 2020-07-10 14:24:50 +02:00
997bfcc99c „plugins/Unraid-Kernel-Helper.plg“ ändern 2020-06-20 10:35:16 +02:00
bd3160eecb Dateien hochladen nach „archive“ 2020-06-20 10:33:44 +02:00
b95472fcc0 „source/usr/local/emhttp/plugins/Unraid-Kernel-Helper/Unraid-Kernel-Helper.page“ ändern 2020-06-20 10:31:27 +02:00
ab370e1fb0 added zpool list & zpool status error output 2020-06-20 10:22:30 +02:00
8cca8f4764 „source/usr/local/emhttp/plugins/Unraid-Kernel-Helper/Unraid-Kernel-Helper.page“ ändern 2020-06-19 23:20:11 +02:00
32 changed files with 891 additions and 132 deletions

View File

@@ -1,2 +0,0 @@
# unraid-kernel-helper-plugin

Binary file not shown.

View File

@@ -0,0 +1 @@
093c7607d6a572fb2c0e5db6df8878fa /tmp/Unraid-Kernel-Helper_6997/Unraid-Kernel-Helper-2020.06.20.txz

Binary file not shown.

View File

@@ -0,0 +1 @@
8d15f51c7a891dba4d5226bb1ba77b11 /tmp/Unraid-Kernel-Helper_20051/Unraid-Kernel-Helper-2020.07.10.txz

Binary file not shown.

View File

@@ -0,0 +1 @@
b62eac30a3ddb138a653d1bcef384407 /tmp/Unraid-Kernel-Helper_16241/Unraid-Kernel-Helper-2020.07.30.txz

Binary file not shown.

View File

@@ -0,0 +1 @@
14061a8e7d2603f1ef911951d6a975ef /tmp/Unraid-Kernel-Helper_16322/Unraid-Kernel-Helper-2020.10.27.txz

Binary file not shown.

View File

@@ -0,0 +1 @@
b11f45dc66148de51838230e89dd34fd /tmp/Unraid-Kernel-Helper_20442/Unraid-Kernel-Helper-2020.10.28.txz

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
4e2786fae318819ba8f2823c9dc71489 /tmp/Unraid-Kernel-Helper_9676/Unraid-Kernel-Helper-2021.01.04.txz

Binary file not shown.

View File

@@ -0,0 +1 @@
dd1cde9621aff4b05cbacbcf540e8f07 /tmp/Unraid-Kernel-Helper_12314/Unraid-Kernel-Helper-2021.01.04.txz

Binary file not shown.

View File

@@ -0,0 +1 @@
84893bb40b19f6c2c0f81e392e8f9f0a /tmp/Unraid-Kernel-Helper_1276/Unraid-Kernel-Helper-2021.03.11.txz

Binary file not shown.

View File

@@ -0,0 +1 @@
22db162cd063156b512bad378d20f1c7 /tmp/Unraid-Kernel-Helper_955/Unraid-Kernel-Helper-2021.03.17.txz

View File

@@ -2,23 +2,57 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "Unraid-Kernel-Helper">
<!ENTITY author "ich777">
<!ENTITY version "2020.06.15">
<!ENTITY md5 "c31f28eec8ec49a611dd23cf06d7b683">
<!ENTITY launch "Settings/Unraid-Kernel-Helper">
<!ENTITY version "2021.03.17">
<!ENTITY md5 "22db162cd063156b512bad378d20f1c7">
<!ENTITY launch "Settings/Unraid-Kernel-Helper-main">
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
<!ENTITY github "ich777/unraid-kernel-helper-plugin">
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/master/plugins/&name;.plg">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" min="6.8.3" support="https://forums.unraid.net/topic/92865-support-ich777-nvidiadvb-kernel-helperbuilder-docker/" icon="cogs">
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" min="6.8.3" max="6.9.2" support="https://forums.unraid.net/topic/92865-support-ich777-nvidiadvb-kernel-helperbuilder-docker/">
<CHANGES>
###14.06.2020
Cleanup UI
Make DVB Info understandable
###14.06.2020
Initial Release
###2021.03.17
- Fixed iSCSI page shown even if built without iSCSI
###2021.03.11
- Fixed permission issue
###2021.01.04
- Fixed a bug where the buttons on the iSCSI Volumes and ACL page are not displayed on Chrome, Edge,...
- Added save button to the iSCSI page
- Changed how iSCSI is detected
###2020.11.04
- Fixed a bug where IQN's don't show up if no IQN is created.
###2020.10.28
- Added basic GUI for creation/deletion of IQNs,FileIO/Block Volumes, LUNs, ACL's
###2020.10.27
- Fixed icons
- Code cleanup
###2020.07.30
- Fixed layout of ZFS informations
- Added additional iSCSI Target information
- Fixed Mellanox information not showing
###2020.06.20
- Added additional Mellanox information
###2020.06.20
- Added additional ZFS information
###2020.06.14
- Cleanup UI
- Make DVB Info understandable
###2020.06.14
- Initial Release
</CHANGES>
<FILE Run="/bin/bash">
@@ -32,8 +66,14 @@ rm -f $(ls /boot/config/plugins/&name;/&name;*.txz 2>/dev/null|grep -v '&version
<MD5>&md5;</MD5>
</FILE>
<FILE Name="/boot/config/plugins/&name;/unraid-kernel.png">
<URL>https://raw.githubusercontent.com/ich777/docker-templates/master/ich777/images/unraid-kernel.png</URL>
<FILE Name="&plugdir;/README.md">
<INLINE>
**Unraid-Kernel-Helper**
Plugin for Images built with the Docker Container Unraid-Kernel-Helper.
This Plugin shows all infromation that are available after starting Unraid with the built images.
It also has now a basic GUI for creation/deletion of IQNs,FileIO/Block Volumes, LUNs, ACL's for iSCSI.
</INLINE>
</FILE>
<FILE Run="/bin/bash">

View File

@@ -7,8 +7,11 @@ VERSION="$(date +'%Y.%m.%d')"
mkdir -p $TMP_DIR/$VERSION
cd $TMP_DIR/$VERSION
cp --parents -R $BASE_DIR/$PLUGIN_NAME/ $TMP_DIR/$VERSION/
chmod -R 755 $TMP_DIR/$VERSION/
rm $TMP_DIR/$VERSION/$BASE_DIR/$PLUGIN_NAME/README.md
makepkg -l y -c y $TMP_DIR/$PLUGIN_NAME-$VERSION.txz
md5sum $TMP_DIR/$PLUGIN_NAME-$VERSION.txz > $TMP_DIR/$PLUGIN_NAME-$VERSION.txz.md5
rm -R $TMP_DIR/$VERSION/
chmod -R 755 $TMP_DIR/*
#rm -R $TMP_DIR

View File

@@ -1,4 +1,5 @@
**Unraid-Kernel-Helper**
Plugin for Images built with the Docker Container Unraid-Kernel-Helper.
This Plugin shows all infromation that are available after starting Unraid with the built images.
This Plugin shows all infromation that are available after starting Unraid with the built images.
It also has now a basic GUI for creation/deletion of IQNs,FileIO/Block Volumes, LUNs, ACL's for iSCSI.

View File

@@ -0,0 +1,5 @@
Menu="Utilities"
Type="xmenu"
Title="Unraid-Kernel-Helper"
Icon="Unraid-Kernel-Helper.png"
Tabs="true"

View File

@@ -1,15 +1,15 @@
Menu="Utilities"
Menu="Unraid-Kernel-Helper-main:1"
Title="Unraid-Kernel-Helper"
---
<h1 style="text-align: center;"><a href="https://forums.unraid.net/topic/92865-support-ich777-nvidiadvb-kernel-helperbuilder-docker/" target="_blank" rel="noopener"><span style="color: #800000;">Unraid-Kernel-Helper Plugin</span></a></h1>
<p style="text-align: center;">This is the plugin for the Docker Container Unraid-Kernel-Helper.</p>
<p style="text-align: center;">It shows you all available informations about your built Kernel and Drivers/Modules (Empty values mean that not Module or compatible Hardware is found).</p>
<p style="text-align: center;">It shows you all available informations about your built Kernel and Drivers/Modules (If a component is not showing up that means no compatible hardware is found).</p>
<p>&nbsp;</p>
<p style="text-align: center;">If you haven't created your own Images yet, you can do that by downloading the Docker Container 'Unraid-Kernel-Helper' from the CA App.</p><p>&nbsp;</p>
<p style="text-align: right;">If you like my work, please consider Donating:</p>
<div align="center"><a href="https://www.paypal.me/chips777" target="_blank" rel="noopener"> <img style="float: right;" src="/plugins/Unraid-Kernel-Helper/images/donate.png" width="100" height="50" /> </a></div>
<p>Custom loaded Modules found:</p>
<p style="padding-left: 100px;"><span><b><?=`modinfo nvidia zfs joydev | grep -w "name:" | cut -d ':' -f2 | tr -d ' '`?></b>
<p style="padding-left: 100px;"><span><b><?=`modinfo nvidia joydev zfs iscsi_target_mod | grep -w "name:" | cut -d ':' -f2 | tr -d ' '`?></b>
<span><b><?=`dmesg | grep -i dvb | grep -i 'adapter 0' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?></b></span>
<span><b><?=`dmesg | grep -i dvb | grep -i 'adapter 1' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?></b></span>
<span><b><?=`dmesg | grep -i dvb | grep -i 'adapter 2' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?></b></span>
@@ -19,138 +19,253 @@ Title="Unraid-Kernel-Helper"
<span><b><?=`dmesg | grep -i dvb | grep -i 'adapter 6' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?></b></span>
<span><b><?=`dmesg | grep -i dvb | grep -i 'adapter 7' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?></b></span></p>
<?
$nvidiaModule = `modinfo nvidia | grep -w "name:" | cut -d ':' -f2 | tr -d ' '`;
if (isset($nvidiaModule ) === true && trim($nvidiaModule ) !== ''):
?>
<div style="width: 50%; float:left">
<div id="title">
<span class="left"></span>
</div>
<table class="settings">
<tr>
<td><b><font size="+1">nVidia Info:</font></b></td>
</tr>
<tr>
<td>Nvidia Driver Version:</td>
<td style="color:green"><b><?=`nvidia-smi | grep "Driver Version" | cut -d ' ' -f3`?></b></td>
</tr>
<tr>
<td>Installed GPU(s):</td>
<td style="color:green"><b><?=`nvidia-smi --query-gpu=index,name,gpu_bus_id,uuid --format=csv,noheader | tr "," "\n" | sed 's/^[ \t]*//' | sed -e s/00000000://g | sed '0~4G' | sed 's/^[0-9]$/&:/' | sed 's/$/<br>/'
0:<br>`?></b></td>
</tr>
</table>
<div id="title">
<span class="left"></span>
</div>
<table class="settings">
<tr>
<td><b><font size="+1">nVidia Info:</font></b></td>
</tr>
<tr>
<td>Nvidia Driver Version:</td>
<td style="color:green"><b><?=`nvidia-smi | grep "Driver Version" | cut -d ' ' -f3`?></b></td>
</tr>
<tr>
<td>Installed GPU(s):</td>
<td style="color:green"><b><?=`nvidia-smi --query-gpu=index,name,gpu_bus_id,uuid --format=csv,noheader | tr "," "\n" | sed 's/^[ \t]*//' | sed -e s/00000000://g | sed '0~4G' | sed 's/^[0-9]$/&:/' | sed 's/$/<br>/'`?></b></td>
</tr>
</table>
</div>
<? endif; ?>
<?
$dvbModule = `dmesg | grep -i dvb | grep -i 'adapter 0' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`;
if (isset($dvbModule ) === true && trim($dvbModule ) !== ''):
?>
<div style="width: 50%; float:left">
<div id="title">
<span class="left"></span>
</div>
<table align="right">
<table class="settings">
<div id="title">
<span class="left"></span>
</div>
<table class="settings">
<tr>
<td><b><font size="+1">DVB Info</font></b></td>
</tr>
<?
$dvbModule0 = `dmesg | grep -i dvb | grep -i 'adapter 0'`;
if (isset($dvbModule0 ) === true && trim($dvbModule0 ) !== ''):
?>
<tr>
<td>Loaded Kernel Module DVB1 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 0' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 0' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<? endif; ?>
<tr>
<td><b><font size="+1">DVB Info</font></b></td>
</tr>
<?
$dvbModule1 = `dmesg | grep -i dvb | grep -i 'adapter 1'`;
if (isset($dvbModule1 ) === true && trim($dvbModule1 ) !== ''):
?>
<tr>
<td>Loaded Kernel Module DVB2 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 1' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 1' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<? endif; ?>
<tr>
<td>Loaded Kernel Module DVB1 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 0' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 0' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<?
$dvbModule2 = `dmesg | grep -i dvb | grep -i 'adapter 2'`;
if (isset($dvbModule2 ) === true && trim($dvbModule2 ) !== ''):
?>
<tr>
<td>Loaded Kernel Module DVB3 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 2' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 2' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<? endif; ?>
<tr>
<td>Loaded Kernel Module DVB2 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 1' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 1' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<?
$dvbModule3 = `dmesg | grep -i dvb | grep -i 'adapter 3'`;
if (isset($dvbModule3 ) === true && trim($dvbModule3 ) !== ''):
?>
<tr>
<td>Loaded Kernel Module DVB4 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 3' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 3' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<? endif; ?>
<tr>
<td>Loaded Kernel Module DVB3 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 2' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 2' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<?
$dvbModule4 = `dmesg | grep -i dvb | grep -i 'adapter 4'`;
if (isset($dvbModule4 ) === true && trim($dvbModule4 ) !== ''):
?>
<tr>
<td>Loaded Kernel Module DVB5 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 4' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 4' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<? endif; ?>
<tr>
<td>Loaded Kernel Module DVB4 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 3' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 3' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<?
$dvbModule5 = `dmesg | grep -i dvb | grep -i 'adapter 5'`;
if (isset($dvbModule5 ) === true && trim($dvbModule5 ) !== ''):
?>
<tr>
<td>Loaded Kernel Module DVB6 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 5' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 5' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<? endif; ?>
<tr>
<td>Loaded Kernel Module DVB5 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 4' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 4' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<?
$dvbModule6 = `dmesg | grep -i dvb | grep -i 'adapter 6'`;
if (isset($dvbModule6 ) === true && trim($dvbModule6 ) !== ''):
?>
<tr>
<td>Loaded Kernel Module DVB7 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 6' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 6' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<? endif; ?>
<tr>
<td>Loaded Kernel Module DVB6 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 5' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 5' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<tr>
<td>Loaded Kernel Module DVB7 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 6' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 6' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<tr>
<td>Loaded Kernel Module DVB8 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 7' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 7' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
</table>
<?
$dvbModule7 = `dmesg | grep -i dvb | grep -i 'adapter 7'`;
if (isset($dvbModule7 ) === true && trim($dvbModule7 ) !== ''):
?>
<tr>
<td>Loaded Kernel Module DVB8 & Version:</td>
<td style="color:purple"><b><?=`dmesg | grep -i dvb | grep -i 'adapter 7' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1`?><b> | <?=`modinfo "$(dmesg | grep -i dvb | grep -i 'adapter 7' | cut -d ']' -f2 | cut -d ' ' -f2 | head -1)" | grep "version" | head -1 | cut -d ' ' -f9`?></b></td>
</tr>
<? endif; ?>
</table>
</div>
<? endif; ?>
<?
$zfsModule = `modinfo zfs | grep -w "name:" | cut -d ':' -f2 | tr -d ' '`;
if (isset($zfsModule ) === true && trim($zfsModule ) !== ''):
?>
<div style="width: 50%; float:left">
<div id="title">
<span class="left"></span>
</div>
<table class="settings">
<div id="title">
<span class="left"></span>
</div>
<table class="settings">
<tr>
<td><b><font size="+1">ZFS Info:</font></b></td>
</tr>
<tr>
<td>ZFS Version:</td>
<td><b><?=`zfs --version | head -1 | cut -d '-' -f2-`?></b></td>
</tr>
</table>
<span>&nbsp&nbsp&nbspPool List:</span>
<table>
<?
$output = `zpool list | column -t -o '\t'`;
// check for error message
if(strpos($output, "available") !== false) {
?>
<b><?=$output?></b>
<?
} elseif (strpos($output, "config:") !== false) {
// TODO display data for zpool status without any options (?)
// parse output table
} else {
// create array with lines; splits on \n
$rows = explode("\n", $output);
?>
<tr>
<td><b><font size="+1">ZFS Info:</font></b></td>
<?
foreach($rows as $row) {
// create array with columns from line; splits on \t
$columns = explode("\t", $row);
?>
<br>
<tr>
<?
foreach($columns as $column) {
?>
<td><b><?=$column?></b></td>
<?
}
?>
</tr>
<?
}
?>
<?
}
?></td>
</tr>
<tr>
<td>ZFS Version:</td>
<td><b><?=`zfs --version | head -1 | cut -d '-' -f2-`?></b></td>
</tr>
<tr>
<td>Pool List:</td>
<td><b><?=`zpool list -o name,size | column -t -o '&nbsp;&nbsp;&nbsp;&nbsp;' | sed 's/$/<br>/'`?></b></td>
</tr>
</table>
</table>
<p>
<td><b><?=`zpool status | grep -A 9999 "errors:" | cut -d ':' -f2`?></b></td>
</p>
</div>
<? endif; ?>
<?
$mellanoxModule = `ls /usr/bin/mstflint`;
if (isset($mellanoxModule ) === true && trim($mellanoxModule ) !== ''):
?>
<div style="width: 50%; float:left">
<div id="title">
<span class="left"></span>
</div>
<table class="settings">
<tr>
<td><b><font size="+1">Mellanox Network Card:</font></b></td>
</tr>
<tr>
<td>Temperature:</td>
<td style="color:green"><b><?=`mget_temp -d "$(/sbin/lspci -d 15b3: | cut -d ' ' -f1 | head -1)"`?>°C</b></td>
</tr>
<tr>
<td>Info:</td>
<td style="color:green"><b><?=`mstflint -d "$(/sbin/lspci -d 15b3: | cut -d ' ' -f1 | head -1)" q | tail -n +2 | sed 's/$/<br>/'`?></b></td>
</tr>
</table>
</div>
<? endif; ?>
<?
$iSCSIModule = `modinfo configfs | grep -w "name:" | cut -d ':' -f2 | tr -d ' '`;
if (isset($iSCSIModule ) === true && trim($iSCSIModule ) !== ''):
?>
<div style="width: 50%; float:left">
<div id="title">
<span class="left"></span>
</div>
<table class="settings">
<tr>
<td><b><font size="+1">iSCSI Target Info:</font></b></td>
</tr>
<tr>
<td>TargetCLI Version:</td>
<td style="color:green"><b><?=`targetcli version 2>&1 | cut -d ' ' -f3`?></b></td>
</tr>
</table>
</div>
<? endif; ?>
<div style="width: 50%; float:left">
<div id="title">
<span class="left"></span>
</div>
<table align="right">
<table class="settings">
<tr>
<td><b><font size="+1">System Info</font></b></td>
</tr>
<tr>
<td>Unraid Version:</td>
<td style="color: #99cc00;"><b><?=`cat /etc/unraid-version | cut -d '"' -f2`?></b></td>
</tr>
<tr>
<td>Kernel:</td>
<td style="color: #99cc00;"><b><?=`uname -r`?></b></td>
</tr>
<tr>
<td>Compile Date:</td>
<td style="color: #99cc00;"><b><?=`uname -v | cut -d ' ' -f3-`?></b></td>
</tr>
</table>
</div>
<div id="title">
<span class="left"></span>
</div>
<table class="settings">
<tr>
<td><b><font size="+1">System Info</font></b></td>
</tr>
<tr>
<td>Unraid Version:</td>
<td style="color: #99cc00;"><b><?=`cat /etc/unraid-version | cut -d '"' -f2`?></b></td>
</tr>
<tr>
<td>Kernel:</td>
<td style="color: #99cc00;"><b><?=`uname -r`?></b></td>
</tr>
<tr>
<td>Compile Date:</td>
<td style="color: #99cc00;"><b><?=`uname -v | cut -d ' ' -f3-`?></b></td>
</tr>
</table>
</div>

View File

@@ -0,0 +1,86 @@
Menu="Unraid-Kernel-Helper-main:6"
Title="4 - ACL"
Cond="exec('/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh avail_iqns')"
---
<p style="text-align: center;"><b>Assagn your Initiator (Client) to the IQN to give them access to the FileIO Volumes/Block Volumes that you assigned in the previous steps.</b></p>
<div id="title">
<span class="left"></span>
</div>
<td><b><font size="+1">Create ACL:</font></b></td>
<form id="s" method="post" >
<select name="availIQN" required>
<option selected="selected" value="">Choose IQN</option>
<?php
$output = $_SESSION['availiqns'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</select>
Enter the Initiatorname here:
<input type = "text" style="width: 300px;" name = "aclNAME" placeholder="iqn.9999-00.com.microsoft:desktop-0abcdef" required>
<option>
<input type="submit" name="createACL" value="Create ACL">
</option>
</form>
<?php
if(isset($_POST['createACL'])) {
$availIQN = $_POST["availIQN"];
$aclNAME = $_POST["aclNAME"];
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh create_acl $availIQN $aclNAME");
echo '<script>parent.window.location.reload();</script>';
}
?>
<div id="title">
<span class="left"></span>
</div>
<td><b><font size="+1">Delete ACL:</font></b></td>
<form id="s" method="post" >
<select name="availIQN" required>
<option selected="selected" value="">Choose IQN</option>
<?php
$output = $_SESSION['availiqns'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</select>
Enter the Initiatorname here:
<input type = "text" style="width: 300px;" name = "delaclname" placeholder="iqn.9999-00.com.microsoft:desktop-0abcdef" required>
<option>
<input type="submit" name="deleteACL" value="Delete ACL">
</option>
</form>
<?php
if(isset($_POST['deleteACL'])) {
$availIQN = $_POST["availIQN"];
$delaclname = $_POST["delaclname"];
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh delete_acl $availIQN $delaclname");
echo '<script>parent.window.location.reload();</script>';
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -0,0 +1,66 @@
#!/bin/bash
function avail_iqns(){
echo -n "$(targetcli ls iscsi 1 | tail -n +2 | cut -d ' ' -f4- | cut -d ' ' -f1)"
}
function create_iqn(){
echo -n "$(targetcli iscsi/ create)" | head -1 | cut -d ' ' -f3- | rev | cut -d '.' -f2- | rev
}
function delete_iqn(){
echo -n "$(targetcli /iscsi delete $1)"
}
function delete_fileIO(){
echo -n "$(targetcli backstores/fileio delete name=$1)"
}
function delete_blockVOL(){
echo -n "$(targetcli backstores/block delete name=$1)"
}
function avail_fileio(){
echo -n "$(targetcli ls backstores 2 | awk '/pscsi/{f=0} f; /fileio/{f=1}' | cut -d ' ' -f5)"
}
function create_fileIO(){
if [ ! -d $2 ]; then
mkdir -p $2
fi
echo -n "$(targetcli backstores/fileio create $1 $2/$1.img $3 write_back=$4)"
}
function avail_blockvols(){
echo -n "$(targetcli ls backstores 2 | awk '/fileio/{f=0} f; /block/{f=1}' | cut -d ' ' -f5)"
}
function blockvol_names(){
echo -n "$(targetcli ls backstores 2 | awk '/fileio/{f=0} f; /block/{f=1}' | cut -d ' ' -f5)"
}
function create_blockvol(){
echo -n "$(targetcli backstores/block create name=$2 dev=/dev/disk/by-id/$1)"
}
function create_block_lun(){
echo -n "$(targetcli iscsi/$1/tpg1/luns/ create /backstores/block/$2)"
}
function create_fileio_lun(){
echo -n "$(targetcli iscsi/$1/tpg1/luns/ create /backstores/fileio/$2)"
}
function create_acl(){
echo -n "$(targetcli iscsi/$1/tpg1/acls/ create $2)"
}
function delete_acl(){
echo -n "$(targetcli iscsi/$1/tpg1/acls/ delete $2)"
}
function get_available_disks(){
echo -n "$(grep -vf <(cat /usr/local/emhttp/state/disks.ini | grep -w 'id=' | grep -wv 'id=""' | cut -d '"' -f2) <(ls /dev/disk/by-id/) | grep -vf <(echo "wwn") | uniq -w 25)"
}
$@

View File

@@ -0,0 +1,63 @@
Menu="Unraid-Kernel-Helper-main:3"
Title="1 - IQN"
Cond="exec('modinfo configfs')"
---
<?
if (isset($_SESSION['availiqns'] ) === true && trim($_SESSION['availiqns'] ) !== ''):
?>
<p style="text-align: center;"><b>If you need a addational IQN click on the button 'Create new IQN' (you can also create more than one IQN if you want to assign different Initiators to it).</b></p>
<b>Available IQN's:</b><br>
<?php
echo str_replace("\n", '<br>', $_SESSION['availiqns']);
?>
<br>
<?
else :
?>
<p style="text-align: center;"><b>Start by creating an IQN for your server, click on the button 'Create new IQN' (you can also create more than one IQN if you want to assign different Initiators to it).</b></p>
<? endif; ?>
<form id="iqn" method="post" >
<input type="submit" name="createIQN" value="Create new IQN">
</form>
<?php
if(isset($_POST['createIQN'])) {
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh create_iqn");
echo '<script>parent.window.location.reload();</script>';
}
?>
<?
if (isset($_SESSION['availiqns'] ) === true && trim($_SESSION['availiqns'] ) !== ''):
?>
<form id="s" method="post" >
<select name="deleteiqn" required>
<option selected="selected" value="">Choose IQN</option>
<?php
$output = $_SESSION['availiqns'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</select>
<input type="submit" name="deleteIQN" value="Delete">
</form>
<?php
if(isset($_POST['deleteIQN'])) {
$deleteiqn = $_POST["deleteiqn"];
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh delete_iqn $deleteiqn");
echo '<script>parent.window.location.reload();</script>';
}
?>
<? endif; ?>

View File

@@ -0,0 +1,92 @@
Menu="Unraid-Kernel-Helper-main:2"
Title="iSCSI Overview"
Cond="exec('modinfo configfs')"
---
<script>
//Don't execute commands again if page is refreshed
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
</script>
<?php
//Get available IQNs and BlockVOLs
$_SESSION['availiqns'] = shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh avail_iqns");
$_SESSION['availfilios'] = shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh avail_fileio");
$_SESSION['availblockvols'] = shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh avail_blockvols");
$_SESSION['availdisks'] = shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh get_available_disks");
?>
<h1 style="text-align: center;"><span style="color: #800000;">iSCSI Target</span></a></h1>
<p style="text-align: center;">This Plugin is currently in development and has all the features to create/delete a FileIO Volume/Block Volume and assign it to a Initiator.</p>
<p style="text-align: center;">The backend itself 'targetcli-fb' is stable and should run without any problems (all commands from 'targetcli-fb' are available from the command line).</p>
<p style="text-align: center;"><b><i>Manual: First start by going to the first tab and create a IQN and follow the instructions.</i></b></p>
<p style="text-align: center;"><b><i>Here on this page at the bottom the output of 'targetcli ls' is displayed and you can see all your configurations for iSCSI.</i></b></p>
<?
$iSCSIModule = `modinfo configfs | grep -w "name:" | cut -d ':' -f2 | tr -d ' '`;
if (isset($iSCSIModule ) === true && trim($iSCSIModule ) !== ''):
?>
<div style="width: 50%; float:left">
<div id="title">
<span class="left"></span>
</div>
<table class="settings">
<tr>
<td><b><font size="+1">iSCSI Target Info:</font></b></td>
</tr>
<tr>
<td>TargetCLI Version:</td>
<td style="color:green"><b><?=`targetcli version 2>&1 | cut -d ' ' -f3`?></b></td>
</tr>
</table>
</div>
<? else: ?>
<div style="width: 50%; float:left">
<div id="title">
<span class="left"></span>
</div>
<h1 style="text-align: center;"><span>iSCSI Target not found!</span></a></h1>
</div>
<? endif; ?>
<div style="width: 50%; float:left">
<div id="title">
<span class="right"></span>
</div>
<table class="settings">
<tr>
<td><b><font size="+1">System Info</font></b></td>
</tr>
<tr>
<td>Unraid Version:</td>
<td style="color: #99cc00;"><b><?=`cat /etc/unraid-version | cut -d '"' -f2`?></b></td>
</tr>
<tr>
<td>Kernel:</td>
<td style="color: #99cc00;"><b><?=`uname -r`?></b></td>
</tr>
<tr>
<td>Compile Date:</td>
<td style="color: #99cc00;"><b><?=`uname -v | cut -d ' ' -f3-`?></b></td>
</tr>
</table>
</div>
<div style="width: 100%;">
<div id="title">
<span></span>
</div>
</div>
<p style="text-align: center;"><b><font size="+1">Output of 'targetcli ls':</font></b></p>
<table style="margin-left: auto; margin-right: auto; width: 1050px">
<tr>
<td>
<p style="font-family: Monaco, monospace;"><b><?=`targetcli ls | sed 's/$/<br>/'`?></p>
</td>
</tr>
</table>

View File

@@ -0,0 +1,105 @@
Menu="Unraid-Kernel-Helper-main:5"
Title="3 - LUNS"
Cond="exec('/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh avail_iqns')"
---
<p style="text-align: center;"><b>Assign a FileIO Volume/Block Volume to an IQN.</b></p>
<div id="title">
<span class="left"></span>
</div>
<td><b><font size="+1">Create FileIO LUN:</font></b></td>
<form id="s" method="post" >
<select name="availIQN" required>
<option selected="selected" value="">Choose IQN</option>
<?php
$output = $_SESSION['availiqns'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</select>
<select name="fileioNAME" required>
<option selected="selected" value="" >Choose FileIO Volume</option>
<?php
$output = $_SESSION['availfilios'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</select>
</option>
<input type="submit" name="LUNFileIO" value="Create FileIO LUN">
</form>
<?php
if(isset($_POST['LUNFileIO'])) {
$availIQN = $_POST["availIQN"];
$fileioNAME = $_POST["fileioNAME"];
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh create_fileio_lun $availIQN $fileioNAME");
echo '<script>parent.window.location.reload();</script>';
}
?>
<div id="title">
<span class="left"></span>
</div>
<td><b><font size="+1">Create Block LUN:</font></b></td>
<form id="s" method="post" >
<select name="availIQN" required>
<option selected="selected" value="">Choose IQN</option>
<?php
$output = $_SESSION['availiqns'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</select>
<select name="blockNAME" required>
<option selected="selected" value="" >Choose Block Volume</option>
<?php
$output = $_SESSION['availblockvols'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</select>
</option>
<input type="submit" name="LUNblock" value="Create FileIO LUN">
</form>
<?php
if(isset($_POST['LUNblock'])) {
$availIQN = $_POST["availIQN"];
$blockNAME = $_POST["blockNAME"];
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh create_block_lun $availIQN $blockNAME");
echo '<script>parent.window.location.reload();</script>';
}
?>

View File

@@ -0,0 +1,176 @@
Menu="Unraid-Kernel-Helper-main:4"
Title="2 - Volumes"
Cond="exec('/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh avail_iqns')"
---
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.filetree.css")?>">
<script src="<?=autov("/webGui/javascript/jquery.filetree.js")?>"></script>
<script>
$(function(){
$("#destinationShare").fileTreeAttach();
});
</script>
<script>
function path_selected() {
var share = $("#destinationShare").val();
document.getElementById("pathfromjs").value = share;
}
</script>
<h1 style="text-align: center;"><span style="color: red;">WARNING!</span></a></h1>
<p style="text-align: center;"><b>Please be carefull which disk you choose and double check it again since it can happen that a wrong disk is displayed in the dropdown.<br>Disks that are mounted/assigned through the Unassigned-Devices-Plguin are included in the dropdown list! Please double check and be carefull, if you choose a wrong disk this could lead to data loss!</b></p>
<table>
<div id="title">
<span class="left"></span>
</div>
<td><b><font size="+1">Create FileIO Volume:</font></b></td>
<tr>
<td>Path:</td>
<td>Name:</td>
<td>Size:</td>
<td>Write Back:</td>
</tr>
<form id="s" method="post" autocomplete="off">
<tr style="height:20px;">
<td>
<input id="pathfromjs" name="pathfromjs" type="hidden"></input>
<input type='text' size="15" class='setting' id="destinationShare" placeholder="/mnt/user/Unraid-Kernel-Helper/" name="shareFolder" data-pickroot="/mnt" data-pickfilter="HIDE_FILES_FILTER" data-pickfolders="true" onchange="path_selected()" required>
</td>
<td><input type = "text" style="width: 100px;" name = "name" placeholder="fileIO" required> .img</td>
<td> <input type = "text" name = "size" placeholder="20G" required></td>
<td>
<select name="write_back">
<option value="false">false</option>
<option value="true">true</option>
</select>
</td>
</tr>
</table>
<option id="s" method ="post">
<input type="submit" name="createFileIO" value="Create FileIO">
</option>
</form>
<?php
if(isset($_POST['createFileIO'])) {
$size = $_POST["size"];
$name = $_POST["name"];
$path = $_POST["pathfromjs"];
$writeback = $_POST["write_back"];
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh create_fileIO $name $path $size $writeback");
echo '<script>parent.window.location.reload();</script>';
}
?>
<?
if (isset($_SESSION['availfilios'] ) === true && trim($_SESSION['availfilios'] ) !== ''):
?>
<b>Available FileIO Volumes:</b><br>
<?php
echo str_replace("\n", '<br>', $_SESSION['availfilios']);
?>
<br>
<form id="s" method="post" >
<select name="deletefileio" required>
<option selected="selected" value="">Choose FileIO</option>
<?php
$output = $_SESSION['availfilios'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</select>
<input type="submit" name="deleteFileIO" value="Delete">
</form>
<p><b><i>If you delete a FileIO Backstore it won't remove the image from your hard disk!</i></b></p>
<?php
if(isset($_POST['deleteFileIO'])) {
$deletefileio = $_POST["deletefileio"];
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh delete_fileIO $deletefileio");
echo '<script>parent.window.location.reload();</script>';
}
?>
<? endif; ?>
<table>
<div id="title">
<span class="left"></span>
</div>
<td><b><font size="+1">Create Block Volume:</font></b></td>
<tr>
<td>Disk:</td>
<td>Name:</td>
</tr>
<form id="a" method="post">
<tr style="height:20px;">
<td>
<select name="disk" required>
<option selected="selected" value="">Choose disk</option>
<?php
$output = $_SESSION['availdisks'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</td>
<td><input type = "text" style="width: 100px;" name = "name" placeholder="1TB_Disk" required></td>
</tr>
</table>
<option id="a" method ="post">
<input type="submit" name="createBlock" value="Create Block">
</option>
</form>
<?php
if(isset($_POST['createBlock'])) {
$disk = $_POST["disk"];
$name = $_POST["name"];
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh create_blockvol $disk $name");
echo '<script>parent.window.location.reload();</script>';
}
?>
<?
if (isset($_SESSION['availblockvols'] ) === true && trim($_SESSION['availblockvols'] ) !== ''):
?>
<b>Available Block Volumes:</b><br>
<?php
echo str_replace("\n", '<br>', $_SESSION['availblockvols']);
?>
<br>
<form id="s" method="post" >
<select name="deleteblockvol" required>
<option selected="selected" value="">Choose Block Volume</option>
<?php
$output = $_SESSION['availblockvols'];
$data = explode("\n", $output);
var_dump($data);
foreach($data as $item){
echo "<option value=\"$item\"> $item</option>";
}
?>
</select>
<input type="submit" name="deleteBlockVOL" value="Delete">
</form>
<p><b><i>If you delete a Block Volume Backstore it won't remove the image from your hard disk!</i></b></p>
<?php
if(isset($_POST['deleteBlockVOL'])) {
$deleteblockvol = $_POST["deleteblockvol"];
shell_exec("/usr/local/emhttp/plugins/Unraid-Kernel-Helper/include/exec.sh delete_blockVOL $deleteblockvol");
echo '<script>parent.window.location.reload();</script>';
}
?>
<? endif; ?>