Skip to content

Commit

Permalink
Many fixes and modifications also new features
Browse files Browse the repository at this point in the history
  • Loading branch information
niadev67 committed Aug 15, 2012
1 parent adb2bea commit 67b5ae5
Show file tree
Hide file tree
Showing 51 changed files with 955 additions and 337 deletions.
22 changes: 13 additions & 9 deletions html/about_console.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
echo "<pre><b><FONT COLOR=purple >Web Console Release </FONT><FONT COLOR=black>$gui_ver <a href=# ONCLICK=parent.frames[1].location.href='http://mhvtl-community-forums.966029.n3.nabble.com' target=showframe> Built by nia</a></FONT></b></pre>";
?>


<?php echo "<pre><b><FONT size=2><a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU GENERAL PUBLIC LICENSE : GPLv2 : Copyright (C) 2011. All rights reserved. </a></FONT></b></pre>";?>


<pre>
<FONT COLOR=blue size=4>Trademark Disclaimer:</FONT>
<FONT COLOR=black size=3> Product names, logos, brands, and other trademarks featured or referred to within
Expand All @@ -35,15 +39,15 @@

<pre>
<FONT COLOR=blue size=4>SOFTWARE Disclaimer:</FONT>
This SOFTWARE PRODUCT is provided by me "as is" and "with all faults."
I make no representations or warranties of any kind concerning the safety,
suitability, lack of viruses, inaccuracies, typographical errors, or other harmful
components of this SOFTWARE PRODUCT. There are inherent dangers in the use
of any software, and you are solely responsible for determining whether this SOFTWARE PRODUCT
is compatible with your equipment and other software installed on your equipment.
You are also solely responsible for the protection of your equipment and backup of your data,
and I will not be liable for any damages you may suffer in connection with using,
modifying, or distributing this SOFTWARE PRODUCT.
This SOFTWARE PRODUCT is provided by me "as is" and "with all faults."
I make no representations or warranties of any kind concerning the safety,
suitability, lack of viruses, inaccuracies, typographical errors, or other harmful
components of this SOFTWARE PRODUCT. There are inherent dangers in the use
of any software, and you are solely responsible for determining whether this SOFTWARE PRODUCT
is compatible with your equipment and other software installed on your equipment.
You are also solely responsible for the protection of your equipment and backup of your data,
and I will not be liable for any damages you may suffer in connection with using,
modifying, or distributing this SOFTWARE PRODUCT.
</FONT></pre>

</table>
Expand Down
2 changes: 1 addition & 1 deletion html/act.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$cmdout2 = shell_exec ('sudo -u root -S cat /tmp/mhvtl.act.tmp| grep -v mediumx| cut -d ":" -f2,3|cut -c5- | while read eachone; do echo "<img src=images/animated_dot.gif align=top />" "<FONT COLOR=red>$eachone</FONT>" ; done');

$output1=`if [ ! -z "$ACTIVITY" ] ; then echo "$cmdout2" ;fi`;
$output2=`if [ ! -z "$ACTIVITY" ] ; then sudo -u root -S cat /tmp/mhvtl.act.tmp;else echo "<FONT COLOR=green>STATUS: IDLE</FONT>";fi`;
$output2=`if [ ! -z "$ACTIVITY" ] ; then sudo -u root -S cat /tmp/mhvtl.act.tmp| awk 'BEGIN{RS="mediumx" } /Data Transfer Element/';else echo "<FONT COLOR=green>STATUS: IDLE</FONT>";fi`;
echo "<pre><b>$output1</b></pre>";
echo "<pre><b>$output2</b></pre>";
?>
11 changes: 11 additions & 0 deletions html/act.test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
$cmdout = shell_exec ('sudo -u root -S rm -f /tmp/mhvtl.act.tmp; sudo -u root -S lsscsi -g | grep mediumx | grep -o "[^dev]*$" | while read each; do sudo -u root -S lsscsi -g | grep /dev$each$|cut -d "]" -f2 ; sudo -u root -S mtx -f /dev$each status | sudo -u root -S grep "Loaded"; done >>/tmp/mhvtl.act.tmp');
$ACTIVITY=`sudo -u root -S cat /tmp/mhvtl.act.tmp| grep -v mediumx`;
$cmdout2 = shell_exec ('sudo -u root -S cat /tmp/mhvtl.act.tmp| grep -v mediumx| cut -d ":" -f2,3|cut -c5- | while read eachone; do echo "<FONT COLOR=#FFFF00>Testing, Please Wait ...</FONT><br><br> <img src=images/test.animated_dot.gif align=top />" "<FONT COLOR=#00FFFF>$eachone</FONT>" ; done');
$output1=`if [ ! -z "$ACTIVITY" ] ; then echo "$cmdout2" ;fi`;
$output = shell_exec('cat /tmp/mhvtl.quick.test.tmp');
$output2=`if [ ! -z "$ACTIVITY" ] ; then sudo -u root -S cat /tmp/mhvtl.act.tmp| awk 'BEGIN{RS="mediumx" } /Data Transfer Element/' ;else echo "<FONT COLOR=#008000></FONT><br><pre><FONT COLOR=#FFFFFF>$output</FONT></pre>";fi`;

