Commit b5ce50f2 authored by José Luis  Gutiérrez's avatar José Luis Gutiérrez Committed by Alessandro Rubini

/var/www local management tool addition

Adding php files, img and css for the local management tool
in userspace/rootfs_override/var/www folder:

./img: images for the tool
./css: css used
./   : php files
parent e81cb0d9
<?php include 'title.php'; ?>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<?php include 'menu.php'; ?>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
<div>
<br><br><br><br><br>
<a href='www.ugr.es'><IMG SRC='img/ugr.gif' align=right , vspace=7, hspace=23 , width=350 , hight=100 , border=0 , alt='UGR'></a>
<p>White-Rabbit switch Firmware v<?php $str = shell_exec("uname -v"); echo $str; ?> </p>
<p>Developed by José Luis Gutiérrez (jlgutierrez@ugr.es)</p>
<p>Open Hardware Repository http://www.ohwr.org/projects/white-rabbit</p>
<p>Built in <?php $str = shell_exec("/wr/bin/shw_ver -c"); echo $str; ?></p>
</div>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<html>
<head>
<title>White Rabbit Switch Management Tool</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="wrs.css">
</head>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<p><a href="index.php"> Dashboard </a></p>
<p>Monitor</p>
<p>Configuration</p>
<p><a href="tools.php"> Tools </a></p>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
<?php
echo '</br>Here is a list of white rabbit commands:';
echo '</br>------------------------------------------</br>';
$pre= shell_exec("ls /wr/bin/");
echo '</br>'.$pre.'</br>';
echo '</br>------------------------------------------</br>';
echo '</br></br></br>';
$cmd = htmlspecialchars($_POST["cmd"]);
echo '$' . $cmd . ':';
$output = shell_exec($cmd);
echo "<pre>$output</pre>";
?>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
html, body {margin:0; padding:0;}
.page {text-align:center; position:relative;}
.left-bar {position:absolute ; top:150px; left:0px; width:200px; height:83%; border-right:2px solid gray; font: menu; }
.right-bar {margin-left:200px; padding-top:150px;}
.header {position:fixed; left:0px; top:0px; right:0px; height:150px; border:1px solid gray; }
.content {height:73%;} /*replace with height:auto; for real content*/
.footer {height:60px; border-top:1px solid gray ; background:#eeeeee;}
.wrs-info { margin:20px ; text-align:left ;width:350px; height:300px; font-size: 10pt; text-align:left;}
<?php include 'title.php'; ?>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<?php include 'menu.php'; ?>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
<?php
$cmd = htmlspecialchars($_POST["cmd"]);
if(!strcmp($cmd, "halt")){
echo '<br><br><br></be>System is halting';
}else if (!strcmp($cmd, "reboot")){
echo '<br><br><br>System is rebooting. Please wait 30 seconds.';
}
$output = shell_exec($cmd);
?>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<a href='sysinfo.php'><IMG SRC='img/light_php.png' align=right , vspace=7, hspace=23 , width=100 , hight=100 , border=0 , alt='PHP Info'></a>
<a href='www.ugr.es'><IMG SRC='img/ugr.gif' align=left , vspace=7, hspace=23 , width=120 , hight=100 , border=0 , alt='UGR'></a>
</br>
<a href="http://www.ohwr.org/projects/white-rabbit/"> White Rabbit Project - Open Hardware and Source Project </a> <a href="http://www.ohwr.org/projects/white-rabbit/"> http://www.ohwr.org/projects/white-rabbit/ </a>
<?php
function wrs_main_info(){
echo "<table border='1' align='left'>";
echo '<tr><h1><center>Switch Information</center></h1></tr>';
echo '<tr><th><b>Hostname:</b></th><th>'; $str = shell_exec("uname -n"); echo $str; echo '</th></tr>';
echo '<tr><th> <b>IP Address:</b> </th><th>'; $ip = shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'"); echo $ip; echo '</th></tr>';
echo '<tr><th> <b>OS Release:</b> </th><th>'; $str = shell_exec("uname -r"); echo $str; echo '</th></tr>';
echo '<tr><th> <b>OS name:</b> </th><th>'; $str = shell_exec("uname -s"); echo $str; echo '</th></tr>';
echo '<tr><th> <b>OS Version:</b> </th><th>'; $str = shell_exec("uname -v"); echo $str; echo '</th></tr>';
echo '<tr><th> <b>PCB Version:</b> </th><th>'; $str = shell_exec("/wr/bin/shw_ver -p"); echo $str; echo '</th></tr>';
echo '<tr><th> <b>FPGA:</b> </th><th>'; $str = shell_exec("/wr/bin/shw_ver -f"); echo $str; echo '</th></tr>';
echo '<tr><th> <b>Compiling time:</b> </th><th>'; $str = shell_exec("/wr/bin/shw_ver -c"); echo $str; echo '</th></tr>';
echo '</table>';
}
?>
<?php
$str = shell_exec("/wr/bin/wr_management ports");
$ports = explode(" ", $str);
echo "<a href='index.php'><IMG SRC='img/wr_logo.png' align=left , vspace=7, hspace=23 , width=150 , hight=100 , border=0 , alt='White Rabbit'></a>";
echo "<table border='0' align='center' vspace=37 >";
echo '<tr>';
for($i=1; $i<18*4; $i=$i+4){
if (strstr($ports[($i-1)],"up")){
if (strcmp($ports[($i)],"Master")){
echo '<th>'."<IMG SRC='img/master.png' align=left , width=50 , hight=50 , border=0 , alt='master'>".'</th>';
}else{
echo '<th>'."<IMG SRC='img/slave.png' align=left , width=50 , hight=50 , border=0 , alt='slave'>".'</th>';
}
}else{
echo '<th>'."<IMG SRC='img/linkdown.png' align=left , width=50 , hight=50 , border=0 , alt='down'>".'</th>';
}
}
echo '</tr>';
echo '<tr>';
for($i=1; $i<18*4; $i=$i+4){
if (!strstr($ports[($i+1)],"NoLock")){
echo '<th>'."<IMG SRC='img/locked.png' align=center , width=20 , hight=20 , border=0 , alt='locked'>";
}else{
echo '<th>'."<IMG SRC='img/unlocked.png' align=center , width=20 , hight=20 , border=0 , alt='unlocked'>";
}
if (!strstr($ports[($i+2)],"Uncalibrated")){
echo "<IMG SRC='img/check.png' align=center , width=20 , hight=20 , border=0 , alt='check'>".'</th>';
}else{
echo "<IMG SRC='img/uncheck.png' align=center , width=20 , hight=20 , border=0 , alt='uncheck'>".'</th>';
}
}
echo '</tr>';
echo '<tr>';
echo "<a href='http://www.ohwr.org/projects/wr-switch-sw'><IMG SRC='img/ohr.png' align=right , vspace=7, hspace=23 , width=100 , hight=100 , border=0 , alt='OHR'></a>";
echo '</tr>';
echo '</table>';
?>
<?php include 'title.php'; ?>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<?php include 'menu.php'; ?>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
<div class="wrs-info" >
<?php
include 'functions.php';
wrs_main_info();
?>
</div>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<?php include 'title.php'; ?>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<?php include 'menu.php'; ?>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
<br><br><br><br><br><br>
<center>
<form action="exe_program.php" method="post">
<input type="hidden" name="cmd" value="halt">
<input type="submit" value="Halt switch">
</form>
<form action="exe_program.php" method="post">
<input type="hidden" name="cmd" value="reboot">
<input type="submit" value="Reboot switch">
</form>
</center>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<p><a href="index.php"> Dashboard </a></p>
<!-- <p>Monitor</p> -->
<!-- <p>Configuration</p> -->
<p><a href="vlan.php"> VLAN Configuration </a></p>
<p><a href="tools.php"> Command Execution </a></p>
<p><a href="management.php"> Switch Management </a></p>
<p><a href="about.php"> About </a></p>
<?php include 'title.php'; ?>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<?php include 'menu.php'; ?>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
<div class="wrs-info" >
<form action="cgi-bin/test.php" method="post">
Command: <input type="text" name="cmd"><br>
<input type="submit">
</form>
</div>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<html>
<head>
<title>White Rabbit Switch Management Tool</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="css/wrs.css">
</head>
<?php include 'title.php'; ?>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<?php include 'menu.php'; ?>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
</br>
</br></br>
<FORM action="command.php" method="POST" accept-charset="UTF-8">
Unix Command: <input type="text" name="cmd">
<input type="submit" value="Submit">
</FORM>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<?php include 'title.php'; ?>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<?php include 'menu.php'; ?>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
<?php
echo '<table align=center border="1">';
echo '<tr><td>Endpoint</td><td>VLANs</td></tr>';
for($i = 0; $i < 18; $i++){
echo '<tr>';
echo '<th>wr'.$i.'</th>';
//Print here all the vlans the endpoint belongs to. in <th> </th>
//Show the Vlan option button
echo '<th>';
echo '<form action="exe_program.php" method=POST><div>
<select name="cmd">';
for($op = 0; $op < 18; $op++){
echo '<option value="VLAN'.$op.'">Vlan'.$op.'</option>';
}
echo '</select>
<input type="submit" value="Add VLAN">
</form>';
echo '</th>';
echo '</tr>';
}
echo '</table>';
?>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment