remove table for faster load

This commit is contained in:
Christian Dresel 2018-08-25 18:13:19 +02:00
parent 044f3d3702
commit 4b3f815a48
1 changed files with 32 additions and 159 deletions

View File

@ -39,6 +39,8 @@ data=$(echo "dump" | nc ::1 33123)
<button type="submit" name="routes" value="1">show all babel routes</button>
<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>
<input type="text" size="17" name="ip">
<button type="submit" name="weg" value="1">Wege zur IP Adresse</button>
</form>
<br />
<H2>Babel information</H2>
@ -55,209 +57,80 @@ data=$(echo "dump" | nc ::1 33123)
<tr>
<td><% echo "$data" | head -n 4 | tail -n 1 %> </td>
</tr>
</table>
<br />
<%
if ! [ ${GET_routes} ] && ! [ ${GET_v4table} ] && ! [ ${GET_v6table} ]; then
if ! [ ${GET_routes} ] && ! [ ${GET_v4table} ] && ! [ ${GET_v6table} ] && ! [ ${GET_weg} ] ; then
%>
<H2>Interfaces</H2>
<table>
<tr>
<th>Interface</th>
<th>up</th>
<th>ipv6</th>
<th>ipv4</th>
</tr>
<%
<%
echo "$data" | grep interface | while read line ; do
echo "<tr>"
echo "<td>"
echo ${line#*interface} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*up} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*ipv6} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*ipv4} | cut -d " " -f 1
echo "</td>"
echo "</tr>"
echo "$line"
echo "<br>"
done
%>
</table>
<br />
<H2>Neighbours</H2>
<table>
<tr>
<th>address</th>
<th>interface</th>
<th>reach</th>
<th>rxcost</th>
<th>txcost</th>
<th>rtt</th>
<th>rttcost</th>
<th>cost</th>
</tr>
<%
echo "$data" | grep neighbour | while read line ; do
echo "<tr>"
echo "<td>"
echo ${line#*address} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*if} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*reach} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*rxcost} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*txcost} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*rtt} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*rttcost} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*cost} | cut -d " " -f 1
echo "</td>"
echo "</tr>"
echo $line
echo "<br>"
done
%>
</table>
<br />
<H2>Redistributed routes</H2>
<table>
<tr>
<th>prefix</th>
<th>metric</th>
</tr>
<%
echo "$data" | grep xroute | while read line ; do
echo "<tr>"
echo "<td>"
echo ${line#*prefix} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*metric} | cut -d " " -f 1
echo "</td>"
echo "</tr>"
echo $line
echo "<br>"
done
%>
</table>
<%
fi
if [ ${GET_routes} ]; then
%>
<table>
<tr>
<th>target</th>
<th>installed</th>
<th>via</th>
<th>device</th>
<th>metric</th>
<th>Destination ID</th>
</tr>
<%
%>
<H2>All routes</H2>
<%
echo "$data" | grep route | grep -v xroute | while read line ; do
echo "<tr>"
echo "<td>"
echo ${line#*prefix} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*installed} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*via} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*if} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*metric} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*id} | cut -d " " -f 1
echo "</td>"
echo "</tr>"
echo $line
echo "<br>"
done
fi
%>
</table>
<%
if [ ${GET_v4table} ]; then
%>
<table>
<tr>
<th>target</th>
<th>via</th>
<th>dev</th>
</tr>
<H2>Show IPv6 Routing Tabele</H2
<%
v4routen=$(ip ro sh tab 10)
echo "$v4routen" | while read line ; do
echo "<tr>"
echo "<td>"
echo $line | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*via} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*dev} | cut -d " " -f 1
echo "</td>"
echo "</tr>"
echo $line
echo "<br>"
done
fi
%>
</table>
<%
if [ ${GET_v6table} ]; then
%>
<table>
<tr>
<th>Destination</th>
<th>Source Specific</th>
<th>via</th>
<th>Device</th>
<th>Kernelmetric</th>
</tr>
<H2>Show IPv6 Routing Tabele</H2>
<%
v6routen=$(ip -6 ro sh tab 10)
echo "$v6routen" | while read line ; do
echo "<tr>"
echo "<td>"
echo $line | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*from} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*via} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*dev} | cut -d " " -f 1
echo "</td>"
echo "<td>"
echo ${line#*metric} | cut -d " " -f 1
echo "</td>"
echo "</tr>"
echo $line
echo "<br>"
done
fi
if [ ${GET_weg} ]; then
%>
<H2>Wege zu <%# echo ${GET_ip} %></H2>
<%
v6routen=$(ip -6 ro sh tab 10)
echo "$v6routen" | while read line ; do
echo $line
echo "<br>"
done
fi
%>
</table>
</body>