3952fb868b044deaa55fd8a2cb9fcf48e6372a19
[project/luci.git] / modules / admin-full / luasrc / controller / admin / network.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 module("luci.controller.admin.network", package.seeall)
15
16 function index()
17         require("luci.i18n")
18         require("luci.model.uci")
19         local i18n = luci.i18n.translate
20
21         local page  = node("admin", "network")
22         page.target = alias("admin", "network", "network")
23         page.title  = i18n("network")  
24         page.order  = 50
25         
26         local page  = node("admin", "network", "vlan")
27         page.target = cbi("admin_network/vlan")
28         page.title  = i18n("a_n_switch")
29         page.order  = 20
30         
31         local page  = node("admin", "network", "network")
32         page.target = cbi("admin_network/network")
33         page.title  = i18n("interfaces", "Schnittstellen")
34         page.order  = 10
35         luci.model.uci.foreach("network", "interface",
36                 function (section)
37                         local ifc = section[".name"]
38                         if ifc ~= "loopback" then
39                                 entry({"admin", "network", "network", ifc},
40                                  alias("admin", "network", "ifaces", ifc),
41                                  ifc:upper())
42                         end
43                 end
44         )
45         
46         local page  = node("admin", "network", "ifaces")
47         page.target = cbi("admin_network/ifaces")
48         page.leaf   = true
49
50         local page  = node("admin", "network", "dhcp")
51         page.target = cbi("admin_network/dhcp")
52         page.title  = "DHCP"
53         page.order  = 30
54         
55         entry(
56          {"admin", "network", "dhcp", "leases"},
57          cbi("admin_network/dhcpleases"),
58          i18n("dhcp_leases")
59         ) 
60         
61         local page  = node("admin", "network", "routes")
62         page.target = cbi("admin_network/routes")
63         page.title  = i18n("a_n_routes")
64         page.order  = 40
65         page.leaf   = true
66         
67         entry(
68          {"admin", "network", "routes", "static"},
69          function() end,
70          i18n("a_n_routes_static")
71         )
72
73 end