Split up admin-core into admin-core and admin-full, preparing admin-mini
[project/luci.git] / modules / admin-mini / luasrc / controller / index.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.index", package.seeall)
15
16 function index()
17         luci.i18n.loadc("admin-core")
18         local i18n = luci.i18n.translate
19
20         local root = node()
21         if not root.target then
22                 root.target = alias("admin")
23         end
24         
25         entry({"about"}, template("about")).i18n = "admin-core"
26         
27         local page   = node("admin")
28         page.target  = alias("admin", "index")
29         page.title   = i18n("administration", "Administration")
30         page.order   = 10
31         page.i18n    = "admin-core"
32         page.sysauth = "root"
33         
34         local page  = node("admin", "index")
35         page.target = template("admin_index/index")
36         page.title  = i18n("overview", "Übersicht")
37         page.order  = 10
38         
39         local page  = node("admin", "index", "luci")
40         page.target = cbi("admin_index/luci")
41         page.title  = i18n("a_i_ui", "Oberfläche")
42         
43         entry({"admin", "logout"}, call("action_logout"), i18n("logout"))
44 end
45
46 function action_logout()
47         luci.http.header("Set-Cookie", "sysauth=; path=/")
48         luci.http.redirect(luci.dispatcher.build_url())
49 end