2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
14 module("luci.controller.freifunk.freifunk", package.seeall)
17 local i18n = luci.i18n.translate
20 page.target = alias("freifunk")
22 local page = node("freifunk")
23 page.title = "Freifunk"
24 page.target = alias("freifunk", "index")
26 page.setuser = "nobody"
27 page.setgroup = "nogroup"
28 page.i18n = "freifunk"
30 local page = node("freifunk", "index")
31 page.target = template("freifunk/index")
32 page.title = "Übersicht"
35 local page = node("freifunk", "index", "contact")
36 page.target = template("freifunk/contact")
37 page.title = "Kontakt"
40 local page = node("freifunk", "status")
41 page.target = call("action_status")
47 assign({"freifunk", "status", "routes"}, {"admin", "status", "routes"}, "Routingtabelle", 10)
48 assign({"freifunk", "status", "iwscan"}, {"admin", "status", "iwscan"}, "WLAN-Scan", 20)
50 assign({"freifunk", "olsr"}, {"admin", "status", "olsr"}, "OLSR", 30)
52 if luci.fs.isfile("/etc/config/luci_statistics") then
53 assign({"freifunk", "statistics"}, {"admin", "statistics", "graph"}, i18n("stat_statistics", "Statistiken"), 40)
56 local page = node("admin", "index", "freifunk")
57 page.target = cbi("freifunk/freifunk")
58 page.title = "Freifunk"
61 local page = node("admin", "index", "contact")
62 page.target = cbi("freifunk/contact")
63 page.title = "Kontakt"
67 function action_status()
70 data.s, data.m, data.r = luci.sys.sysinfo()
72 data.wifi = luci.sys.wifi.getiwconfig()
75 for i, r in pairs(luci.sys.net.routes()) do
76 if r.Destination == "00000000" then
77 table.insert(data.routes, r)
82 luci.template.render("public_status/index", data)