3fb45f804d04cb4315d4969263c0234071d94173
[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 = template("admin_network/index")
23 page.title = i18n("network", "Netzwerk")
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", "Switch")
29 page.order = 10
30
31 local page = node("admin", "network", "ifaces")
32 page.target = cbi("admin_network/ifaces")
33 page.title = i18n("interfaces", "Schnittstellen")
34 page.order = 20
35 page.leaf = true
36
37 luci.model.uci.foreach("network", "interface",
38 function (section)
39 local ifc = section[".name"]
40 if ifc ~= "loopback" then
41 entry({"admin", "network", "ifaces", ifc}, page.target, ifc)
42 end
43 end
44 )
45
46
47 local page = node("admin", "network", "dhcp")
48 page.target = cbi("admin_network/dhcp")
49 page.title = "DHCP"
50 page.order = 30
51
52 local page = node("admin", "network", "ptp")
53 page.target = cbi("admin_network/ptp")
54 page.title = "PPPoE / PPTP"
55 page.order = 40
56
57 local page = node("admin", "network", "routes")
58 page.target = cbi("admin_network/routes")
59 page.title = i18n("a_n_routes", "Routen")
60 page.order = 50
61 end