forked from freifunk-franken/firmware
fff-web: store geo location in two variables
Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de> Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
This commit is contained in:
parent
04a89f1e9d
commit
ba619c8bc8
|
@ -1,7 +1,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=fff-web
|
PKG_NAME:=fff-web
|
||||||
PKG_VERSION:=0.0.1
|
PKG_VERSION:=0.0.2
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-web
|
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-web
|
||||||
|
|
|
@ -18,15 +18,15 @@
|
||||||
<a class="pure-menu-heading" href="http://www.freifunk-franken.de">freifunk-franken.de</a>
|
<a class="pure-menu-heading" href="http://www.freifunk-franken.de">freifunk-franken.de</a>
|
||||||
<ul>
|
<ul>
|
||||||
<%
|
<%
|
||||||
contact="$(uci get -q freifunk.@settings[0].contact)"
|
contact="$(uci get -q system.@system[0].contact)"
|
||||||
if [ -n "$contact" ]; then
|
if [ -n "$contact" ]; then
|
||||||
echo " <li><a href='#'>Kontakt: $contact</a></li>"
|
echo " <li><a href='#'>Kontakt: $contact</a></li>"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
geo="$(uci get -q freifunk.@settings[0].geo)"
|
lat="$(uci get -q system.@system[0].latitude)"
|
||||||
if [ -n "$geo" ]; then
|
lon="$(uci get -q system.@system[0].longitude)"
|
||||||
lat="${geo%% *}" lon="${geo##* }"
|
if [ -n "$lat" -a -n "$lon" ]; then
|
||||||
echo " <li><a href=\"https://www.openstreetmap.org?mlat=$lat&mlon=$lon&zoom=17\">Position: ${lat:0:8}N, ${lon:0:8}E</a></li>"
|
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
|
fi
|
||||||
%>
|
%>
|
||||||
<li><form action="https://<% echo -n "$HTTP_HOST" %>"><button type="submit" class="pure-button">Login</button></form></li>
|
<li><form action="https://<% echo -n "$HTTP_HOST" %>"><button type="submit" class="pure-button">Login</button></form></li>
|
||||||
|
@ -35,7 +35,7 @@ fi
|
||||||
</div>
|
</div>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<%
|
<%
|
||||||
echo " <h1>$(uci get -q freifunk.@settings[0].name)</h1>"
|
echo " <h1>$(uci get -q system.@system[0].hostname)</h1>"
|
||||||
%>
|
%>
|
||||||
<h2>Firmware Version <% echo -n $FIRMWARE_VERSION %></h2>
|
<h2>Firmware Version <% echo -n $FIRMWARE_VERSION %></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -52,11 +52,17 @@ function appendSetting(p, path, value, mode)
|
||||||
var name = path[path.length-1];
|
var name = path[path.length-1];
|
||||||
switch(name)
|
switch(name)
|
||||||
{
|
{
|
||||||
case "geo":
|
case "latitude":
|
||||||
b = append_input(p, "GPS-Koordinaten", id, value);
|
b = append_input(p, "GPS-Koordinaten Latitude", id, value);
|
||||||
b.lastChild.placeholder = "52.02713078 8.52829987";
|
b.lastChild.placeholder = "52.02713078";
|
||||||
addInputCheck(b.lastChild, /^$|^\d{1,3}\.\d{1,8} {1,3}\d{1,3}\.\d{1,8}$/, "Ung\xfcltige Eingabe. Bitte nur maximal 8 Nachkommastellen und keine Kommas verwenden.");
|
addInputCheck(b.lastChild, /^$|^\d{1,3}\.\d{1,8}$/, "Ung\xfcltige Eingabe. Bitte nur maximal 8 Nachkommastellen und keine Kommas verwenden.");
|
||||||
addHelpText(b, "Die Koordinaten dieses Knotens auf der Freifunk-Karte (z.B. \"52.02713078 8.52829987\").");
|
addHelpText(b, "Die Latitude Koordinate dieses Knotens auf der Freifunk-Karte (z.B. \"52.02713078\").");
|
||||||
|
break;
|
||||||
|
case "longitude":
|
||||||
|
b = append_input(p, "GPS-Koordinaten Longitude", id, value);
|
||||||
|
b.lastChild.placeholder = "8.52829987";
|
||||||
|
addInputCheck(b.lastChild, /^$|^\d{1,3}\.\d{1,8}$/, "Ung\xfcltige Eingabe. Bitte nur maximal 8 Nachkommastellen und keine Kommas verwenden.");
|
||||||
|
addHelpText(b, "Die Longitude Koordinate dieses Knotens auf der Freifunk-Karte (z.B. \"8.52829987\").");
|
||||||
break;
|
break;
|
||||||
case "hostname":
|
case "hostname":
|
||||||
b = append_input(p, "Knotenname", id, value);
|
b = append_input(p, "Knotenname", id, value);
|
||||||
|
@ -110,7 +116,8 @@ function rebuild_general()
|
||||||
var f = uci['system'];
|
var f = uci['system'];
|
||||||
var i = firstSectionID(f, "system");
|
var i = firstSectionID(f, "system");
|
||||||
appendSetting(gfs, ['system', i, "hostname"], f[i]["hostname"]);
|
appendSetting(gfs, ['system', i, "hostname"], f[i]["hostname"]);
|
||||||
appendSetting(gfs, ['system', i, "geo"], f[i]["geo"]);
|
appendSetting(gfs, ['system', i, "latitude"], f[i]["latitude"]);
|
||||||
|
appendSetting(gfs, ['system', i, "longitude"], f[i]["longitude"]);
|
||||||
appendSetting(gfs, ['system', i, "contact"], f[i]["contact"]);
|
appendSetting(gfs, ['system', i, "contact"], f[i]["contact"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue