NIU:
Initial wireless DDNS: Show current address only if domain name is saved Minor tweaks
This commit is contained in:
parent
319f820388
commit
2bfa17e6f4
5 changed files with 37 additions and 3 deletions
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
|
@ -18,7 +18,7 @@ module "luci.controller.niu.system"
|
||||||
function index()
|
function index()
|
||||||
local toniu = {on_success_to={"niu"}}
|
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_dbtemplate = "niu/system"
|
||||||
e.niu_dbtasks = true
|
e.niu_dbtasks = true
|
||||||
e.niu_dbicon = "icons32/preferences-system.png"
|
e.niu_dbicon = "icons32/preferences-system.png"
|
||||||
|
|
28
modules/niu/luasrc/controller/niu/wireless.lua
Normal file
28
modules/niu/luasrc/controller/niu/wireless.lua
Normal file
|
@ -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
|
|
@ -40,6 +40,13 @@ pw.password = true
|
||||||
local dom = s:taboption("general", Value, "domain", translate("Hostname"))
|
local dom = s:taboption("general", Value, "domain", translate("Hostname"))
|
||||||
|
|
||||||
local current = s:taboption("general", DummyValue, "_current", "Current IP-Address")
|
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)
|
function current.value(self, section)
|
||||||
local dns = nxo.getaddrinfo(dom:cfgvalue(section))
|
local dns = nxo.getaddrinfo(dom:cfgvalue(section))
|
||||||
if dns then
|
if dns then
|
||||||
|
|
|
@ -58,8 +58,7 @@ end
|
||||||
<tr>
|
<tr>
|
||||||
<% if wanup then %>
|
<% if wanup then %>
|
||||||
<th>Uplink Address</th>
|
<th>Uplink Address</th>
|
||||||
<td><span style="color: darkgreen"><%=wanip%></span>
|
<td><%=wanip%></td>
|
||||||
</td>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<th>Uplink</th>
|
<th>Uplink</th>
|
||||||
<td><span style="color: darkred"><em>offline</em></span>
|
<td><span style="color: darkred"><em>offline</em></span>
|
||||||
|
|
Loading…
Reference in a new issue