summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-11-29 21:37:29 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-11-29 21:37:29 +0000
commit4f6a244c70828db43967130d50772d2c3933a4a4 (patch)
tree1ca60cee96ceeac673981b1e1617e5f4ae77a12a /modules
parentfdcdb98f8d50b74e924bc32735ad8042098e0eba (diff)
luci-0.8: merge r3714, r3716, r3750 and r3833-r3834
Diffstat (limited to 'modules')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/routes.lua14
-rw-r--r--modules/freifunk/luasrc/controller/freifunk/freifunk.lua37
2 files changed, 15 insertions, 36 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua b/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua
index a236e8c196..aa22cf63f2 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua
@@ -21,23 +21,23 @@ if not arg or not arg[1] then
net = v:option(DummyValue, "iface", translate("network"))
function net.cfgvalue(self, section)
- return luci.tools.webadmin.iface_get_network(routes[section].Iface)
- or routes[section].Iface
+ return luci.tools.webadmin.iface_get_network(routes[section].device)
+ or routes[section].device
end
target = v:option(DummyValue, "target", translate("target"))
function target.cfgvalue(self, section)
- return luci.ip.Hex(routes[section].Destination, 32):string()
+ return routes[section].dest:network():string()
end
netmask = v:option(DummyValue, "netmask", translate("netmask"))
function netmask.cfgvalue(self, section)
- return luci.ip.Hex(routes[section].Mask, 32):string()
+ return routes[section].dest:mask():string()
end
gateway = v:option(DummyValue, "gateway", translate("gateway"))
function gateway.cfgvalue(self, section)
- return luci.ip.Hex(routes[section].Gateway, 32):string()
+ return routes[section].gateway:string()
end
metric = v:option(DummyValue, "Metric", translate("metric"))
@@ -55,12 +55,12 @@ if not arg or not arg[1] then
target = v:option(DummyValue, "target", translate("target"))
function target.cfgvalue(self, section)
- return routes6[section].dst_ip .. "/" .. routes6[section].dst_prefix
+ return routes6[section].dest:string()
end
gateway = v:option(DummyValue, "gateway", translate("gateway6"))
function gateway.cfgvalue(self, section)
- return routes6[section].src_ip .. "/" .. routes6[section].src_prefix
+ return routes6[section].source:string()
end
metric = v:option(DummyValue, "Metric", translate("metric"))
diff --git a/modules/freifunk/luasrc/controller/freifunk/freifunk.lua b/modules/freifunk/luasrc/controller/freifunk/freifunk.lua
index 07b12f3f7c..460ebbec5b 100644
--- a/modules/freifunk/luasrc/controller/freifunk/freifunk.lua
+++ b/modules/freifunk/luasrc/controller/freifunk/freifunk.lua
@@ -27,60 +27,39 @@ function index()
page.setuser = "nobody"
page.setgroup = "nogroup"
page.i18n = "freifunk"
-
+
local page = node("freifunk", "index")
page.target = template("freifunk/index")
page.title = "Übersicht"
page.order = 10
-
+
local page = node("freifunk", "index", "contact")
page.target = template("freifunk/contact")
page.title = "Kontakt"
-
-
+
+
local page = node("freifunk", "status")
page.target = call("action_status")
page.title = "Status"
page.order = 20
page.setuser = false
page.setgroup = false
-
+
assign({"freifunk", "status", "iwscan"}, {"admin", "status", "iwscan"}, "WLAN-Scan", 20)
assign({"freifunk", "olsr"}, {"admin", "status", "olsr"}, "OLSR", 30)
-
+
if luci.fs.isfile("/etc/config/luci_statistics") then
assign({"freifunk", "statistics"}, {"admin", "statistics", "graph"}, i18n("stat_statistics", "Statistiken"), 40)
end
-
+
local page = node("admin", "index", "freifunk")
page.target = cbi("freifunk/freifunk")
page.title = "Freifunk"
page.order = 30
-
+
local page = node("admin", "index", "contact")
page.target = cbi("freifunk/contact")
page.title = "Kontakt"
page.order = 40
end
-
-function action_status()
- local data = {}
-
- data.system, data.model, data.memtotal, data.memcached, data.membuffers, data.memfree = luci.sys.sysinfo()
- data.perc_memfree = math.floor((data.memfree/data.memtotal)*100)
- data.perc_membuffers = math.floor((data.membuffers/data.memtotal)*100)
- data.perc_memcached = math.floor((data.memcached/data.memtotal)*100)
-
- data.wifi = luci.sys.wifi.getiwconfig()
-
- data.routes = {}
- for i, r in pairs(luci.sys.net.routes()) do
- if r.Destination == "00000000" then
- table.insert(data.routes, r)
- end
- end
-
-
- luci.template.render("public_status/index", data)
-end \ No newline at end of file