summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-freifunk/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-freifunk/luasrc')
-rw-r--r--modules/luci-mod-freifunk/luasrc/controller/freifunk/freifunk.lua218
-rw-r--r--modules/luci-mod-freifunk/luasrc/controller/freifunk/remote_update.lua52
-rw-r--r--modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua92
-rw-r--r--modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/contact.lua16
-rw-r--r--modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile.lua74
-rw-r--r--modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile_expert.lua32
-rw-r--r--modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/user_index.lua30
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/cbi/osmll_value.htm55
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm29
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm118
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm44
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm57
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm76
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk/profile_error.htm11
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm363
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk/remote_update.htm53
16 files changed, 0 insertions, 1320 deletions
diff --git a/modules/luci-mod-freifunk/luasrc/controller/freifunk/freifunk.lua b/modules/luci-mod-freifunk/luasrc/controller/freifunk/freifunk.lua
deleted file mode 100644
index adad7508b..000000000
--- a/modules/luci-mod-freifunk/luasrc/controller/freifunk/freifunk.lua
+++ /dev/null
@@ -1,218 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.freifunk.freifunk", package.seeall)
-
-function index()
- local uci = require "luci.model.uci".cursor()
- local page
-
- -- Frontend
- page = node()
- page.lock = true
- page.target = alias("freifunk")
- page.subindex = true
- page.index = false
-
- page = node("freifunk")
- page.title = _("Freifunk")
- page.target = alias("freifunk", "index")
- page.order = 5
- page.setuser = "nobody"
- page.setgroup = "nogroup"
- page.i18n = "freifunk"
- page.index = true
-
- page = node("freifunk", "index")
- page.target = template("freifunk/index")
- page.title = _("Overview")
- page.order = 10
- page.indexignore = true
-
- page = node("freifunk", "contact")
- page.target = template("freifunk/contact")
- page.title = _("Contact")
- page.order = 15
-
- page = node("freifunk", "status")
- page.target = template("freifunk/public_status")
- page.title = _("Status")
- page.order = 20
- page.i18n = "base"
- page.setuser = false
- page.setgroup = false
-
- entry({"freifunk", "status.json"}, call("jsonstatus"))
- entry({"freifunk", "status", "zeroes"}, call("zeroes"), "Testdownload")
-
- if nixio.fs.access("/usr/sbin/luci-splash") then
- assign({"freifunk", "status", "splash"}, {"splash", "publicstatus"}, _("Splash"), 40)
- end
-
- page = assign({"freifunk", "olsr"}, {"admin", "status", "olsr"}, _("OLSR"), 30)
- page.setuser = false
- page.setgroup = false
-
- if nixio.fs.access("/etc/config/luci_statistics") then
- assign({"freifunk", "graph"}, {"admin", "statistics", "graph"}, _("Statistics"), 40)
- end
-
- -- backend
- assign({"mini", "freifunk"}, {"admin", "freifunk"}, _("Freifunk"), 5)
- entry({"admin", "freifunk"}, alias("admin", "freifunk", "index"), _("Freifunk"), 5)
-
- page = node("admin", "freifunk")
- page.target = template("freifunk/adminindex")
- page.title = _("Freifunk")
- page.order = 5
-
- page = node("admin", "freifunk", "basics")
- page.target = cbi("freifunk/basics")
- page.title = _("Basic Settings")
- page.order = 5
-
- page = node("admin", "freifunk", "basics", "profile")
- page.target = cbi("freifunk/profile")
- page.title = _("Profile")
- page.order = 10
-
- page = node("admin", "freifunk", "basics", "profile_expert")
- page.target = form("freifunk/profile_expert")
- page.title = _("Profile (Expert)")
- page.order = 20
-
- page = node("admin", "freifunk", "Index-Page")
- page.target = cbi("freifunk/user_index")
- page.title = _("Index Page")
- page.order = 50
-
- page = node("admin", "freifunk", "contact")
- page.target = cbi("freifunk/contact")
- page.title = _("Contact")
- page.order = 15
-
- entry({"freifunk", "map"}, template("freifunk-map/frame"), _("Map"), 50)
- entry({"freifunk", "map", "content"}, template("freifunk-map/map"), nil, 51)
- entry({"admin", "freifunk", "profile_error"}, template("freifunk/profile_error"))
-end
-
-function zeroes()
- local string = require "string"
- local http = require "luci.http"
- local zeroes = string.rep(string.char(0), 8192)
- local cnt = 0
- local lim = 1024 * 1024 * 1024
-
- http.prepare_content("application/x-many-zeroes")
-
- while cnt < lim do
- http.write(zeroes)
- cnt = cnt + #zeroes
- end
-end
-
-function jsonstatus()
- local root = {}
- local sys = require "luci.sys"
- local uci = require "luci.model.uci"
- local util = require "luci.util"
- local http = require "luci.http"
- local json = require "luci.json"
- local ltn12 = require "luci.ltn12"
- local version = require "luci.version"
- local webadmin = require "luci.tools.webadmin"
-
- local cursor = uci.cursor_state()
-
- local ffzone = webadmin.firewall_find_zone("freifunk")
- local ffznet = ffzone and cursor:get("firewall", ffzone, "network")
- local ffwifs = ffznet and util.split(ffznet, " ") or {}
-
- local sysinfo = util.ubus("system", "info") or { }
- local boardinfo = util.ubus("system", "board") or { }
-
- local loads = sysinfo.load or { 0, 0, 0 }
-
- local memory = sysinfo.memory or {
- total = 0,
- free = 0,
- shared = 0,
- buffered = 0
- }
-
- local swap = sysinfo.swap or {
- total = 0,
- free = 0
- }
-
-
- root.protocol = 1
-
- root.system = {
- uptime = { sysinfo.uptime or 0 },
- loadavg = { loads[1] / 65535.0, loads[2] / 65535.0, loads[3] / 65535.0 },
- sysinfo = {
- boardinfo.system or "?",
- boardinfo.model or "?",
- memory.total,
- 0, -- former cached memory
- memory.buffered,
- memory.free,
- 0, -- former bogomips
- swap.total,
- 0, -- former cached swap
- swap.free
- },
- hostname = boardinfo.hostname
- }
-
- root.firmware = {
- luciname=version.luciname,
- luciversion=version.luciversion,
- distname=version.distname,
- distversion=version.distversion
- }
-
- root.freifunk = {}
- cursor:foreach("freifunk", "public", function(s)
- root.freifunk[s[".name"]] = s
- end)
-
- cursor:foreach("system", "system", function(s)
- root.geo = {
- latitude = s.latitude,
- longitude = s.longitude
- }
- end)
-
- root.network = {}
- root.wireless = {devices = {}, interfaces = {}, status = {}}
- local wifs = root.wireless.interfaces
-
- for _, vif in ipairs(ffwifs) do
- root.network[vif] = cursor:get_all("network", vif)
- root.wireless.devices[vif] = cursor:get_all("wireless", vif)
- cursor:foreach("wireless", "wifi-iface", function(s)
- if s.device == vif and s.network == vif then
- wifs[#wifs+1] = s
- if s.ifname then
- local iwinfo = luci.sys.wifi.getiwinfo(s.ifname)
- if iwinfo then
- root.wireless.status[s.ifname] = { }
-
- local _, f
- for _, f in ipairs({
- "channel", "txpower", "bitrate", "signal", "noise",
- "quality", "quality_max", "mode", "ssid", "bssid", "encryption", "ifname"
- }) do
- root.wireless.status[s.ifname][f] = iwinfo[f]
- end
- end
- end
- end
- end)
- end
-
- http.prepare_content("application/json")
- ltn12.pump.all(json.Encoder(root):source(), http.write)
-end
diff --git a/modules/luci-mod-freifunk/luasrc/controller/freifunk/remote_update.lua b/modules/luci-mod-freifunk/luasrc/controller/freifunk/remote_update.lua
deleted file mode 100644
index b317ab6b5..000000000
--- a/modules/luci-mod-freifunk/luasrc/controller/freifunk/remote_update.lua
+++ /dev/null
@@ -1,52 +0,0 @@
--- Copyright 2009 Jo-Philipp Wich <jow@openwrt.org>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.freifunk.remote_update", package.seeall)
-
-function index()
- if not nixio.fs.access("/usr/sbin/remote-update") then
- return
- end
-
- entry({"admin", "system", "remote_update"}, call("act_remote_update"),
- _("Freifunk Remote Update"), 90)
-end
-
-function act_remote_update()
- if luci.http.formvalue("flash") == "1" then
- if luci.http.formvalue("confirm") == "1" then
- local nobackup = ( luci.http.formvalue("keepcfg") ~= "1" )
- local noverify = ( luci.http.formvalue("verify") ~= "1" )
-
- luci.http.redirect("/luci-static/flashing.html")
-
- os.execute("start-stop-daemon -S -b -x /usr/sbin/remote-update -- %s%s-s 5 -y" % {
- noverify and "-v " or "",
- nobackup and "-n " or ""
- })
- else
- luci.template.render("freifunk/remote_update", {confirm=1})
- end
- else
- local fd = io.popen("remote-update -c")
- local update = { }
-
- if fd then
- while true do
- local ln=fd:read("*l")
-
- if not ln then break
- elseif ln:find("Local: ") then update.locvar = ln:match("Local: (%d+)")
- elseif ln:find("Remote: ") then update.remver = ln:match("Remote: (%d+)")
- elseif ln == "--" then update.info = ""
- elseif update.info ~= nil then
- update.info = update.info .. ln .. "\n"
- end
- end
-
- fd:close()
- end
-
- luci.template.render("freifunk/remote_update", {update=update})
- end
-end
diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua
deleted file mode 100644
index eb0b49b11..000000000
--- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua
+++ /dev/null
@@ -1,92 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2011 Manuel Munz <freifunk at somakoma de>
--- Licensed to the public under the Apache License 2.0.
-
-local fs = require "nixio.fs"
-local util = require "luci.util"
-local uci = require "luci.model.uci".cursor()
-local profiles = "/etc/config/profile_*"
-
-m = Map("freifunk", translate ("Community"))
-c = m:section(NamedSection, "community", "public", nil, translate("These are the basic settings for your local wireless community. These settings define the default values for the wizard and DO NOT affect the actual configuration of the router."))
-
-community = c:option(ListValue, "name", translate ("Community"))
-community.rmempty = false
-
-local profile
-for profile in fs.glob(profiles) do
- local name = uci:get_first(string.gsub(profile, "/etc/config/", ""), "community", "name") or "?"
- community:value(string.gsub(profile, "/etc/config/profile_", ""), name)
-end
-
-
-n = Map("system", translate("Basic system settings"))
-function n.on_after_commit(self)
- luci.http.redirect(luci.dispatcher.build_url("admin", "freifunk", "basics"))
-end
-
-b = n:section(TypedSection, "system")
-b.anonymous = true
-
-hn = b:option(Value, "hostname", translate("Hostname"))
-hn.rmempty = false
-hn.datatype = "hostname"
-
-loc = b:option(Value, "location", translate("Location"))
-loc.rmempty = false
-loc.datatype = "minlength(1)"
-
-lat = b:option(Value, "latitude", translate("Latitude"), translate("e.g.") .. " 48.12345")
-lat.datatype = "float"
-lat.rmempty = false
-
-lon = b:option(Value, "longitude", translate("Longitude"), translate("e.g.") .. " 10.12345")
-lon.datatype = "float"
-lon.rmempty = false
-
---[[
-Opens an OpenStreetMap iframe or popup
-Makes use of resources/OSMLatLon.htm and htdocs/resources/osm.js
-]]--
-
-local class = util.class
-local ff = uci:get("freifunk", "community", "name") or ""
-local co = "profile_" .. ff
-
-local deflat = uci:get_first("system", "system", "latitude") or uci:get_first(co, "community", "latitude") or 52
-local deflon = uci:get_first("system", "system", "longitude") or uci:get_first(co, "community", "longitude") or 10
-local zoom = 12
-if ( deflat == 52 and deflon == 10 ) then
- zoom = 4
-end
-
-OpenStreetMapLonLat = luci.util.class(AbstractValue)
-
-function OpenStreetMapLonLat.__init__(self, ...)
- AbstractValue.__init__(self, ...)
- self.template = "cbi/osmll_value"
- self.latfield = nil
- self.lonfield = nil
- self.centerlat = ""
- self.centerlon = ""
- self.zoom = "0"
- self.width = "100%" --popups will ignore the %-symbol, "100%" is interpreted as "100"
- self.height = "600"
- self.popup = false
- self.displaytext="OpenStreetMap" --text on button, that loads and displays the OSMap
- self.hidetext="X" -- text on button, that hides OSMap
-end
-
- osm = b:option(OpenStreetMapLonLat, "latlon", translate("Find your coordinates with OpenStreetMap"), translate("Select your location with a mouse click on the map. The map will only show up if you are connected to the Internet."))
- osm.latfield = "latitude"
- osm.lonfield = "longitude"
- osm.centerlat = uci:get_first("system", "system", "latitude") or deflat
- osm.centerlon = uci:get_first("system", "system", "longitude") or deflon
- osm.zoom = zoom
- osm.width = "100%"
- osm.height = "600"
- osm.popup = false
- osm.displaytext=translate("Show OpenStreetMap")
- osm.hidetext=translate("Hide OpenStreetMap")
-
-return m, n
diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/contact.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/contact.lua
deleted file mode 100644
index 0a6995b26..000000000
--- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/contact.lua
+++ /dev/null
@@ -1,16 +0,0 @@
--- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
--- Licensed to the public under the Apache License 2.0.
-
-m = Map("freifunk", translate("Contact"), translate("Please fill in your contact details below."))
-
-c = m:section(NamedSection, "contact", "public", "")
-
-c:option(Value, "nickname", translate("Nickname"))
-c:option(Value, "name", translate("Realname"))
-c:option(DynamicList, "homepage", translate("Homepage"))
-c:option(Value, "mail", translate("E-Mail"))
-c:option(Value, "phone", translate("Phone"))
-c:option(TextValue, "note", translate("Notice")).rows = 10
-
-return m
diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile.lua
deleted file mode 100644
index de7caf4c1..000000000
--- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile.lua
+++ /dev/null
@@ -1,74 +0,0 @@
--- Copyright 2011-2012 Manuel Munz <freifunk at somakoma dot de>
--- Licensed to the public under the Apache License 2.0.
-
-local uci = require "luci.model.uci".cursor()
-local ipkg = require "luci.model.ipkg"
-local community = uci:get("freifunk", "community", "name")
-
-if community == nil then
- luci.http.redirect(luci.dispatcher.build_url("admin", "freifunk", "profile_error"))
- return
-else
- community = "profile_" .. community
- m = Map(community, translate("Community settings"), translate("These are the settings of your local community."))
- c = m:section(NamedSection, "profile", "community")
-
- local name = c:option(Value, "name", "Name")
- name.rmempty = false
-
- local homepage = c:option(Value, "homepage", translate("Homepage"))
-
- local cc = c:option(Value, "country", translate("Country code"))
- function cc.cfgvalue(self, section)
- return uci:get(community, "wifi_device", "country")
- end
- function cc.write(self, sec, value)
- if value then
- uci:set(community, "wifi_device", "country", value)
- uci:save(community)
- end
- end
-
- local ssid = c:option(Value, "ssid", translate("ESSID"))
- ssid.rmempty = false
-
- local prefix = c:option(Value, "mesh_network", translate("Mesh prefix"))
- prefix.datatype = "ip4addr"
- prefix.rmempty = false
-
- local splash_net = c:option(Value, "splash_network", translate("Network for client DHCP addresses"))
- splash_net.datatype = "ip4addr"
- splash_net.rmempty = false
-
- local splash_prefix = c:option(Value, "splash_prefix", translate("Client network size"))
- splash_prefix.datatype = "range(0,32)"
- splash_prefix.rmempty = false
-
- local ipv6 = c:option(Flag, "ipv6", translate("Enable IPv6"))
- ipv6.rmempty = true
-
- local ipv6_config = c:option(ListValue, "ipv6_config", translate("IPv6 Config"))
- ipv6_config:depends("ipv6", 1)
- ipv6_config:value("static")
- if ipkg.installed ("auto-ipv6-ib") then
- ipv6_config:value("auto-ipv6-random")
- ipv6_config:value("auto-ipv6-fromv4")
- end
- ipv6_config.rmempty = true
-
- local ipv6_prefix = c:option(Value, "ipv6_prefix", translate("IPv6 Prefix"), translate("IPv6 network in CIDR notation."))
- ipv6_prefix:depends("ipv6", 1)
- ipv6_prefix.datatype = "ip6addr"
- ipv6_prefix.rmempty = true
-
- local vap = c:option(Flag, "vap", translate("VAP"), translate("Enable a virtual access point (VAP) by default if possible."))
- vap.rmempty = true
-
- local lat = c:option(Value, "latitude", translate("Latitude"))
- lat.datatype = "range(-180, 180)"
- lat.rmempty = false
-
- local lon = c:option(Value, "longitude", translate("Longitude"))
- lon.rmempty = false
- return m
-end
diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile_expert.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile_expert.lua
deleted file mode 100644
index 22554a66f..000000000
--- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile_expert.lua
+++ /dev/null
@@ -1,32 +0,0 @@
--- Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
--- Licensed to the public under the Apache License 2.0.
-
-local fs = require "nixio.fs"
-local uci = require "luci.model.uci".cursor()
-local community = uci:get("freifunk", "community", "name")
-
-if community == nil then
- luci.http.redirect(luci.dispatcher.build_url("admin", "freifunk", "profile_error"))
- return
-else
- community = "/etc/config/profile_" .. community
- f = SimpleForm("community", translate("Community profile"), translate("You can manually edit the selected community profile here."))
-
- t = f:field(TextValue, "cop")
- t.rmempty = true
- t.rows = 30
- function t.cfgvalue()
- return fs.readfile(community) or ""
- end
-
- function f.handle(self, state, data)
- if state == FORM_VALID then
- if data.cop then
- fs.writefile(community, data.cop:gsub("\r\n", "\n"))
- end
- end
- return true
- end
- return f
-end
-
diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/user_index.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/user_index.lua
deleted file mode 100644
index fe1d8fe7e..000000000
--- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/user_index.lua
+++ /dev/null
@@ -1,30 +0,0 @@
-local fs = require "nixio.fs"
-local file = "/www/luci-static/index_user.html"
-
-m = Map("freifunk", translate("Edit index page"), translate("You can display additional content on the public index page by inserting valid XHTML in the form below.<br />Headlines should be enclosed between &lt;h2&gt; and &lt;/h2&gt;."))
-
-s = m:section(NamedSection, "community", "public", "")
-s.anonymous = true
-
-di = s:option(Flag, "DefaultText", translate("Disable default content"), translate("If selected then the default content element is not shown."))
-di.enabled = "disabled"
-di.disabled = "enabled"
-di.rmempty = false
-
-t = s:option(TextValue, "_text")
-t.rmempty = true
-t.rows = 20
-
-function t.cfgvalue()
- return fs.readfile(file) or ""
-end
-
-function t.write(self, section, value)
- return fs.writefile(file, value)
-end
-
-function t.remove(self, section)
- return fs.unlink(file)
-end
-
-return m
diff --git a/modules/luci-mod-freifunk/luasrc/view/cbi/osmll_value.htm b/modules/luci-mod-freifunk/luasrc/view/cbi/osmll_value.htm
deleted file mode 100644
index 78b4dff91..000000000
--- a/modules/luci-mod-freifunk/luasrc/view/cbi/osmll_value.htm
+++ /dev/null
@@ -1,55 +0,0 @@
-<%#
-cc-by-sa Andreas Pittrich <andreas.pittrich@web.de>
-in behalf of the german pirate party (Piratenpartei)
-www.piratenpartei.de
-
-$Id$
-
--%>
-<%+cbi/valueheader%>
-
- <% if self:cfgvalue(section) ~= false then %>
- <% if self.latfield and self.lonfield then %>
- <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.latfield))..attr("id", cbid..".latfield")..attr("name", cbid..".latfield")%>/>
- <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.lonfield))..attr("id", cbid..".lonfield")..attr("name", cbid..".lonfield")%>/>
- <% end %>
- <input type="hidden" <%= attr("value", self.centerlat)..attr("id", cbid..".centerlat")..attr("name", cbid..".centerlat")%>/>
- <input type="hidden" <%= attr("value", self.centerlon)..attr("id", cbid..".centerlon")..attr("name", cbid..".centerlon")%>/>
- <input type="hidden" <%= attr("value", self.zoom)..attr("id", cbid..".zoom")..attr("name", cbid..".zoom")%>/>
- <% end %>
-
- <% if self.popup then %>
- <input class="cbi-button cbi-input-button" type="button"<%= attr("name", cbid..".button")..attr("id", cbid..".button")..attr("value", self.displaytext)%>
- onclick="
- popup=window.open('/luci-static/resources/OSMLatLon.htm', '<%=cbid%>.window', 'innerWidth=<%=self.width%>, innerHeight=<%=self.height%>, location=no, menubar=no, scrollbars=no, status=no, toolbar=no');
- popup.focus();
- "
- />
- </div>
- <div>
- <% else %>
- <input class="cbi-button cbi-input-button" type="button"<%= attr("name", cbid..".displayosm")..attr("id", cbid..".displayosm")..attr("value", self.displaytext)%>
- onclick="
- document.getElementById('<%=cbid..".hideosm"%>').style.display='inline';
- document.getElementById('<%=cbid..".displayosm"%>').style.display='none';
- for(var i = 0; Math.min(i, window.frames.length)!=window.frames.lengths; i++){
- if(frames[i].name=='<%=cbid..".iframe"%>'){
- document.getElementById('<%=cbid..".iframediv"%>').style.display='block';
- frames[i].location.href='/luci-static/resources/OSMLatLon.htm';
- }
- }
- "
- />
- <input class="cbi-button cbi-input-button" style="display:none" type="button"<%= attr("name", cbid..".hideosm")..attr("id", cbid..".hideosm")..attr("value", self.hidetext)%>
- onclick="
- document.getElementById('<%=cbid..".displayosm"%>').style.display='inline';
- document.getElementById('<%=cbid..".hideosm"%>').style.display='none';
- document.getElementById('<%=cbid..".iframediv"%>').style.display='none';
- "
- />
- </div>
- <div class="cbi-value-osmiframesection" id="<%=cbid..".iframediv"%>" style="display:none">
- <iframe src="" <%= attr("id", cbid..".iframe")..attr("name", cbid..".iframe")..attr("width", self.width)..attr("height", self.height)%> frameborder="0" scrolling="no"></iframe>
- <%end%>
-
-<%+cbi/valuefooter%>
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm
deleted file mode 100644
index bd936ac70..000000000
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm
+++ /dev/null
@@ -1,29 +0,0 @@
-<%+header%>
-
-<%
- local has_latlon = false
- local uci = require "luci.model.uci".cursor()
- uci:foreach("olsrd", "LoadPlugin", function(s)
- if s.library == "olsrd_nameservice" and s.latlon_file then
- has_latlon = true
- end
- end)
-%>
-
-<% if has_latlon then %>
- <iframe style="width:100%; height:640px; border:none" src="<%=url("freifunk/map/content")%>"></iframe>
- <h3><%:Legend%>:</h3>
- <ul>
- <li><strong><span style="color:#00cc00"><%:Green%></span></strong>:<%:Very good (ETX < 2)%></li>
- <li><strong><span style="color:#ffcb05"><%:Yellow%></span></strong>:<%:Good (2 < ETX < 4)%></li>
- <li><strong><span style="color:#ff6600"><%:Orange%></span></strong>:<%:Still usable (4 < ETX < 10)%></li>
- <li><strong><span style="color:#bb3333"><%:Red%></span></strong>:<%:Bad (ETX > 10)%></li>
- </ul>
-
-<% else %>
- <h2><%:Map Error%></h2>
- <p><%_The OLSRd service is not configured to capture position data from the network.<br />
- Please make sure that the nameservice plugin is properly configured and that the <em>latlon_file</em> option is enabled.%></p>
-<% end %>
-<%+footer%>
-
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm
deleted file mode 100644
index f69401d6e..000000000
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm
+++ /dev/null
@@ -1,118 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
- <head>
- <title>Map</title>
- </head>
-
- <body style="margin:0">
- <script src="//dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1&s=1" type="text/javascript"></script>
- <script type="text/javascript">
- var alias = new Array;
- var points = new Array;
- var unkpos = new Array;
- var lineid = 0;
- onload=new Function("if(null!=window.ffmapinit)ffmapinit();");
-
- function Mid(mainip,aliasip)
- {
- alias[aliasip]=mainip;
- }
-
- function Node(mainip,lat,lon,ishna,hnaip,name)
- {
- points[mainip] = new VELatLong(lat, lon);
- map.AddPushpin(new VEPushpin(mainip, points[mainip],
- '<%=luci.config.main.resourcebase%>/freifunk-map/'+(ishna?'hna':'node')+'.gif', 'Node:'+name,
- '<br><img src="<%=luci.config.main.resourcebase%>/freifunk-map/'+(ishna?'hna':'node')+'.gif">'+
- '<br>IP:'+mainip+'<br>DefGW:'+hnaip));
- }
-
- function Self(mainip,lat,lon,ishna,hnaip,name)
- {
- //map.SetDashboardSize(VEDashboardSize.Small);
- map.LoadMap(new VELatLong(lat, lon), 15, VEMapStyle.Hybrid);
- map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
- map.ShowMiniMap(14, 474);
- Node(mainip,lat,lon,ishna,hnaip,name);
- }
-
- function Link(fromip,toip,lq,nlq,etx)
- {
- if (0==lineid && null!=window.ffmapstatic) ffmapstatic();
- if (null != alias[toip]) toip = alias[toip];
- if (null != alias[fromip]) fromip = alias[fromip];
- if (null != points[fromip] && null != points[toip])
- {
- var color;
- var red = 240;
- var green = 0;
- var blue = 0;
- var w = 1
-
- if (etx < 100) {red=252;green=102;blue=0;w=2};
- if (etx < 10) {red=255;green=203;blue=5;w=3};
- if (etx < 4) {red=240;green=255;blue=0;w=4};
- if (etx < 2) {red=0;green=204;blue=0;w=5};
- if (etx < 1) {red=80;green=0;blue=0;w=1};
-
- map.AddPolyline(new VEPolyline('id'+lineid, [points[fromip], points[toip]],
- new VEColor(red, green, blue, 0.5), w));
-
-
- }
- else
- {
- if (null == points[toip]) unkpos[toip] = '';
- if (null == points[fromip]) unkpos[fromip] = '';
- }
- lineid++;
- }
-
- function PLink(fromip,toip,lq,nlq,etx,lata,lona,ishnaa,latb,lonb,ishnab)
- {
- Link(fromip,toip,lq,nlq,etx);
- }
-
- function ffmapinit()
- {
- if(null!=window.map)map.Dispose();
-
- var INFINITE = 99.99;
-
- map = new VEMap('ffmap');
- <%
- local fd
- local uci = require "luci.model.uci".cursor()
-
- uci:foreach("olsrd", "LoadPlugin", function(s)
- if s.library == "olsrd_nameservice" and s.latlon_file then
- fd = io.open(s.latlon_file)
- end
- end)
-
- if fd then
- local data = fd:read("*a")
- fd:close()
-
- if data then
- local line
- for line in data:gmatch("[^\n]+") do
- if line:match(";$") then
- write(line .. "\n")
- else
- break
- end
- end
- end
- end
- %>
- }
-
- function ffgoto(ip)
- {
- map.SetCenter(points[ip]);
- }
- </script>
- <div id="ffmap" style="position:relative; width:100%; height:640px;"></div>
- </body>
-</html>
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm
deleted file mode 100644
index a3f079716..000000000
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm
+++ /dev/null
@@ -1,44 +0,0 @@
-<%+header%>
-<%
-local uci = require "luci.model.uci".cursor()
-local nickname = uci:get("freifunk", "contact", "nickname") or ""
-local name = uci:get("freifunk", "contact", "name") or ""
-local mail = uci:get("freifunk", "contact", "mail") or ""
-local contacturl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "contact")
-local hostname = uci:get_first ("system", "system", "hostname")
-local latitude = uci:get_first ("system", "system", "latitude")
-local longitude = uci:get_first ("system", "system", "longitude")
-local location = uci:get_first ("system", "system", "location")
-local basicsurl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "basics")
-%>
-
-<h2><%:Freifunk Overview%></h2>
-
-<%:These pages will assist you in setting up your router for Freifunk or similar wireless community networks.%>
-<p />
-
-<% if not (hostname and latitude and longitude and location) then%>
-<div class="error">
- <%:Basic settings are incomplete. Please go to%> <a href='<%=basicsurl%>'><%:Basic settings%></a> <%:and fill out all required fields.%>
-</div>
-<%end%>
-<p />
-
-<% if not (nickname and name and mail) then%>
-<div class="error">
- <%:Contact information is incomplete. Please go to%> <a href='<%=contacturl%>'><%:Contact%></a> <%:and fill out all required fields.%>
- <p />
-</div>
-<%end%>
-
-<% uci:foreach("wireless", "wifi-device", function(section)
- local device = section[".name"]
- local url = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "network", "wireless")
- if section.diversity ~= "0" and section.disabled ~= "1" and section.type ~= "mac80211" then
- print('<div class="error">' .. translate("Diversity is enabled for device") .. ' <b>' .. section[".name"] .. '</b>. '
- .. translate("Go to") .. ' <a href="' .. url .. '">' .. translate("wireless settings") .. '</a> ' ..
- translate("to disable it.") .. '</div><p />')
- end
-end) %>
-
-<%+footer%>
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm
deleted file mode 100644
index dececeff5..000000000
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm
+++ /dev/null
@@ -1,57 +0,0 @@
-<%#
- Copyright 2008 Steven Barth <steven@midlink.org>
- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
- Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%+header%>
-
-<%
-local uci = require "luci.model.uci".cursor()
-local nickname = uci:get("freifunk", "contact", "nickname") or ""
-local name = uci:get("freifunk", "contact", "name") or ""
-local homepage = uci:get("freifunk", "contact", "homepage") or {}
-local mail = uci:get("freifunk", "contact", "mail") or ""
-local phone = uci:get("freifunk", "contact", "phone") or ""
-local location = uci:get_first("system", "system", "locaton") or uci:get("freifunk", "contact", "location") or ""
-local note = uci:get("freifunk", "contact", "note") or ""
-local lon = uci:get_first("system", "system", "longitude") or ""
-local lat = uci:get_first("system", "system", "latitude") or ""
-%>
-
-<h2 name="content"><%:Contact%></h2>
-
-<fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
-<legend><%:Operator%></legend>
- <div class="table" cellspacing="10" width="100%" style="text-align:left">
- <div class="tr"><div class="th" width="33%"><%:Nickname%>:</div><div class="td"><%=nickname%></div></div>
- <div class="tr"><div class="th" width="33%"><%:Realname%>:</div><div class="td"><%=name%></div></div>
- <div class="tr"><div class="th" width="33%"><%:Homepage%>:</div><div class="td">
- <% for k, v in ipairs(homepage) do %>
- <a href="<%=v%>"><%=v%></a><br />
- <% end %>
- </div></div>
- <div class="tr"><div class="th" width="33%"><%:E-Mail%>:</div><div class="td"><a href="mailto:<%=mail%>"><%=mail%></a></div></div>
- <div class="tr"><div class="th" width="33%"><%:Phone%>:</div><div class="td"><%=phone%></div></div>
- </div>
-</fieldset>
-
-<fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
-<legend><%:Location%></legend>
- <div class="table" cellspacing="10" width="100%" style="text-align:left">
- <div class="tr"><div class="th" width="33%"><%:Location%>:</div><div class="td"><%=location%></div></div>
- <div class="tr"><div class="th" width="33%"><%:Coordinates%>:</div><div class="td"><%=lat%> <%=lon%> (<a href="<%=pcdata(luci.dispatcher.build_url("freifunk/map"))%>"><%:Show on map%>)</a></div></div>
- </div>
-</fieldset>
-
-<% if note then %>
-<fieldset xmlns="http://www.w3.org/1999/xhtml" class="cbi-section">
-<legend><%:Notice%></legend>
- <div class="table" cellspacing="10" width="100%" style="text-align:left">
- <div class="tr"><div class="td"><%=note%></div></div>
- </div>
-</fieldset>
-<%end%>
-
-<%+footer%>
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm
deleted file mode 100644
index 3affc73fb..000000000
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm
+++ /dev/null
@@ -1,76 +0,0 @@
-<%#
- Copyright 2008 Steven Barth <steven@midlink.org>
- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%+header%>
-<%
-local uci = require "luci.model.uci".cursor()
-local tpl = require "luci.template"
-local fs = require "nixio.fs"
-
-local community = uci:get("freifunk", "community", "name") or "Freifunk"
-local DefaultText = uci:get("freifunk", "community", "DefaultText") or ""
-local nickname = uci:get("freifunk", "contact", "nickname") or "No Nickname set"
-
-local co = "profile_" .. community
---local community = uci:get_first(co, "community", "name") or "Freifunk"
-local url = uci:get_first(co, "community", "homepage") or "http://www.freifunk.net"
-
-
-local usertext = fs.readfile("/www/luci-static/index_user.html")
-
-if DefaultText ~= "disabled" then
-
- defaulttext = '<h2><a id="content" name="content">'..
- (translate("Hello and welcome in the network of"))..
- ' '..
- (community or "Freifunk Deutschland")..
- '!</a></h2><p>'..
- translate("We are an initiative to establish a free, independent and open wireless mesh network.")..
- '<br />'..
- translate("This is the access point")..
- ' '..
- luci.sys.hostname()..
- '. '..
- translate("It is operated by")..
- ' <a href="'..
- luci.dispatcher.build_url("freifunk", "contact")..
- '">'..
- (nickname or translate("Please set your contact information"))..
- '</a>.</p><p>'..
- translate("You can find further information about the global Freifunk initiative at")..
- ' <a href="http://freifunk.net">Freifunk.net</a>.<br />'..
- translate("If you are interested in our project then contact the local community")..
- ' <a href="'..url..'">'..community..'</a>.</p><p><strong>'..
- translate("Notice")..
- '</strong>: '..
- translate("Internet access depends on technical and organisational conditions and may or may not work for you.")..
- '</p>'
-end
-%>
-
-<%=defaulttext%>
-<%=usertext%>
-
-<%
--- add custom widgets from view/freifunk/widgets
-local widgets = {}
-local dir = "/usr/lib/lua/luci/view/freifunk/widgets"
-
-uci:foreach("freifunk-widgets", "widget",
- function(s)
- if s.enabled == "1" then
- table.insert(widgets, s)
- end
- end)
-
-for k, v in ipairs(widgets) do
- if v['template'] and fs.access(dir .. "/" .. v['template'] .. "/main.htm") then
- tpl.render("freifunk/widgets/" .. v['template'] .. "/main", { data = v })
- end
-end
-
-%>
-<%+footer%>
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/profile_error.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/profile_error.htm
deleted file mode 100644
index 984fa0acf..000000000
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk/profile_error.htm
+++ /dev/null
@@ -1,11 +0,0 @@
-<%+header%>
-
-<%
-local profileurl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "basics")
-%>
-
-<h2><%:Error%></h2>
-<%:You need to select a profile before you can edit it. To select a profile go to%> <a href='<%=profileurl%>'><%:Basic settings%></a>.
-<p/>
-
-<%+footer%>
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm
deleted file mode 100644
index 572f8585d..000000000
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm
+++ /dev/null
@@ -1,363 +0,0 @@
-<%
-local utl = require "luci.util"
-local sys = require "luci.sys"
-local twa = require "luci.tools.webadmin"
-local ip = require "luci.ip"
-
--- System
-
-local sysinfo = utl.ubus("system", "info") or { }
-local boardinfo = utl.ubus("system", "board") or { }
-
-local loads = sysinfo.load or { 0, 0, 0 }
-local meminfo = sysinfo.memory or {
- total = 0,
- free = 0,
- buffered = 0,
- shared = 0
-}
-
-local uptime = twa.date_format(sysinfo.uptime or 0)
-local time = os.date("%a, %d %b %Y, %H:%M:%S")
-local load = string.format("%.2f, %.2f, %.2f", loads[1] / 65535.0, loads[2] / 65535.0, loads[3] / 65535.0)
-
-local mem = string.format(
- "%.2f MB (%.2f %s, %.2f %s, %.2f %s)",
- meminfo.total / 1024 / 1024,
- (meminfo.total - meminfo.free) / 1024 / 1024,
- tostring(i18n.translate("used")),
- meminfo.free / 1024 / 1024,
- tostring(i18n.translate("free")),
- meminfo.buffered / 1024 / 1024,
- tostring(i18n.translate("buffered"))
-)
-
-local interval = 5
-
--- wireless
-local ntm = require "luci.model.network".init()
-local devices = ntm:get_wifidevs()
-local netlist = { }
-local netdevs = { }
-local dev
-for _, dev in ipairs(devices) do
- local net
- for _, net in ipairs(dev:get_wifinets()) do
- netlist[#netlist+1] = net:ifname()
- netdevs[net:ifname()] = dev:name()
- end
-end
-local has_iwinfo = pcall(require, "iwinfo")
-
-
--- Find default routes
-
-local _, r, def4, def6
-
-for _, r in ipairs(ip.routes({ type = 1, dest_exact = "0.0.0.0/0" })) do
- def4 = {
- gateway = r.gw:string(),
- dest = r.dest:string(),
- dev = r.dev,
- metr = r.metric or 0
- }
- break
-end
-
-for _, r in ipairs(ip.routes({ type = 1, dest_exact = "::/0" })) do
- def6 = {
- gateway = r.gw:string(),
- dest = r.dest:string(),
- dev = r.dev,
- metr = r.metric or 0
- }
- break
-end
-
-
-if luci.http.formvalue("status") == "1" then
- local rv = { }
- for dev in pairs(netdevs) do
- local j = { id = dev }
- local iw = luci.sys.wifi.getiwinfo(dev)
- if iw then
- local f
- for _, f in ipairs({
- "channel", "txpower", "bitrate", "signal", "noise",
- "quality", "quality_max", "mode", "ssid", "bssid", "encryption", "ifname"
- }) do
- j[f] = iw[f]
- end
- end
- rv[#rv+1] = j
- end
-
-
- rv[#rv+1] = {
- time = time,
- uptime = uptime,
- load = load,
- mem = mem,
- defroutev4 = def4,
- defroutev6 = def6
- }
-
- luci.http.prepare_content("application/json")
- luci.http.write_json(rv)
- return
-end
--%>
-
-<%+header%>
-
-
-<script type="text/javascript">//<![CDATA[
- XHR.poll(<%=interval%> , '<%=REQUEST_URI%>', { status: 1 },
- function(x, st)
- {
- if (st)
- {
- for( var i = 0; i < st.length; i++ )
- {
- var iw = st[i];
- var is_assoc = (iw.bssid && iw.channel);
- var p = (100 / iw.quality_max * iw.quality);
- var q = is_assoc ? p : -1;
-
- var icon;
- if (q < 0)
- icon = "<%=resource%>/icons/signal-none.png";
- else if (q == 0)
- icon = "<%=resource%>/icons/signal-0.png";
- else if (q < 25)
- icon = "<%=resource%>/icons/signal-0-25.png";
- else if (q < 50)
- icon = "<%=resource%>/icons/signal-25-50.png";
- else if (q < 75)
- icon = "<%=resource%>/icons/signal-50-75.png";
- else
- icon = "<%=resource%>/icons/signal-75-100.png";
-
- var power = document.getElementById(iw.id + '-txpower');
- if (power)
- power.innerHTML = String.format('%s dbm', iw.txpower);
-
- var signal = document.getElementById(iw.id + '-signal');
- if (signal)
- signal.innerHTML = String.format(
- '<img src="%s" title="Signal: %s db / Noise: %s db" alt="Signal Quality" />',
- icon, iw.signal, iw.noise
- );
-
- var bitrate = document.getElementById(iw.id + '-bitrate');
- if (bitrate)
- bitrate.innerHTML = String.format('%s Mb/s', iw.bitrate ? iw.bitrate / 1000 : '?');
-
- var ssid = document.getElementById(iw.id + '-ssid');
- if (ssid)
- ssid.innerHTML = iw.ssid;
-
- var bssid = document.getElementById(iw.id + '-bssid');
- if (bssid)
- bssid.innerHTML = iw.bssid;
-
- var channel = document.getElementById(iw.id + '-channel');
- if (channel)
- channel.innerHTML = iw.channel;
-
- var mode = document.getElementById(iw.id + '-mode');
- if (mode)
- mode.innerHTML = iw.mode;
- }
-
- i = st.length - 1
- var u
-
- if (u = document.getElementById('dynuptime'))
- u.innerHTML = st[i].uptime;
-
- if (u = document.getElementById('dynload'))
- u.innerHTML = st[i].load;
-
- if (u = document.getElementById('dynmem'))
- u.innerHTML = st[i].mem;
-
- if (u = document.getElementById('dyntime'))
- u.innerHTML = st[i].time;
-
- if (st[i].defroutev4)
- {
- if (u = document.getElementById('v4dst'))
- u.innerHTML = st[i].defroutev4.dest;
-
- if (u = document.getElementById('v4gw'))
- u.innerHTML = st[i].defroutev4.gateway;
-
- if (u = document.getElementById('v4dev'))
- u.innerHTML = st[i].defroutev4.dev;
-
- if (u = document.getElementById('v4metr'))
- u.innerHTML = st[i].defroutev4.metr;
- }
-
- if (st[i].defroutev6)
- {
- if (u = document.getElementById('v6dst'))
- u.innerHTML = st[i].defroutev6.dest;
-
- if (u = document.getElementById('v6gw'))
- u.innerHTML = st[i].defroutev6.gateway;
-
- if (u = document.getElementById('v6dev'))
- u.innerHTML = st[i].defroutev6.dev;
-
- if (u = document.getElementById('v6metr'))
- u.innerHTML = st[i].defroutev6.metr;
- }
- }
- }
- );
-//]]></script>
-
-<div class="cbi-map">
- <h2><%:System%></h2>
- <div class="cbi-section-node">
- <div class="cbi-value"><label class="cbi-value-title"><%:System%></label><div class="cbi-value-field"><%=boardinfo.system or "?"%></div></div>
- <div class="cbi-value"><label class="cbi-value-title"><%:Model%></label><div class="cbi-value-field"><%=boardinfo.model or "?"%></div></div>
- <div class="cbi-value"><label class="cbi-value-title"><%:Load%></label><div class="cbi-value-field" id="dynload"><%=load%></div></div>
- <div class="cbi-value"><label class="cbi-value-title"><%:Memory%></label><div class="cbi-value-field" id="dynmem"><%=mem%></div></div>
- <div class="cbi-value"><label class="cbi-value-title"><%:Local Time%></label><div class="cbi-value-field" id="dyntime"><%=time%></div></div>
- <div class="cbi-value"><label class="cbi-value-title"><%:Uptime%></label><div class="cbi-value-field" id="dynuptime"><%=uptime%></div></div>
- </div>
-</div>
-
-<% if devices[1] then %>
-
-<div class="cbi-map">
- <h2><%:Wireless Overview%></h2>
-
- <% if not has_iwinfo then %>
- <div class="alert-message warning">
- <h4><%:Package libiwinfo required!%></h4>
- <p><%_The <em>libiwinfo</em> package is not installed. You must install this component for working wireless configuration!%></p>
- </div>
- <% end %>
-
- <div class="cbi-section">
- <div class="cbi-section-node">
- <div class="table cbi-section-table">
- <div class="tr cbi-section-table-titles">
- <div class="th cbi-section-table-cell"><%:Signal%></div>
- <div class="th cbi-section-table-cell"><%:Bitrate%></div>
- <div class="th cbi-section-table-cell"><%:SSID%></div>
- <div class="th cbi-section-table-cell"><%:BSSID%></div>
- <div class="th cbi-section-table-cell"><%:Channel%></div>
- <div class="th cbi-section-table-cell"><%:Mode%></div>
- <div class="th cbi-section-table-cell"><%:TX%>-<%:Power%></div>
- <div class="th cbi-section-table-cell"><%:Interface%></div>
- </div>
- <%
- for _, dev in ipairs(devices) do
- local net
- for _, net in ipairs(dev:get_wifinets()) do
- netlist[#netlist+1] = net:ifname()
- netdevs[net:ifname()] = dev:name()
-
- if net.iwinfo.signal and net.iwinfo.bssid then
- local signal = net.iwinfo.signal or "N/A"
- local noise = net.iwinfo.noise or "N/A"
- local q = net.iwinfo.quality or "0"
- local qmax = net.iwinfo.quality_max or "100"
- local qperc = q / qmax * 100
-
- if qperc == 0 then
- icon = "signal-none.png"
- elseif qperc < 26 then
- icon = "signal-0-25.png"
- elseif qperc < 51 then
- icon = "signal-25-50.png"
- elseif qperc < 76 then
- icon = "signal-50-75.png"
- elseif qperc < 100 then
- icon = "signal-75-100.png"
- else
- icon = "signal-0.png"
- end
-
- signal_string = "<img src='"..resource.."/icons/"..icon.."' title='Signal: "..signal.." db / Noise: "..noise.." db' alt='Signal Quality'></img>"
-
- local ssid = net.iwinfo.ssid or "N/A"
- local bssid = net.iwinfo.bssid or "N/A"
- local chan = net.iwinfo.channel or "N/A"
- local mode = net.iwinfo.mode or "N/A"
- local txpwr = net.iwinfo.txpower or "N/A"
- if txpwr ~= "N/A" then
- txpwr = txpwr.." dbm"
- end
- local bitrate = net.iwinfo.bitrate or "N/A"
- if bitrate ~= "N/A" then
- bitrate = ( bitrate / 1000 ).."Mb/s"
- end
- local interface = net.iwinfo.ifname or "N/A"
- %>
- <div class="tr cbi-section-table-row cbi-rowstyle-1">
- <div class="td cbi-value-field" id="<%=net:ifname()%>-signal"><%=signal_string%></div>
- <div class="td cbi-value-field" id="<%=net:ifname()%>-bitrate"><%=bitrate%></div>
- <div class="td cbi-value-field" id="<%=net:ifname()%>-ssid"><%=ssid%></div>
- <div class="td cbi-value-field" id="<%=net:ifname()%>-bssid"><%=bssid%></div>
- <div class="td cbi-value-field" id="<%=net:ifname()%>-channel"><%=chan%></div>
- <div class="td cbi-value-field" id="<%=net:ifname()%>-mode"><%=mode%></div>
- <div class="td cbi-value-field" id="<%=net:ifname()%>-txpower"><%=txpwr%></div>
- <div class="td cbi-value-field"><%=interface%></div>
- </div>
- <% end
- end
- end %>
- </div>
- </div>
- </div>
-</div>
-<% end %>
-
-<div class="cbi-map">
- <h2><%:Default routes%></h2>
- <div class="cbi-section">
- <div class="cbi-section-node">
-
-<% if not def4 and not def6 then %>
- <%:No default routes known.%>
-<%else%>
- <div class="table cbi-section-table">
- <div class="tr cbi-section-table-titles">
- <div class="th cbi-section-table-cell"><%:Network%></div>
- <div class="th cbi-section-table-cell"><%:Interface%></div>
- <div class="th cbi-section-table-cell"><%:Gateway%></div>
- <div class="th cbi-section-table-cell"><%:Metric%></div>
- </div>
-
- <% if def4 then %>
- <div class="tr cbi-section-table-row cbi-rowstyle-1">
- <div class="td cbi-value-field" id="v4dst"><%=def4.dest%></div>
- <div class="td cbi-value-field" id="v4dev"><%=def4.dev%></div>
- <div class="td cbi-value-field" id="v4gw"><%=def4.gateway%></div>
- <div class="td cbi-value-field" id="v4metr"><%=def4.metr%></div>
- </div>
-
- <% end
- if def6 then %>
-
- <div class="tr cbi-section-table-row cbi-rowstyle-2">
- <div class="td cbi-value-field" id="v6dst"><%=def6.dest%></div>
- <div class="td cbi-value-field" id="v6dev"><%=def6.dev%></div>
- <div class="td cbi-value-field" id="v6gw"><%=def6.gateway%></div>
- <div class="td cbi-value-field" id="v6metr"><%=def6.metr%></div>
- </div>
-
- <% end %>
-
- </div>
-<% end %>
- </div>
- </div>
-</div>
-<%+footer%>
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/remote_update.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/remote_update.htm
deleted file mode 100644
index f087472d3..000000000
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk/remote_update.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<%#
- Copyright 2008 Steven Barth <steven@midlink.org>
- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%+header%>
-
-<h2><%:Freifunk Remote Update%></h2>
-
-<p><%:Check for new firmware versions and perform automatic updates.%></p>
-
-<% if update then %>
-
- <% if update.info then %>
- <strong><%:Update available!%></strong>
- <br /><br />
- <pre><%=update.info%></pre><br />
- <% else %>
- <strong><%:The installed firmware is the most recent version.%></strong>
- <br /><br />
- <% end %>
-
- <p>
- <form method="post" action="" class="inline">
- <input type="hidden" name="flash" value="1" />
- <input type="submit" class="cbi-button cbi-button-apply" value="<%:Start Upgrade%>" />
- </form>
- </p>
-
-<% elseif confirm then %>
-
- <strong><%:Update Settings%></strong>
- <br /><br />
-
- <p><form method="post" action="" class="inline">
- <input type="hidden" name="flash" value="1" />
- <input type="hidden" name="confirm" value="1" />
-
- <input type="checkbox" class="cbi-input-checkbox" name="keepcfg" value="1" checked="checked" id="cb_keepcfg" />
- <label for="cb_keepcfg"></label>
- <label for="cb_keepcfg"><%:Keep configuration%></label><br />
-
- <input type="checkbox" class="cbi-input-checkbox" name="verify" value="1" checked="checked" id="cb_verify" />
- <label for="cb_verify"></label>
- <label for="cb_verify"><%:Verify downloaded images%></label><br /><br />
-
- <input type="submit" class="cbi-button cbi-button-apply" value="<%:Confirm Upgrade%>" />
- </form></p>
-
-<% end %>
-
-<%+footer%>