forked from freifunk-franken/firmware
74 lines
2.8 KiB
Plaintext
Executable File
74 lines
2.8 KiB
Plaintext
Executable File
#!/usr/bin/haserl
|
|
<% echo -en "content-type: text/html\r\n\r\n" %>
|
|
<% . /etc/firmware_release %>
|
|
<!DOCTYPE html>
|
|
<html lang="de"><head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>FFF Router :: <% echo $(uci get -q system.@system[0].hostname) %></title>
|
|
<link rel="stylesheet" href="/css/pure-min.css">
|
|
<link rel="stylesheet" href="/css/side-menu.css">
|
|
<link rel="stylesheet" href="/css/grids-responsive-min.css">
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="header">
|
|
<div class="home-menu pure-menu pure-menu-open pure-menu-horizontal pure-menu-fixed">
|
|
<a class="pure-menu-heading" href="http://www.freifunk-franken.de">freifunk-franken.de</a>
|
|
<ul>
|
|
<%
|
|
contact="$(uci get -q system.@system[0].contact)"
|
|
if [ -n "$contact" ]; then
|
|
echo " <li><a href='#'>Kontakt: $contact</a></li>"
|
|
fi
|
|
|
|
description="$(uci get -q system.@system[0].description)"
|
|
mac="$(uci -q get network.mesh.macaddr)"
|
|
if [ -n "$description" ]; then
|
|
echo " <li><a href='https://monitoring.freifunk-franken.de/api/get_router_by_mac/${mac}'>Beschreibung: $description</a></li>"
|
|
fi
|
|
|
|
lat="$(uci get -q system.@system[0].latitude)"
|
|
lon="$(uci get -q system.@system[0].longitude)"
|
|
if [ -n "$lat" -a -n "$lon" ]; then
|
|
echo " <li><a href=\"https://monitoring.freifunk-franken.de/map?mapcenter=$lat,$lon,16\">Position: ${lat:0:8}N, ${lon:0:8}E</a></li>"
|
|
fi
|
|
position_comment="$(uci get -q system.@system[0].position_comment)"
|
|
if [ -n "$position_comment" ]; then
|
|
echo " <li><a href='#'>${position_comment}</a></li>"
|
|
fi
|
|
%>
|
|
<li><form action="https://<% echo -n "$HTTP_HOST" %>"><button type="submit" class="pure-button">Login</button></form></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="header">
|
|
<%
|
|
echo " <h1>$(uci get -q system.@system[0].hostname)</h1>"
|
|
%>
|
|
<h2>Firmware Version <% echo -n $FIRMWARE_VERSION %></h2>
|
|
</div>
|
|
<div class="content">
|
|
<div class="pure-g" style="text-align:center;">
|
|
<div class="pure-u-1 pure-u-md-1-3">
|
|
<div class="blockhead"></div>
|
|
<h2>Nachbarknoten</h2>
|
|
<h3><% echo -n $(cat /sys/kernel/debug/batman_adv/bat0/originators | grep '^[0-9a-f]' | cut -b 37-53 | sort | uniq | wc -l 2> /dev/null) %></h3>
|
|
</div>
|
|
<div class="pure-u-1 pure-u-md-1-3">
|
|
<div class="blockhead"></div>
|
|
<h2>Alle Knoten</h2>
|
|
<h3><% echo -n $((`cat /sys/kernel/debug/batman_adv/bat0/transtable_global | grep '^ [^ ]' | cut -b 39-55 | sort | uniq | wc -l 2> /dev/null`+1)) %></h3>
|
|
</div>
|
|
<div class="pure-u-1 pure-u-md-1-3">
|
|
<div class="blockhead"></div>
|
|
<h2>Lokale Clients</h2>
|
|
<h3><% echo -n $(cat /sys/kernel/debug/batman_adv/bat0/transtable_local 2> /dev/null | grep -c 'W') %></h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|