modules/admin-full: Rewrote route configuration page
[project/luci.git] / modules / freifunk / luasrc / controller / freifunk / freifunk.lua
index 104f6cd..7179726 100644 (file)
@@ -1,7 +1,23 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
 module("luci.controller.freifunk.freifunk", package.seeall)
 
 function index()
+       local i18n = luci.i18n.translate
+
        local page  = node()
+       page.lock   = true
        page.target = alias("freifunk")
 
        local page    = node("freifunk")
@@ -10,6 +26,7 @@ function index()
        page.order    = 5
        page.setuser  = "nobody"
        page.setgroup = "nogroup"
+       page.i18n     = "freifunk"
        
        local page  = node("freifunk", "index")
        page.target = template("freifunk/index")
@@ -22,21 +39,19 @@ function index()
        
        
        local page  = node("freifunk", "status")
-       page.target = action_status
+       page.target = call("action_status")
        page.title  = "Status"
        page.order  = 20
        page.setuser  = false
        page.setgroup = false
-
-       local page  = node("freifunk", "status", "routes")
-       page.target = template("public_status/routes")
-       page.title  = "Routingtabelle"
-       page.order  = 10
        
-       local page  = node("freifunk", "status", "iwscan")
-       page.target = template("public_status/iwscan")
-       page.title  = "WLAN-Scan"
-       page.order  = 20        
+       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")
@@ -52,7 +67,8 @@ end
 function action_status()
        local data = {}
        
-       data.s, data.m, data.r = luci.sys.sysinfo()
+       data.system, data.model, data.memtotal, data.memcached, data.membuffers, data.memfree, data.perc_memfree, data.perc_membuffers, data.perc_memcached = luci.sys.sysinfo()
+
        
        data.wifi = luci.sys.wifi.getiwconfig()