diff options
author | Manuel Munz <freifunk@somakoma.de> | 2010-12-17 02:14:28 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2010-12-17 02:14:28 +0000 |
commit | 210d77543369ab3f44e5aa4894ed82134019c1b5 (patch) | |
tree | af77d40be6cec9baee22a37fc598cfec42ef82e4 /applications/luci-olsr/luasrc/controller | |
parent | f68906c20fa82065196d37e243c5819f7ff18ea9 (diff) |
applications/luci-olsr: Add overview page, move old index to neigbors
Diffstat (limited to 'applications/luci-olsr/luasrc/controller')
-rw-r--r-- | applications/luci-olsr/luasrc/controller/olsr.lua | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua index 9866060fc9..d5a212ccc3 100644 --- a/applications/luci-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-olsr/luasrc/controller/olsr.lua @@ -9,11 +9,17 @@ function index() local i18n = luci.i18n.translate local page = node("admin", "status", "olsr") - page.target = call("action_index") + page.target = template("status-olsr/overview") page.title = "OLSR" page.i18n = "olsr" page.subindex = true + local page = node("admin", "status", "olsr", "neighbors") + page.target = call("action_neigh") + page.title = i18n("Neighbors") + page.subindex = true + page.order = 5 + local page = node("admin", "status", "olsr", "routes") page.target = call("action_routes") page.title = i18n("Routen") @@ -39,6 +45,11 @@ function index() page.title = "SmartGW" page.order = 60 + local page = node("admin", "status", "olsr", "interfaces") + page.target = call("action_interfaces") + page.title = i18n("Interfaces") + page.order = 70 + local ol = entry( {"admin", "services", "olsrd"}, cbi("olsr/olsrd"), "OLSR" @@ -77,7 +88,7 @@ function index() ) end -function action_index() +function action_neigh() local data = fetch_txtinfo("links") if not data or not data.Links then @@ -102,7 +113,7 @@ function action_index() table.sort(data.Links, compare) - luci.template.render("status-olsr/index", {links=data.Links}) + luci.template.render("status-olsr/neighbors", {links=data.Links}) end function action_routes() @@ -201,7 +212,16 @@ function action_smartgw() luci.template.render("status-olsr/smartgw", {gws=data.Gateways}) end +function action_interfaces() + local data = fetch_txtinfo("interfaces") + + if not data or not data.Interfaces then + luci.template.render("status-olsr/error_olsr") + return nil + end + luci.template.render("status-olsr/interfaces", {iface=data.Interfaces}) +end -- Internal function fetch_txtinfo(otable) |