757024df0c499219560829fde778cad462629b27
[project/luci.git] / modules / niu / luasrc / controller / niu / dashboard.lua
1 --[[
2 LuCI - Lua Development Framework
3
4 Copyright 2009 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
15 local req = require
16 module "luci.controller.niu.dashboard"
17
18 function index()
19 local uci = require "luci.model.uci"
20
21 local root = node()
22 if not root.lock then
23 root.target = alias("niu")
24 root.index = true
25 end
26
27 entry({"niu"}, alias("niu", "dashboard"), "NIU", 10)
28 entry({"niu", "dashboard"}, call("dashboard"), "Dashboard", 1).css =
29 "niu.css"
30 end
31
32 local require = req
33
34 function dashboard()
35 local dsp = require "luci.dispatcher"
36 local tpl = require "luci.template"
37 local utl = require "luci.util"
38 local uci = require "luci.model.uci"
39
40 local nds = dsp.node("niu").nodes
41 tpl.render("niu/dashboard", {utl = utl, nodes = nds, dsp = dsp, tpl = tpl})
42 end