Changeset 6653

Show
Ignore:
Timestamp:
12/17/10 03:14:28 (2 years ago)
Author:
soma
Message:

applications/luci-olsr: Add overview page, move old index to neigbors

Location:
luci/trunk/applications/luci-olsr
Files:
6 added
1 removed
2 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/applications/luci-olsr/luasrc/controller/olsr.lua

    r6627 r6653  
    1010 
    1111    local page  = node("admin", "status", "olsr") 
    12     page.target = call("action_index") 
     12    page.target = template("status-olsr/overview") 
    1313    page.title  = "OLSR" 
    1414    page.i18n   = "olsr" 
    1515    page.subindex = true 
     16 
     17    local page  = node("admin", "status", "olsr", "neighbors") 
     18    page.target = call("action_neigh") 
     19    page.title  = i18n("Neighbors") 
     20    page.subindex = true 
     21    page.order  = 5 
    1622 
    1723    local page  = node("admin", "status", "olsr", "routes") 
     
    3945    page.title  = "SmartGW" 
    4046    page.order  = 60 
     47 
     48    local page  = node("admin", "status", "olsr", "interfaces") 
     49        page.target = call("action_interfaces") 
     50        page.title  = i18n("Interfaces") 
     51        page.order  = 70 
    4152 
    4253    local ol = entry( 
     
    7889end 
    7990 
    80 function action_index() 
     91function action_neigh() 
    8192    local data = fetch_txtinfo("links") 
    8293 
     
    103114    table.sort(data.Links, compare) 
    104115 
    105     luci.template.render("status-olsr/index", {links=data.Links}) 
     116    luci.template.render("status-olsr/neighbors", {links=data.Links}) 
    106117end 
    107118 
     
    202213end 
    203214 
    204  
     215function action_interfaces() 
     216        local data = fetch_txtinfo("interfaces") 
     217 
     218        if not data or not data.Interfaces then 
     219                luci.template.render("status-olsr/error_olsr") 
     220                return nil 
     221        end 
     222 
     223        luci.template.render("status-olsr/interfaces", {iface=data.Interfaces}) 
     224end 
    205225 
    206226-- Internal 
  • luci/trunk/applications/luci-olsr/luasrc/view/status-olsr/smartgw.htm

    r6627 r6653  
    33Copyright 2008 Steven Barth <steven@midlink.org> 
    44Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net> 
     5Copyright 2010 Manuel Munz <freifunk at somakoma dot de> 
    56 
    67Licensed under the Apache License, Version 2.0 (the "License"); 
     
    910 
    1011    http://www.apache.org/licenses/LICENSE-2.0 
     12-%> 
    1113 
    12 $Id: mid.htm 5448 2009-10-31 15:54:11Z jow $ 
    13  
    14 -%> 
    1514<% 
    1615require("luci.model.uci")