echo "<pre><b><FONT COLOR=#FFFFFF>$output1</FONT></b></pre>";
echo "<pre><b><FONT COLOR=#FFFFFF>$output2</FONT></b></pre>";
?>
68 changes: 68 additions & 0 deletions html/activity.test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<html>
<head><title>MHVTL Web Console</title></head>
<link href="styles.css" rel="stylesheet" type="text/css">
<body>

<script type="text/javascript">
var ray={
ajax:function(st)
{
this.show('load');
},
show:function(el)
{
this.getID(el).style.display='';
},
getID:function(el)
{
return document.getElementById(el);
}
}
</script>


<script type="text/javascript">

function Ajax()
{
var
$http,
$self = arguments.callee;

if (window.XMLHttpRequest) {
$http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
$http = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
$http = new ActiveXObject('Microsoft.XMLHTTP');
}
}

if ($http) {
$http.onreadystatechange = function()
{
if (/4|^complete$/.test($http.readyState)) {
document.getElementById('ReloadThis').innerHTML = $http.responseText;
setTimeout(function(){$self();}, 100);
}
};
$http.open('GET', 'act.test.php' + '?' + new Date().getTime(), true);
$http.send(null);
}

}

</script>
<script type="text/javascript">
setTimeout(function() {Ajax();}, 100);
</script>

<div id="ReloadThis" >
<?php
include 'act.test.php' ;
?>
</div>

</body>
</html>
4 changes: 2 additions & 2 deletions html/devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<table border="0">
<td>
<div style="overflow:auto;height:325px;width:650px;">
<div style="overflow:auto;height:225px;width:600px;">
<?php
$output = shell_exec('DEVICES=`sudo -u root -S lsscsi -g | egrep "tape|mediumx"`; if [ -z "$DEVICES" ]; then echo "No MHVTL Virtual Devices Present"; else echo "$DEVICES"; fi');
echo "<pre><B><FONT COLOR=#FFFFFF>$output</FONT></B></pre>";
Expand All @@ -43,7 +43,7 @@
<br>
<table border="0" >
<td>
<FORM ACTION="vtlcmd.php"> <INPUT TYPE=SUBMIT VALUE="Return"> </FORM>
<FORM ACTION="tools.php"> <INPUT TYPE=SUBMIT VALUE="Return"> </FORM>
</td>
</table>
</body>
Expand Down
2 changes: 0 additions & 2 deletions html/drive.status.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
echo "<pre><b>Drive Status :</b></pre>";
?>

<hr width="100%" size=1 color="blue">

<TABLE BORDER='4' CELLSPACING='4' CELLPADDING='4' bgcolor='#000000' <FONT COLOR='#FFFFFF'></FONT>
<TR>
<TD>
Expand Down
2 changes: 1 addition & 1 deletion html/fdisplay.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$dm = `sudo -u root -S ../scripts/pandisp.sh`;
if ($dm=="")
{
$output = shell_exec('DEVICES=`sudo -u root -S ../scripts/plot_devices.sh`; if [ -z "$DEVICES" ]; then echo "<br><br><img src="images/fd_red_light.png" align=center /><FONT COLOR=#FF0000> System Offline</FONT>"; else echo "<br><br><img src="images/fd_green_light.png" align=center /><FONT COLOR=#008000> System Online</FONT>"; fi');
$output = shell_exec('DEVICES=`sudo -u root -S lsscsi -g | egrep "tape|mediumx"`; if [ -z "$DEVICES" ]; then echo "<br><br><img src="images/fd_red_light.png" align=center /><FONT COLOR=#FF0000> Offline</FONT>"; else echo "<br><br><img src="images/fd_green_light.png" align=center /><FONT COLOR=#008000> Ready</FONT>"; fi');
echo "<b>$output</b>";
echo "<BR><BR>";
$RC=`sudo -u root -S lsscsi -g | grep mediumx| wc -l`;
Expand Down
30 changes: 19 additions & 11 deletions html/form.add.stgt.iscsi.clients.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,27 @@
echo "<FORM ACTION=stgt.php><INPUT TYPE=SUBMIT VALUE=Return></FORM>";
exit("<FONT COLOR='#000000'>STGT Disabled($filename)</FONT>");
}
?>


