forked from freifunk-franken/simple-babelweb
Merge pull request #7 from ChristianDresel/master
Einrückungen komplett auf Tabs umgestellt
This commit is contained in:
commit
be7dfbe0a7
30
index.php
30
index.php
|
@ -45,7 +45,7 @@
|
|||
if (preg_match("/interface\b/", $read)) { $interface[] = $read; }
|
||||
if (preg_match("/neighbour\b/", $read)) { $neighbour[] = $read; }
|
||||
if (preg_match("/xroute\b/", $read)) { $xroute[] = $read; }
|
||||
# if (preg_match("/\broute\b/", $read)){ break 1; }
|
||||
#if (preg_match("/\broute\b/", $read)){ break 1; }
|
||||
if (preg_match("/\broute\b/", $read)){ $route[] = $read; }
|
||||
if (preg_match("/ok/", $read)){ break 1; }
|
||||
}
|
||||
|
@ -67,7 +67,6 @@
|
|||
'ipv4' => $tempdata[8],
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($neighbour as $temp) {
|
||||
$tempdata = explode(" ", $temp);
|
||||
$output['neighbours'][] = array(
|
||||
|
@ -103,14 +102,14 @@
|
|||
}
|
||||
|
||||
|
||||
if($_REQUEST['format'] == 'json') { echo json_encode($output); }
|
||||
if($_REQUEST['format'] == 'json') {
|
||||
echo json_encode($output); }
|
||||
else {
|
||||
# Ausgabe
|
||||
echo "<h1>Simple Babelweb</h1>";
|
||||
echo "<table>";
|
||||
foreach($output['data'] as $temp) { echo "<tr><td>$temp</td></tr>"; }
|
||||
echo "</table>";
|
||||
|
||||
echo "<H2>Interfaces</H2>";
|
||||
echo '<table>
|
||||
<tr>
|
||||
|
@ -125,7 +124,6 @@
|
|||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
echo "<H2>Neighbours</H2>";
|
||||
echo '<table>
|
||||
<tr>
|
||||
|
@ -144,7 +142,6 @@
|
|||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
echo "<H2>Redistributed routes</H2>";
|
||||
echo '<table>
|
||||
<tr>
|
||||
|
@ -158,7 +155,6 @@
|
|||
}
|
||||
echo "</table>";
|
||||
if($_REQUEST['routes'] == '1') {
|
||||
|
||||
echo "<H2>routes</H2>";
|
||||
echo '<table>
|
||||
<tr>
|
||||
|
@ -179,7 +175,6 @@
|
|||
|
||||
|
||||
if($_REQUEST['v4table'] == '1') {
|
||||
|
||||
echo "<H2>ipv4 routing table</H2>";
|
||||
echo '<table>';
|
||||
$v4routen = shell_exec('ip r s t $(grep import-table /etc/babeld.conf | cut -f2 -d" ")');
|
||||
|
@ -188,24 +183,19 @@
|
|||
echo "<tr>";
|
||||
$line = explode(" ", $v4route[$i]);
|
||||
for($n = 0; $n < 5; ++$n) {
|
||||
if ($n == 0)
|
||||
{
|
||||
if ($n == 0) {
|
||||
echo '<td><a href="'.$_SERVER["PHP_SELF"].'/?ip='.$line[$n].'">'.$line[$n].'</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo '<td>'.$line[$n].'</td>';
|
||||
}
|
||||
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
if($_REQUEST['v6table'] == '1') {
|
||||
|
||||
echo "<H2>ipv6 routing table</H2>";
|
||||
echo '<table>';
|
||||
$v6routen = shell_exec('ip -6 r s t $(grep import-table /etc/babeld.conf | cut -f2 -d" ")');
|
||||
|
@ -214,15 +204,12 @@
|
|||
echo "<tr>";
|
||||
$line = explode(" ", $v6route[$i]);
|
||||
for($n = 0; $n < 8; ++$n) {
|
||||
if ($n == 0)
|
||||
{
|
||||
if ($n == 0) {
|
||||
echo '<td><a href="'.$_SERVER["PHP_SELF"].'/?ip='.$line[$n].'">'.$line[$n].'</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo '<td>'.$line[$n].'</td>';
|
||||
}
|
||||
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
|
@ -250,8 +237,6 @@
|
|||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
|
@ -260,6 +245,5 @@
|
|||
<button type="submit" name="v4table" value="1">show import/export table ipv4</button>
|
||||
<button type="submit" name="v6table" value="1">show import/export table ipv6</button>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue