summaryrefslogtreecommitdiffhomepage
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/public-core/src/controller/public/index.lua2
-rw-r--r--module/public-core/src/controller/public/status.lua22
-rw-r--r--module/public-core/src/controller/sudo/status.lua1
-rw-r--r--module/public-core/src/model/menu/00public.lua5
-rw-r--r--module/public-core/src/view/public_index/contact.htm16
-rw-r--r--module/public-core/src/view/public_index/index.htm2
-rw-r--r--module/public-core/src/view/public_status/index.htm74
-rw-r--r--module/public-core/src/view/public_status/internet.htm32
-rw-r--r--module/public-core/src/view/public_status/iwscan.htm21
-rw-r--r--module/public-core/src/view/public_status/routes.htm24
-rw-r--r--module/public-core/src/view/sudo_status/iwscan.htm22
11 files changed, 211 insertions, 10 deletions
diff --git a/module/public-core/src/controller/public/index.lua b/module/public-core/src/controller/public/index.lua
index 4f8160a4c9..f65478c05f 100644
--- a/module/public-core/src/controller/public/index.lua
+++ b/module/public-core/src/controller/public/index.lua
@@ -1 +1 @@
-module(..., package.seeall) \ No newline at end of file
+module("ffluci.controller.public.index", package.seeall) \ No newline at end of file
diff --git a/module/public-core/src/controller/public/status.lua b/module/public-core/src/controller/public/status.lua
new file mode 100644
index 0000000000..a786eb2d7e
--- /dev/null
+++ b/module/public-core/src/controller/public/status.lua
@@ -0,0 +1,22 @@
+module("ffluci.controller.public.status", package.seeall)
+
+function action_index()
+ local data = {}
+
+ data.s, data.m, data.r = ffluci.sys.sysinfo()
+
+ data.wifi = ffluci.sys.wifi.getiwconfig()
+
+ data.routes = {}
+ for i, r in pairs(ffluci.sys.net.routes()) do
+ if r.Destination == "00000000" then
+ r.Gateway = ffluci.sys.net.hexip4(r.Gateway)
+ table.insert(data.routes, r)
+ end
+ end
+
+
+ ffluci.template.render("public_status/index", data)
+end
+
+
diff --git a/module/public-core/src/controller/sudo/status.lua b/module/public-core/src/controller/sudo/status.lua
new file mode 100644
index 0000000000..fd5127d2cf
--- /dev/null
+++ b/module/public-core/src/controller/sudo/status.lua
@@ -0,0 +1 @@
+module("ffluci.controller.sudo.status", package.seeall) \ No newline at end of file
diff --git a/module/public-core/src/model/menu/00public.lua b/module/public-core/src/model/menu/00public.lua
index c488f43997..2e96a5b3c8 100644
--- a/module/public-core/src/model/menu/00public.lua
+++ b/module/public-core/src/model/menu/00public.lua
@@ -1,2 +1,7 @@
add("public", "index", "Übersicht", 10)
act("contact", "Kontakt")
+
+add("public", "status", "Status", 20)
+act("routes", "Routingtabelle")
+act("internet", "Internetzugang")
+act("iwscan", "WLAN-Scan") \ No newline at end of file
diff --git a/module/public-core/src/view/public_index/contact.htm b/module/public-core/src/view/public_index/contact.htm
index e5aee19065..d19df7e4c0 100644
--- a/module/public-core/src/view/public_index/contact.htm
+++ b/module/public-core/src/view/public_index/contact.htm
@@ -1,13 +1,13 @@
<%+header%>
<% local contact = ffluci.model.uci.show("freifunk", "contact").freifunk.contact %>
<h1><%:contact Kontakt%></h1>
-<table class="contact">
- <tr><th style="text-align: right"><%:nickname Pseudonym%>:</th><td><%=contact.nickname%></td></tr>
- <tr><th style="text-align: right"><%:name Name%>:</th><td><%=contact.name%></td></tr>
- <tr><th style="text-align: right"><%:mail E-Mail%>:</th><td><%=contact.mail%></td></tr>
- <tr><th style="text-align: right"><%:phone Telefon%>:</th><td><%=contact.phone%></td></tr>
- <tr><th style="text-align: right"><%:location Standort%>:</th><td><%=contact.location%></td></tr>
- <tr><th style="text-align: right"><%:geocoord Geokoordinaten%>:</th><td><%=contact.geo%></td></tr>
- <tr><th style="text-align: right"><%:note Notiz%>:</th><td><%=contact.note%></td></tr>
+<table cellspacing="0" cellpadding="6">
+ <tr><th><%:nickname Pseudonym%>:</th><td><%=contact.nickname%></td></tr>
+ <tr><th><%:name Name%>:</th><td><%=contact.name%></td></tr>
+ <tr><th><%:mail E-Mail%>:</th><td><%=contact.mail%></td></tr>
+ <tr><th><%:phone Telefon%>:</th><td><%=contact.phone%></td></tr>
+ <tr><th><%:location Standort%>:</th><td><%=contact.location%></td></tr>
+ <tr><th><%:geocoord Geokoordinaten%>:</th><td><%=contact.geo%></td></tr>
+ <tr><th><%:note Notiz%>:</th><td><%=contact.note%></td></tr>
</table>
<%+footer%> \ No newline at end of file
diff --git a/module/public-core/src/view/public_index/index.htm b/module/public-core/src/view/public_index/index.htm
index 838bf02ee0..a8a469ec31 100644
--- a/module/public-core/src/view/public_index/index.htm
+++ b/module/public-core/src/view/public_index/index.htm
@@ -6,6 +6,6 @@
<a href="<%=controller%>/public/index/contact"><%=ff.contact.nickname%></a>.</p>
<p><%:public4 Weitere Informationen zur globalen Freifunkinitiative findest du unter%> <a href="http://freifunk.net">Freifunk.net</a>.<br />
<%:public5 Hast du Interesse an diesem Projekt, dann wende dich an deine lokale Gemeinschaft%> <a href="<%=ff.community.homepage%>"><%=ff.community.name%></a>.</p>
-<p><strong><%:note Hinweis%></strong>:<%:public6 Der Internetzugang über das experimentelle Freifunknetz ist an technische und organisatorische Bedingungen geknüpft und deshalb möglicherweise
+<p><strong><%:note Hinweis%></strong>: <%:public6 Der Internetzugang über das experimentelle Freifunknetz ist an technische und organisatorische Bedingungen geknüpft und deshalb möglicherweise
nicht (immer) gewährleistet.%></p>
<%+footer%> \ No newline at end of file
diff --git a/module/public-core/src/view/public_status/index.htm b/module/public-core/src/view/public_status/index.htm
new file mode 100644
index 0000000000..d81125de25
--- /dev/null
+++ b/module/public-core/src/view/public_status/index.htm
@@ -0,0 +1,74 @@
+<%+header%>
+<h1><%:status Status%></h1>
+<h2><%:system System%></h2>
+
+<br />
+<table cellspacing="0" cellpadding="6" class="smalltext">
+<tr>
+<th><%:system_type Systemtyp%>:</th>
+<td><%=s%></td>
+</tr>
+<tr>
+<th><%:cpu Prozessor%>:</th>
+<td><%=m%></td>
+</tr>
+<tr>
+<th><%:ram Hauptspeicher%>:</th>
+<td><%=r%></td>
+</tr>
+</table>
+<br /><br />
+
+<h2><%:wifi Drahtlos%></h2>
+<br />
+<table cellspacing="0" cellpadding="6" class="smalltext">
+<tr>
+<th><%:name Name%></th>
+<th><%:protocol Protokoll%></th>
+<th><%:frequency Frequenz%></th>
+<th><%:power Leistung%></th>
+<th><%:bitrate Bitrate%></th>
+<th><%:rts RTS%></th>
+<th><%:frag Frag.%></th>
+<th><%:link Verb.%></th>
+<th><%:signal Signal%></th>
+<th><%:noise Rausch%></th>
+</tr>
+<%for k, v in pairs(wifi) do%>
+<tr>
+<td rowspan="2"><%=k%></td>
+<td><%=v[1]%></td>
+<td><%=v.Frequency%></td>
+<td><%=v["Tx-Power"]%></td>
+<td><%=v["Bit Rate"]%></td>
+<td><%=v["RTS thr"]%></td>
+<td><%=v["Fragment thr"]%></td>
+<td><%=v["Link Quality"]%></td>
+<td><%=v["Signal level"]%></td>
+<td><%=v["Noise level"]%></td>
+</tr>
+<tr>
+<td colspan="4"><strong><%:essid ESSID%>: </strong><%=v.ESSID%></td>
+<td colspan="5"><strong><%:bssid BSSID%>: </strong><%=(v.Cell or v["Access Point"])%></td>
+</tr>
+<%end%>
+</table>
+<br />
+<br />
+<h2><%:defroutes Standardrouten%></h2>
+<br />
+<table cellspacing="0" cellpadding="6" class="smalltext">
+<tr>
+<th><%:gateway Gateway%></th>
+<th><%:metric Metrik%></th>
+<th><%:iface Schnittstelle%></th>
+</tr>
+<% for i, rt in pairs(routes) do%>
+<tr>
+<td><%=rt.Gateway%></th>
+<td><%=rt.Metric%></th>
+<td><%=rt.Iface%></th>
+</tr>
+<% end %>
+</table>
+<%+footer%> \ No newline at end of file
diff --git a/module/public-core/src/view/public_status/internet.htm b/module/public-core/src/view/public_status/internet.htm
new file mode 100644
index 0000000000..afa8fbf235
--- /dev/null
+++ b/module/public-core/src/view/public_status/internet.htm
@@ -0,0 +1,32 @@
+<%+header%>
+<h1><%:inetaccess Internetzugangstest%></h1>
+<br />
+
+<table cellspacing="0" cellpadding="6" class="smalltext">
+<tr>
+<th><%:target Ziel%></th>
+<th><%:host Host%></th>
+<th><%:result Ergebnis%></th>
+</tr>
+<%
+local tests = {}
+tests[1] = {descr = "Chaos Computer Club Deutschland", target = "213.73.91.29"}
+tests[2] = {descr = "Kernel.org - Mirror Niederlande", target = "199.6.1.164"}
+tests[3] = {descr = "Debian.org - Mirror Deutschland", target = "www.de.debian.org"}
+tests[4] = {descr = "Wikimedia Deutschland", target = "www.wikimedia.de"}
+
+for i, t in ipairs(tests) do
+%>
+<tr>
+<td><%=t.descr%></td>
+<td><%=t.target%></td>
+<% if ffluci.sys.net.pingtest(t.target) == 0 then %>
+<td class="ok"><%:ok OK%></td>
+<% else %>
+<td class="error"><%:failed fehlgeschlagen%></td>
+<% end %>
+</tr>
+<% end %>
+</table>
+<br />
+<%+footer%> \ No newline at end of file
diff --git a/module/public-core/src/view/public_status/iwscan.htm b/module/public-core/src/view/public_status/iwscan.htm
new file mode 100644
index 0000000000..a8924c8925
--- /dev/null
+++ b/module/public-core/src/view/public_status/iwscan.htm
@@ -0,0 +1,21 @@
+<%+header%>
+<h1><%:iwscan WLAN-Scan%></h1>
+<p><%:iwscan1 Drahtlosnetzwerke in der lokalen Umgebung des Routers:%></p>
+
+<br />
+<table cellspacing="0" cellpadding="6" class="smalltext">
+<tr>
+<th><%:interface Schnittstelle%></th>
+<th><%:essid ESSID%></th>
+<th><%:bssid BSSID%></th>
+<th><%:mode Modus%></th>
+<th><%:channel Kanal%></th>
+<th><%:encr Vers.%></th>
+<th><%:link Verb.%></th>
+<th><%:signal Signal%></th>
+<th><%:noise Rausch%></th>
+</tr>
+<%=ffluci.sys.httpget("http://127.0.0.1" .. controller .. "/sudo/status/iwscan")%>
+</table>
+<br />
+<%+footer%> \ No newline at end of file
diff --git a/module/public-core/src/view/public_status/routes.htm b/module/public-core/src/view/public_status/routes.htm
new file mode 100644
index 0000000000..046c789f91
--- /dev/null
+++ b/module/public-core/src/view/public_status/routes.htm
@@ -0,0 +1,24 @@
+<%+header%>
+<h1><%:routes Routen%></h1>
+
+<br />
+<table cellspacing="0" cellpadding="6" class="smalltext">
+<tr>
+<th><%:target Ziel%></th>
+<th><%:netmask Netzmaske%></th>
+<th><%:gateway Gateway%></th>
+<th><%:metric Metrik%></th>
+<th><%:iface Schnittstelle%></th>
+</tr>
+<% for i, r in pairs(ffluci.sys.net.routes()) do %>
+<tr>
+<td><%=ffluci.sys.net.hexip4(r.Destination)%></td>
+<td><%=ffluci.sys.net.hexip4(r.Mask)%></td>
+<td><%=ffluci.sys.net.hexip4(r.Gateway)%></td>
+<td><%=r.Metric%></td>
+<td><%=r.Iface%></td>
+</tr>
+<% end %>
+</table>
+<br />
+<%+footer%> \ No newline at end of file
diff --git a/module/public-core/src/view/sudo_status/iwscan.htm b/module/public-core/src/view/sudo_status/iwscan.htm
new file mode 100644
index 0000000000..483039f4ee
--- /dev/null
+++ b/module/public-core/src/view/sudo_status/iwscan.htm
@@ -0,0 +1,22 @@
+<%
+ffluci.http.textheader()
+for iface, cells in pairs(ffluci.sys.wifi.iwscan()) do
+ for i, cell in ipairs(cells) do
+%>
+<tr>
+<td><%=iface%></td>
+<td><%=cell.ESSID%></td>
+<td><%=cell.Address%></td>
+<td><%=cell.Mode%></td>
+<td><%=cell.Channel%></td>
+<td><%=cell["Encryption key"]%></td>
+<td><%=cell.Quality%></td>
+<td><%=cell["Signal level"]%></td>
+<td><%=cell["Noise level"]%></td>
+</tr>
+<%
+ end
+end
+%>
+
+