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

Local Management Tool New Interface

New CSS for the tool.
PHP files update.
New Dashboard

Adding features:
	- PTP Configuration
	- Endpoint Configuration
	- Halt System
	- Reboot System
	- File Transfer
	- Load LM32 & FPGA binaries.
	- Terminal emulator
	- Contact us

Issues:
VLAN is not yet available
parent a309fcdd
<?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>
<?php include 'functions.php'; include 'head.php'; ?>
<body>
<div class="main">
<div class="page">
<div class="header" >
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
<?php include 'topmenu.php' ?>
</div>
</div>
<div class="content">
<div class="leftpanel">
<h2>Main Menu</h2>
<?php include 'menu.php' ?>
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">Contact</h1>
<p><strong>White-Rabbit switch Firmware v<?php $str = shell_exec("uname -v"); echo $str; ?> </strong></p><p>&nbsp;</p>
<p><strong>Open Hardware Repository <a href="http://www.ohwr.org/projects/white-rabbit/wiki">http://www.ohwr.org/projects/white-rabbit/wiki</a> </strong></p></strong></p><p>&nbsp;</p>
<p><strong>Built in <?php $str = shell_exec("/wr/bin/shw_ver -c"); echo $str; ?></strong></p><p>&nbsp;</p>
<a href='http://www.ugr.es'><IMG SRC='img/ugr.gif' align=right width=250 , hight=100 , border=0 , alt='UGR'></a><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
<p align=right><strong>Developed by Jos&eacute; Luis Guti&eacute;rrez <a href="mailto:jlgutierrez@ugr.es?subject=[White-Rabbit Switch Local Management Tool]">(jlgutierrez@ugr.es)</a> </strong></p>
</div>
</div>
</div>
<div class="footer">
<?php include 'footer.php' ?>
</div>
</div>
</div>
</body>
</html>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
background-image: url(../img/bg.jpg);
background-repeat: repeat;
margin: 30px 0px 0px 0px;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, li, form, input, textarea {
padding: 0px;
margin: 0px;
}
.main {
width: 840px;
margin: 0px auto;
}
.page {
background-color: #FFFFFF;
width: 800px;
float: left;
padding: 0px 20px;
margin-bottom: 20px;
}
.header, .header-img {
width: 800px;
float: left;
}
.header-ports {
background-image: url(../img/header.jpg);
height: 140px;
margin-top: 15px;
}
.header h1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 30px;
font-weight: normal;
line-height: 80%;
color: #1C1C1C;
margin-top: 25px;
margin-left: 5px;
}
.topmenu {
background-color: #000000;
width: 800px;
height: 50px;
float: left;
}
.topmenu ul {
height: 15px;
margin: 18px 0px 0px 20px;
list-style-type: none;
}
.topmenu ul li {
background-image: url(../img/bullet.jpg);
background-repeat: no-repeat;
background-position: left top;
height: 15px;
float: left;
padding-left: 14px;
margin-right: 31px;
}
.topmenu ul li a {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: normal;
color: #FFFFFF;
text-decoration: none;
}
.topmenu ul li a:hover {
color: #23b14d;
}
.content {
width: 800px;
float: left;
}
.leftpanel {
background-color: #ededed;
width: 220px;
float: left;
padding: 25px 20px;
margin-right: -260px;
position: relative;
}
.leftpanel h2 {
font-size: 14px;
line-height: 100%;
text-transform: uppercase;
color: #000000;
padding-bottom: 5px;
margin-bottom: 17px;
border-bottom-width: 1px;
border-bottom-style: dashed;
border-bottom-color: #cccccc;
}
.leftpanel ul {
margin-bottom: 22px;
list-style-type: none;
}
.leftpanel ul li {
margin-bottom: 5px;
}
.leftpanel ul li a {
font-size: 11px;
font-weight: bold;
color: #000000;
text-decoration: none;
}
.leftpanel ul li a:hover {
color: #23b14d;
}
.rightpanel {
width: 540px;
float: left;
border-left: solid 260px #eaeff3;
}
.rightbody {
text-align: justify;
width: 480px;
float: left;
padding: 25px 0px 25px 40px;
}
.rightbody strong {
color: #000000;
}
.title {
font-size: 14px;
line-height: 100%;
text-transform: uppercase;
color: #000000;
padding-bottom: 5px;
margin-bottom: 17px;
border-bottom-width: 1px;
border-bottom-style: dashed;
border-bottom-color: #cccccc;
}
.copyright {
border: 0px;
height: 1px;
width: 1px;
}
.footer {
background-image: url(../img/footer.jpg);
background-repeat: no-repeat;
background-position: left top;
width: 800px;
height: 77px;
float: left;
}
.footer p {
font-size: 11px;
line-height: 57px;
color: #FFFFFF;
text-align: center;
}
.footer-link {
color:#ffffff;
text-decoration:none;
}
.btn {
background: #3498db;
background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
background-image: -moz-linear-gradient(top, #3498db, #2980b9);
background-image: -ms-linear-gradient(top, #3498db, #2980b9);
background-image: -o-linear-gradient(top, #3498db, #2980b9);
background-image: linear-gradient(to bottom, #3498db, #2980b9);
-webkit-border-radius: 60;
-moz-border-radius: 60;
border-radius: 60px;
font-family: Arial;
color: #ffffff;
font-size: 12px;
padding: 1px 5px 2px 7px;
text-decoration: none;
}
.btn:hover {
background: #3cb0fd;
background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db);
background-image: -moz-linear-gradient(top, #3cb0fd, #3498db);
background-image: -ms-linear-gradient(top, #3cb0fd, #3498db);
background-image: -o-linear-gradient(top, #3cb0fd, #3498db);
background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
text-decoration: none;
}
.sec {
background: #9bcff2;
background-image: -webkit-linear-gradient(top, #9bcff2, #4fa2d6);
background-image: -moz-linear-gradient(top, #9bcff2, #4fa2d6);
background-image: -ms-linear-gradient(top, #9bcff2, #4fa2d6);
background-image: -o-linear-gradient(top, #9bcff2, #4fa2d6);
background-image: linear-gradient(to bottom, #9bcff2, #4fa2d6);
-webkit-border-radius: 5;
-moz-border-radius: 5;
border-radius: 5px;
font-family: Arial;
color: #ffffff;
font-size: 12px;
padding: 1px 5px 2px 7px;
text-decoration: none;
}
.sec:hover {
background: #3cb0fd;
background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db);
background-image: -moz-linear-gradient(top, #3cb0fd, #3498db);
background-image: -ms-linear-gradient(top, #3cb0fd, #3498db);
background-image: -o-linear-gradient(top, #3cb0fd, #3498db);
background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
text-decoration: none;
}
table.altrowstable {
font-family: verdana,arial,sans-serif;
font-size: 10px;
color: #333333;
border-width: 1px;
border-color: #a9c6c9;
border-collapse: collapse;
}
table.altrowstable th {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
}
table.altrowstable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
}
.oddrowcolor{
background-color: #d4e3e5;
}
.evenrowcolor{
background-color: #c3dde0;
}
.tableheader {
background-color: #95BEE6;
color:white;
font-weight:bold;
}
.tablerow {
background-color: #A7D6F1;
color:white;
}
.message {
color: #FF0000;
font-weight: bold;
text-align: center;
width: 80%;
}
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 'functions.php'; include 'head.php'; ?>
<body>
<div class="main">
<div class="page">
<div class="header" >
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
<?php include 'topmenu.php' ?>
</div>
</div>
<div class="content">
<div class="leftpanel">
<h2>Main Menu</h2>
<?php include 'menu.php' ?>
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">Endpoint Configuration</h1>
<?php
echo '<form method=POST>
Select an Endpoint: <select name="endpoint" class="sec">';
for($op = 0; $op < 18; $op++){
echo '<option value="wr'.$op.'">wr'.$op.'</option>';
}
echo '</select>';
echo '<select name="option1" class="sec">';
echo '<option value="txcal1">Enable Calibration Transmittion</option>';
echo '<option value="txcal0">Disable Calibration Transmittion</option>';
echo '<option value="dump">See Registers</option>';
echo '<option value="wr">Modify Registers</option>';
//echo '<option value="rt">Show Flags</option>';
echo '<option value="lock">Lock Endpoint</option>';
echo '<option value="master">Make Endpoint Master</option>';
echo '<option value="gm">Make Endpoint GrandMaster</option>';
echo '</select>
<input type="submit" value="Go!" class="btn">
</form>';
//Second option levels:
$option1=htmlspecialchars($_POST['option1']);
$endpoint=htmlspecialchars($_POST['endpoint']);
//Calling phytool.
if(!empty($option1)){
wr_endpoint_phytool($option1, $endpoint);
}
echo '<br><hr><br>';
wr_show_endpoint_rt_show();
echo '<br><hr><br>';
?>
</div>
</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">
<?php
$cmd = htmlspecialchars($_POST["cmd"]);
if(!strcmp($cmd, "halt")){
echo '<br><br><br></be>System is halting';
$output = shell_exec($cmd);
}else if (!strcmp($cmd, "reboot")){
echo '<br><br><br>System is rebooting. Please wait 30 seconds.';
$output = shell_exec($cmd);
}else if (!strcmp($cmd, "rw")){
$output = shell_exec("/wr/bin/wrfs_mnt.sh rw");
echo '<br><br><br>Partition mounted as rw';
}else if (!strcmp($cmd, "ro")){
$output = shell_exec("/wr/bin/wrfs_mnt.sh ro");
echo '<br><br><br>Partition mounted as ro';
}
?>
</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>
<img src="img/footnote.gif" class="copyright" alt="White-Rabbit OHR"></a>
<a href='index.php'><IMG SRC='img/wr_logo.png' align=left , vspace=7, hspace=5, width=50 , hight=100 , border=0 , alt='White Rabbit'></a>
<a href='http://www.ohwr.org/projects/wr-switch-sw' target="_blank"><IMG SRC='img/ohr.png' align=left , vspace=7, hspace=5, width=35 , hight=100 , border=0 , alt='OHR'></a>
<p>White Rabbit Project - Open Hardware and Source Project <a class="footer-link" target="_blank"
href="http://www.ohwr.org/projects/white-rabbit/wiki">White-Rabbit OHR</a>
<a href='sysinfo.php' target="_blank"><IMG SRC='img/light_php.png' align=right , vspace=7, hspace=5, width=100 , hight=100 , border=0 , alt='PHP Info'></a>
<img src="img/footnote.gif" class="copyright" alt="White-Rabbit OHR"></a>
</p>
<?php shell_exec('killall php-cgi'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>White-Rabbit Local Management Tool</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css">
<!-- Javascript goes in the document HEAD -->
<script type="text/javascript">
function altRows(id){
if(document.getElementsByTagName){
var table = document.getElementById(id);
var rows = table.getElementsByTagName("tr");
for(i = 0; i < rows.length; i++){
if(i % 2 == 0){
rows[i].className = "evenrowcolor";
}else{
rows[i].className = "oddrowcolor";
}
}
}
}
window.onload=function(){
altRows('alternatecolor');
}
</script>
</head>
<?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 'functions.php'; include 'head.php'; ?>
<body>
<div class="main">
<div class="page">
<div class="header" >
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
<?php include 'topmenu.php' ?>
</div>
</div>
<div class="content">
<div class="leftpanel">
<h2>Main Menu</h2>
<?php include 'menu.php' ?>
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">Dashboard</h1>
<?php
wrs_main_info();
echo '<br><br>';
?>
</div>
</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>
<div>
<FORM method="POST" ENCTYPE="multipart/form-data">
Load FPGA binary <INPUT type=file name="file">
<INPUT type=submit value="Load">
<INPUT type=hidden name=MAX_FILE_SIZE VALUE=8192>
</FORM>
</div>
<?
$uploaddir = '/tmp/';
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} //else {
//echo "Possible file upload attack!\n";
//}
//echo 'Here is some more debugging info:';
//print_r($_FILES);
print "</pre>";
?>
<? include 'functions.php'; wrs_check_writeable(); ?>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<?php include 'functions.php'; include 'head.php'; ?>
<body>
<div class="main">
<div class="page">
<div class="header" >
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
<?php include 'topmenu.php' ?>
</div>
</div>
<div class="content">
<div class="leftpanel">
<h2>Main Menu</h2>
<?php include 'menu.php' ?>
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">Load LM32 & FPGA Files</h1>
<table border="0" align="center">
<tr>
<th ><FORM method="POST" ENCTYPE="multipart/form-data" >
<INPUT type=file name="fpgafile" >
<INPUT type=submit Value="Load FPGA bin" class="btn" >
<INPUT type=hidden name=MAX_FILE_SIZE VALUE=<?php wrs_php_filesize();?>000>
</FORM></th>
</tr>
<tr>
<th ><FORM method="POST" ENCTYPE="multipart/form-data">
<INPUT type=file name="lm32file" >
<INPUT type=submit value="Load lm32 bin" class="btn">
<INPUT type=hidden name=MAX_FILE_SIZE VALUE=<?php wrs_php_filesize();?>000>
</FORM></th>
</tr>
<tr>
<th ><FORM method="POST" ENCTYPE="multipart/form-data">
<INPUT type=file name="file" >
<INPUT type=submit value="Load firmware" class="btn" >
<INPUT type=hidden name=MAX_FILE_SIZE VALUE= <?php wrs_php_filesize();?>000>
</FORM></th>
</tr>
</table>
<br><br><br><center>Max. filesize is <?php echo shell_exec("cat /etc/php.ini | grep upload_max_filesize | awk '{print $3}'");
echo '(<a href="management.php">Change it!</a>)';?></center>
<?
wrs_load_files();
echo '<center>';
wrs_check_writeable();
echo '</center>';
?>
</div>
</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">
Halt system: <input type="hidden" name="cmd" value="halt">
<input type="submit" value="Halt switch">
</form>
<form action="exe_program.php" method="post">
Reboot system: <input type="hidden" name="cmd" value="reboot">
<input type="submit" value="Reboot switch">
</form>
</form>
<form action="exe_program.php" method="post">
Mount partition as rw: <input type="hidden" name="cmd" value="rw">
<input type="submit" value="Remount">
</form>
</form>
<form action="exe_program.php" method="post">
Mount partition as ro: <input type="hidden" name="cmd" value="ro">
<input type="submit" value="Remount">
</form>
</center>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<?php include 'functions.php'; include 'head.php'; ?>
<body>
<div class="main">
<div class="page">
<div class="header" >
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
<?php include 'topmenu.php' ?>
</div>
</div>
<div class="content">
<div class="leftpanel">
<h2>Main Menu</h2>
<?php include 'menu.php' ?>
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">Switch Management</h1>
<table border="0" align="center">
<tr>
<form method="post">
<th><center>Halt system: </center><input type="hidden" name="cmd" value="halt"></th>
<th><input type="submit" value="Halt switch" class="btn"></th>
</form>
</tr>
<tr>
<form method="post">
<th><center>Reboot system: </center><input type="hidden" name="cmd" value="reboot"></th>
<th><input type="submit" value="Reboot switch" class="btn"></th>
</form>
</tr>
</tr><th> </th><th> </th><tr></tr><th> </th><th> </th><tr>
<tr>
</form>
<form method="post">
<th><center>Mount partition as rw: </center><input type="hidden" name="cmd" value="rw"></th>
<th><input type="submit" value="Remount" class="btn"></th>
</form>
</tr>
<tr>
</form>
<form method="post">
<th><center>Mount partition as ro: </center><input type="hidden" name="cmd" value="ro"></th>
<th><input type="submit" value="Remount" class="btn"></th>
</form>
</tr>
</tr><th> </th><th> </th><tr></tr><th> </th><th> </th><tr>
<tr>
<form method="post">
<th>Change PHP File Size Upload: <INPUT type="text" name="size" > </th>
<input type="hidden" name="cmd" value="size">
<th><input type="submit" value="Change" class="btn"></th>
</form>
</tr>
</table>
<?php
wrs_management();
?>
</div>
</div>
</div>
<div class="footer">
<?php include 'footer.php' ?>
</div>
</div>
</div>
</body>
</html>
<p><a href="index.php"> Dashboard </a></p>
<p><a href="vlan.php"> VLAN Configuration </a></p>
<p><a href="management.php"> Switch Management </a></p>
<p><a href="load.php"> LM32 & FPGA </a></p>
<p><a href="terminal.php"> Terminal Emulator </a></p>
<p><a href="about.php"> About </a></p>
<ul>
<li><a href="index.php"> Dashboard </a></li>
<li><a href="vlan.php"> VLAN Configuration </a></li>
<li><a href="ptp.php"> PTP Configuration </a></li>
<li><a href="endpoint.php"> Endpoint Configuration </a></li>
<li><a href="management.php"> Switch Management </a></li>
<li><a href="load.php"> LM32 & FPGA </a></li>
<li><a href="terminal.php"> Console </a></li>
</ul>
<?php include 'functions.php'; include 'head.php'; ?>
<body>
<div class="main">
<div class="page">
<div class="header" >
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
<?php include 'topmenu.php' ?>
</div>
</div>
<div class="content">
<div class="leftpanel">
<h2>Main Menu</h2>
<?php include 'menu.php' ?>
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">PTP Configuration</h1>
<FORM method="POST">
<table border="0" align="center">
<tr>
<th align=left>PTP Daemon: </th>
<th><input type="radio" name="daemongroup" value="On" <?php echo (wrs_check_ptp_status()) ? 'checked' : ''; ?> > On <br>
<input type="radio" name="daemongroup" value="Off" <?php echo (wrs_check_ptp_status()) ? '' : 'checked'; ?> > Off <br>
<th><INPUT type="submit" value="Update" class="btn"></th>
</tr>
</table>
</FORM>
<FORM method="POST">
<table border="0" align="center">
<tr>
<th align=left>Network Interface Binding: </th>
<th><INPUT type="text" name="b" ></th>
</tr>
<tr>
<th align=left>Unicast to Address: </th>
<th><INPUT type="text" name="u" ></th>
</tr>
<tr>
<th align=left>PTP Domain Number: </th>
<th><INPUT type="text" name="i" ></th>
</tr>
<tr>
<th align=left>Announce Interval: </th>
<th><INPUT type="text" name="n" ></th>
</tr>
<tr>
<th align=left>Sync Interval: </th>
<th><INPUT type="text" name="y" ></th>
</tr>
<tr>
<th align=left>Clock Accuracy: </th>
<th><INPUT type="text" name="r" ></th>
</tr>
<tr>
<th align=left >Clock Class: </th>
<th><INPUT type="text" name="v" ></th>
</tr>
<tr>
<th align=left>Priority: </th>
<th><INPUT type="text" name="p" ></th>
<th><INPUT type="submit" value="Submit Configuration" class="btn"></th>
</tr>
</table>
</FORM>
<?php
if(!empty($_POST["b"])){
$cmd = shell_exec("/wr/bin/ptpd -b ".htmlspecialchars($_POST["b"]));
echo '<br>Network Interface binded to '.htmlspecialchars($_POST["b"]);
}
if (!empty($_POST["u"])){
$cmd = shell_exec("/wr/bin/ptpd -u ".htmlspecialchars($_POST["u"]));
echo '<br>Unicast sent to '.htmlspecialchars($_POST["u"]);
}
if (!empty($_POST["i"])){
$cmd = shell_exec("/wr/bin/ptpd -i ".htmlspecialchars($_POST["i"]));
echo '<br>PTP Domain number is now '.htmlspecialchars($_POST["i"]);
}
if (!empty($_POST["n"])){
$cmd = shell_exec("/wr/bin/ptpd -n ".htmlspecialchars($_POST["n"]));
echo '<br>Announce Interval set to '.htmlspecialchars($_POST["n"]);
}
if (!empty($_POST["y"])){
$cmd = shell_exec("/wr/bin/ptpd -y ".htmlspecialchars($_POST["y"]));
echo '<br>Sync Interval set to '.htmlspecialchars($_POST["y"]);
}
if (!empty($_POST["r"])){
$cmd = shell_exec("/wr/bin/ptpd -r ".htmlspecialchars($_POST["r"]));
echo '<br>Clock accuracy set to '.htmlspecialchars($_POST["r"]);
}
if (!empty($_POST["v"])){
$cmd = shell_exec("/wr/bin/ptpd -v ".htmlspecialchars($_POST["v"]));
echo '<br>Clock Class is now set to '.htmlspecialchars($_POST["v"]);
}
if (!empty($_POST["p"])){
$cmd = shell_exec("/wr/bin/ptpd -p ".htmlspecialchars($_POST["p"]));
echo '<br>Priority changed to '.htmlspecialchars($_POST["p"]);
}
if ((!empty($_POST["daemongroup"])) && (!strcmp(htmlspecialchars($_POST["daemongroup"]),"On"))){
$cmd = shell_exec("/wr/bin/ptpd -A");
echo 'PTPd enabled and daemonized!';
}
if ((!empty($_POST["daemongroup"])) && (!strcmp(htmlspecialchars($_POST["daemongroup"]),"Off"))){
$cmd = shell_exec("killall ptpd");
echo 'PTPd killed!';
}
?>
</div>
</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>
<FORM action="terminal.php" method="POST" accept-charset="UTF-8">
Unix Command: <input type="text" name="cmd">
<input type="submit" value="Submit">
</FORM>
<?php
$cmd = htmlspecialchars($_POST["cmd"]);
echo '$' . $cmd . ':';
$output = shell_exec($cmd);
echo $output;
?>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<?php include 'functions.php'; include 'head.php'; ?>
<body>
<div class="main">
<div class="page">
<div class="header" >
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
<?php include 'topmenu.php' ?>
</div>
</div>
<div class="content">
<div class="leftpanel">
<h2>Main Menu</h2>
<?php include 'menu.php' ?>
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">White-Rabbit Switch Console</h1>
<FORM action="terminal.php" method="POST" accept-charset="UTF-8">
Unix Command: <input type="text" name="cmd">
<input type="submit" value="Enter" class="btn">
</FORM>
<?php
$cmd = htmlspecialchars($_POST["cmd"]);
$output = shell_exec($cmd);
echo '<div align="center"> <div id="preview" style= "BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 0px;
BORDER-TOP: #000 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; WORD-SPACING: 1px; OVERFLOW: scroll;
BORDER-LEFT: #000 1px solid; WIDTH: 100%; PADDING-TOP: 1px;
BORDER-BOTTOM: #000 2px solid; HEIGHT: 350px; TEXT-ALIGN: left">
<p>$'.$cmd.':<br>'.$output.'</p> </div></div>';
?>
</div>
</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">
<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>
<ul>
<li><a href="index.php"> Dashboard </a></li>
<li><a href="vlan.php"> VLAN Configuration </a></li>
<li><a href="ptp.php"> PTP Configuration </a></li>
<li><a href="endpoint.php"> Endpoint Configuration </a></li>
<li><a href="contact.php"> Contact Us </a></li>
</ul>
<?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>
<?php include 'functions.php'; include 'head.php'; ?>
<body>
<div class="main">
<div class="page">
<div class="header" >
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
<?php include 'topmenu.php' ?>
</div>
</div>
<div class="content">
<div class="leftpanel">
<h2>Main Menu</h2>
<?php include 'menu.php' ?>
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">VLAN Configuration</h1>
<?php
echo '<table align=center border="1" class="altrowstable" id="alternatecolor">';
echo '<tr><th>Endpoint</th><th>VLANs</th></tr>';
for($i = 0; $i < 18; $i++){
echo '<tr>';
echo '<td>wr'.$i.'</td>';
//Print here all the vlans the endpoint belongs to. in <th> </th>
//Show the Vlan option button
echo '<td>';
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 '</td>';
echo '</tr>';
}
echo '</table>';
?>
</div>
</div>
</div>
<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