<?php $target = `sudo -u root -S ../scripts/build_html_opts.sh target`; ?>

<form method="post" action="add.stgt.iscsi.clients.php">
Select Target <?php echo $target;?>
<br>
Enter Host, IP, Network or "ALL" <input name="cn" type="text" size="20" value="ALL" required >
<br>
<input type="submit">
</form>
<FORM ACTION="stgt.php"> <INPUT TYPE=SUBMIT VALUE="Return"> <INPUT TYPE=SUBMIT VALUE="Cancel"> </FORM>
$target = `sudo -u root -S ../scripts/build_html_opts.sh target`;
if ( $target == "" )
{
echo "<FONT COLOR=#FF0000>Target not defined, please create first</FONT>";
echo "</FORM><br>";
echo "<hr width='100%' size=1 color='blue'>";
echo "<FORM ACTION='stgt.php'><INPUT TYPE=SUBMIT VALUE='Return'><INPUT TYPE=SUBMIT VALUE='Cancel'></FORM>";
echo "</table>";
}
else
{
echo "<form method='post' action='add.stgt.iscsi.clients.php'>";
echo "Select Target $target";
echo "<br>";
echo "Enter Host, IP, Network or ALL <input name='cn' type='text' size='20' value='ALL' required >";
echo "<br>";
echo "<input type='submit'></form><FORM ACTION='stgt.php'><INPUT TYPE=SUBMIT VALUE='Return'></FORM>";
}
?>

</body>
</html>
2 changes: 1 addition & 1 deletion html/form.create.auto.iscsi.config.stgt.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function toggleMe(a){
<form action="stgt.php" method="post" onsubmit="return ray.ajax()">
<input TYPE="submit" style="color: #000000" value=" Cancel "></form>
<form action="create.auto.iscsi.config.stgt.php" method="post" onsubmit="return ray.ajax()">
<input TYPE="submit" style="color: #FF0000" value=" Next "></form>
<input TYPE="submit" style="color: #FF0000" value=" Start "></form>
</td>

</table>
Expand Down
28 changes: 21 additions & 7 deletions html/form.create.iscsi.lun.stgt.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,27 @@
<form method="post" action="create.iscsi.lun.stgt.php" >
<input name="tid" value="<?php echo $target;?>" hidden readonly>
LUN <?php echo $nextlun;?>
Select Device : <?php echo $cmd;?>
<INPUT TYPE=SUBMIT VALUE="Create">
</FORM>
<br>
<hr width="100%" size=1 color="blue">
<FORM ACTION="stgt.php"><INPUT TYPE=SUBMIT VALUE="Return"><INPUT TYPE=SUBMIT VALUE="Cancel"> </FORM>
</table>

<?php
if ( $cmd == "" )
{
echo "<FONT COLOR=#FF0000>Tape Devices not online</FONT>";
echo "</FORM>";
echo "<br>";
echo "<hr width='100%' size=1 color='blue'>";
echo "<FORM ACTION='stgt.php'><INPUT TYPE=SUBMIT VALUE='Return'><INPUT TYPE=SUBMIT VALUE='Cancel'></FORM>";
echo "</table>";
}
else
{
echo "Select Device : $cmd";
echo "<INPUT TYPE=SUBMIT VALUE='Create'></FORM>";
echo "<br>";
echo "<hr width='100%' size=1 color='blue'>";
echo "<FORM ACTION='stgt.php'><INPUT TYPE=SUBMIT VALUE='Return'><INPUT TYPE=SUBMIT VALUE='Cancel'></FORM>";
echo "</table>";
}
?>

</body>
</html>
45 changes: 27 additions & 18 deletions html/form.create.iscsi.target.stgt.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,35 @@
$thost = `sudo -u root -S hostname -s`;
$miqn = `sudo -u root -S echo iqn.2011-04.com.nia:$thost`;
}
?>

<form method="post" action="create.iscsi.target.stgt.php">
<?php $nexttarget = `sudo -u root -S ../scripts/build_html_opts.sh nexttarget`; ?>
$nexttarget = `sudo -u root -S ../scripts/build_html_opts.sh nexttarget`;
if ( $nexttarget == "" )
{
echo "<FONT COLOR=#FF0000>Error: is TGT running ?</FONT>";
echo "</FORM>";
echo "<br>";
echo "<hr width='100%' size=1 color='blue'>";
echo "<FORM ACTION='stgt.php'><INPUT TYPE=SUBMIT VALUE='Return'><INPUT TYPE=SUBMIT VALUE='Cancel'></FORM>";
echo "</table>";
}
else
{
echo "<form method='post' action='create.iscsi.target.stgt.php'>";
echo "Enter Target-iqn : <input name='iqn' type='text' size='50' value='$miqn' required >";
echo "<input name='mode' value='target' hidden readonly >";
echo "<br>";
echo "Enter Identifier1 : <input name='idn1' type='text' value='mhvtl' required >";
echo "<br>";
echo "Enter Identifier2 : <input name='idn2' type='text' value='tgt' required >";
echo "<br>";
echo "Target ID Number : $nexttarget";
echo "<br>";
echo "<INPUT TYPE=SUBMIT VALUE='Create'></FORM><FORM ACTION='stgt.php'><INPUT TYPE=SUBMIT VALUE='Cancel'></FORM>";
echo "<br>";
echo "</table>";
}
?>

Enter Target-iqn : <input name="iqn" type="text" size="50" value=<?php echo $miqn;?> required >
<input name="mode" value="target" hidden readonly >
<br>
Enter Identifier1 : <input name="idn1" type="text" value="mhvtl" required >
<br>
Enter Identifier2 : <input name="idn2" type="text" value="tgt" required >
<br>
Target ID Number : <?php echo $nexttarget;?>
<br>
<INPUT TYPE=SUBMIT VALUE="Create">
</FORM>
<br>
<hr width="100%" size=1 color="blue">
<FORM ACTION="stgt.php"><INPUT TYPE=SUBMIT VALUE="Return"><INPUT TYPE=SUBMIT VALUE="Cancel"> </FORM>
</table>

</body>
</html>
2 changes: 1 addition & 1 deletion html/form.dump.tape.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Select Volume : <?php echo $cmd;?>
<input type="submit">
</form>
<FORM ACTION="vtlcmd.php">
<FORM ACTION="tools.php">
<INPUT TYPE=SUBMIT VALUE="Cancel">
</FORM>

Expand Down
4 changes: 1 addition & 3 deletions html/form.patch.install.mhvtl.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<table border="0">
<td>
<div style="overflow:auto;height:400px;width:600px;">
<div style="overflow:auto;height:150px;width:450px;">

<?php
$PATCH = $_REQUEST['patch'];
Expand All @@ -41,7 +41,5 @@
</TD>
</TABLE>

<FORM ACTION="form.patch.mhvtl.php"><INPUT TYPE=SUBMIT VALUE="Return"></FORM>

</body>
</html>
32 changes: 32 additions & 0 deletions html/form.patch.install.tgt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<html>
<head><title>MHVTL</title></head>
<link href="styles.css" rel="stylesheet" type="text/css">
<body>
<hr width="100%" size=10 color="blue">
<b><font color=purple size=3>Misc Tools</font><b>
<hr width="100%" size=1 color="blue">


<tr>
<td align=left valign=middle>
<img src="images/operation.png" >
</td>
</tr>

<?php
echo "<pre><b>Empty :</b></pre>";
?>

<hr width="100%" size=1 color="blue">

This function is currently not implemented

<hr width="100%" size=1 color="blue">
<br>
<input type="submit"></form>
<FORM ACTION="form.patch.mhvtl.php">
<INPUT TYPE=SUBMIT VALUE="Return">
</FORM>

</body>
</html>
Loading

0 comments on commit 67b5ae5

Please sign in to comment.