X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-olsr%2Fluasrc%2Fcontroller%2Folsr.lua;h=d5a212ccc34813cfd8fc666d7c36a8ae16e4bafe;hp=9866060fc99cb6bebf12f90b5cbe5dbbc288fe06;hb=210d77543369ab3f44e5aa4894ed82134019c1b5;hpb=f68906c20fa82065196d37e243c5819f7ff18ea9;ds=sidebyside diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua index 9866060fc..d5a212ccc 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)