NIU:
authorSteven Barth <steven@midlink.org>
Sat, 14 Nov 2009 19:24:12 +0000 (19:24 +0000)
committerSteven Barth <steven@midlink.org>
Sat, 14 Nov 2009 19:24:12 +0000 (19:24 +0000)
Initial wireless
DDNS: Show current address only if domain name is saved
Minor tweaks

modules/niu/htdocs/luci-static/resources/icons32/network-wireless.png [new file with mode: 0644]
modules/niu/luasrc/controller/niu/system.lua
modules/niu/luasrc/controller/niu/wireless.lua [new file with mode: 0644]
modules/niu/luasrc/model/cbi/niu/network/ddns1.lua
modules/niu/luasrc/view/niu/network.htm

diff --git a/modules/niu/htdocs/luci-static/resources/icons32/network-wireless.png b/modules/niu/htdocs/luci-static/resources/icons32/network-wireless.png
new file mode 100644 (file)
index 0000000..94e7546
Binary files /dev/null and b/modules/niu/htdocs/luci-static/resources/icons32/network-wireless.png differ
index 2adf1d76239641bf8c48c33d9249657a9f849931..e9e767a1de12a2837c2eced81263470a80f7af94 100644 (file)
@@ -18,7 +18,7 @@ module "luci.controller.niu.system"
 function index()
        local toniu = {on_success_to={"niu"}}
 
-       local e = entry({"niu", "system"}, alias("niu"), "System", 20)
+       local e = entry({"niu", "system"}, alias("niu"), "System", 30)
        e.niu_dbtemplate = "niu/system"
        e.niu_dbtasks = true
        e.niu_dbicon = "icons32/preferences-system.png"
diff --git a/modules/niu/luasrc/controller/niu/wireless.lua b/modules/niu/luasrc/controller/niu/wireless.lua
new file mode 100644 (file)
index 0000000..f508aba
--- /dev/null
@@ -0,0 +1,28 @@
+--[[
+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 require = require
+module "luci.controller.niu.wireless"
+
+function index()
+       local toniu = {on_success_to={"niu"}}
+       
+       local e = entry({"niu", "wireless"}, alias("niu"), "Wireless", 20)
+       --e.niu_dbtemplate = "niu/wireless"
+       e.niu_dbtasks = true
+       e.niu_dbicon = "icons32/network-wireless.png"
+
+       entry({"niu", "wireless", "ap"}, 
+       cbi("niu/network/ap", toniu), "Configure Private Access Point", 1)
+end
\ No newline at end of file
index 497a9c02566ee39d90bf16a9b9b4ba693c861413..5fb74ac2e7a3af87ad7e25e39687e6c5b01af618 100644 (file)
@@ -40,6 +40,13 @@ pw.password = true
 local dom = s:taboption("general", Value, "domain", translate("Hostname"))
 
 local current = s:taboption("general", DummyValue, "_current", "Current IP-Address")
+
+function current.render(self, section, ...)
+       if dom:cfgvalue(section) then
+               return DummyValue.render(self, section, ...)
+       end
+end
+
 function current.value(self, section)
        local dns = nxo.getaddrinfo(dom:cfgvalue(section))
        if dns then
index 0e057f199f0ab6da6f83ef7921344e80cafcbc8c..f61e3e1f6eb59d51eb4cf4ca15df7f10b6bc07f9 100644 (file)
@@ -58,8 +58,7 @@ end
 <tr>
 <% if wanup then %>
 <th>Uplink Address</th>
-<td><span style="color: darkgreen"><%=wanip%></span>
-</td>
+<td><%=wanip%></td>
 <% else %>
 <th>Uplink</th>
 <td><span style="color: darkred"><em>offline</em></span>