diff options
author | Steven Barth <steven@midlink.org> | 2009-10-26 17:40:39 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2009-10-26 17:40:39 +0000 |
commit | c47765a6118b2a6eb0d74b95f5cb4abda23fe6db (patch) | |
tree | a16b542ea2683b95fcec5cef142e72d44c347e0c /modules/niu/luasrc/controller | |
parent | 9bb9cc378bd91e5983936326260316cd6c4332a9 (diff) |
NIU: Initial
Diffstat (limited to 'modules/niu/luasrc/controller')
-rw-r--r-- | modules/niu/luasrc/controller/niu/dashboard.lua | 44 | ||||
-rw-r--r-- | modules/niu/luasrc/controller/niu/network.lua | 22 |
2 files changed, 66 insertions, 0 deletions
diff --git a/modules/niu/luasrc/controller/niu/dashboard.lua b/modules/niu/luasrc/controller/niu/dashboard.lua new file mode 100644 index 0000000000..e3270e4c66 --- /dev/null +++ b/modules/niu/luasrc/controller/niu/dashboard.lua @@ -0,0 +1,44 @@ +--[[ +LuCI - Lua Development Framework + +Copyright 2009 Steven Barth <steven@midlink.org> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +local req = require +module "luci.controller.niu.dashboard" + +function index() + local translate = require "luci.i18n".translate + local uci = require "luci.model.uci" + + local root = node() + if not root.lock then + root.target = alias("niu") + root.index = true + end + + entry({"niu"}, alias("niu", "dashboard"), "NIU", 10) + entry({"niu", "dashboard"}, call("dashboard"), "Dashboard", 1) +end + +local require = req + +function dashboard() + local dsp = require "luci.dispatcher" + local tpl = require "luci.template" + local utl = require "luci.util" + local uci = require "luci.model.uci" + local str = require "luci.store" + str.uci_state = str.uci_state or uci.cursor() + + local nds = dsp.node("niu").nodes + tpl.render("niu/dashboard", {utl = utl, nodes = nds, dsp = dsp, tpl = tpl}) +end diff --git a/modules/niu/luasrc/controller/niu/network.lua b/modules/niu/luasrc/controller/niu/network.lua new file mode 100644 index 0000000000..11f87fc3c7 --- /dev/null +++ b/modules/niu/luasrc/controller/niu/network.lua @@ -0,0 +1,22 @@ +--[[ +LuCI - Lua Development Framework + +Copyright 2009 Steven Barth <steven@midlink.org> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +local req = require +module "luci.controller.niu.network" + +function index() + entry({"niu", "network"}, alias("admin", "network"), "Network") + .dbtemplate = "niu/network" + entry({"niu", "network", "lan"}, cbi("niu/network/lan"), "Configure LAN") +end |