From fc0e788ee194d71fafe9d3317d5297fb82c2a627 Mon Sep 17 00:00:00 2001 From: Dennis Eisold Date: Sat, 30 Dec 2017 00:08:54 +0100 Subject: [PATCH] minified html --- index.php | 112 ++++++++++++++++++++++++------------------------------ 1 file changed, 50 insertions(+), 62 deletions(-) diff --git a/index.php b/index.php index 9e5388c..14f529a 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,6 @@ Simple Babelweb - - $data[0], + 'version' => $data[1], + 'host' => $data[2], + 'id' => $data[3], + ); + foreach ($interface as $temp) { $tempdata = explode(" ", $temp); $output['interfaces'][] = array( @@ -91,19 +88,15 @@ ); } - if($_REQUEST['format'] == 'json') { - echo json_encode($output); - } + if($_REQUEST['format'] == 'json') { echo json_encode($output); } else { # Ausgabe echo "

Simple Babelweb

"; echo ""; - for($i = 0; $i < count($data); ++$i) { - if ($data[$i] == "ok") { - break; - } - echo ""; - } + echo ""; + echo ""; + echo ""; + echo ""; echo "
$data[$i]
".$output['data']['name']."
".$output['data']['version']."
".$output['data']['host']."
".$output['data']['id']."
"; echo "

Interfaces

"; @@ -115,51 +108,46 @@ ipv4 '; foreach($output['interfaces'] as $interface) { - echo "".$interface['interface']."". - "".$interface['up']."". - "".$interface['ipv6']."". - "".$interface['ipv4'].""; + echo ""; + foreach($interface as $temp) { echo "$temp"; } + echo ""; } echo ""; + echo "

Neighbours

"; - echo ' - - - - - - - - - - - '; + echo '
neighbouraddressinterfacereachrxcosttxcostrttrttcostcost
+ + + + + + + + + + + '; foreach($output['neighbours'] as $neighbour) { - echo "". - "". - "". - "". - "". - "". - "". - "". - ""; + echo ""; + foreach($neighbour as $temp) { echo ""; } + echo ""; } echo "
neighbouraddressinterfacereachrxcosttxcostrttrttcostcost
".$neighbour['neighbour']."".$neighbour['address']."".$neighbour['interface']."".$neighbour['reach']."".$neighbour['rxcost']."".$neighbour['txcost']."".$neighbour['rtt']."".$neighbour['rttcost']."".$neighbour['cost']."
$temp
"; + echo "

Redistributed routes

"; - echo ' - - - - - '; + echo '
prefixfrommetric
+ + + + + '; foreach($output['xroutes'] as $xroute) { - echo "". - "". - ""; + echo ""; + foreach($xroute as $temp) { echo ""; } + echo ""; } echo "
prefixfrommetric
".$xroute['prefix']."".$xroute['from']."".$xroute['metric']."
$temp
"; } ?> - + \ No newline at end of file