From 2bfa17e6f415a5d99a2f65dc37e4b8ceac1c3b6a Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sat, 14 Nov 2009 19:24:12 +0000 Subject: [PATCH] NIU: Initial wireless DDNS: Show current address only if domain name is saved Minor tweaks --- .../resources/icons32/network-wireless.png | Bin 0 -> 2373 bytes modules/niu/luasrc/controller/niu/system.lua | 2 +- .../niu/luasrc/controller/niu/wireless.lua | 28 ++++++++++++++++++ .../luasrc/model/cbi/niu/network/ddns1.lua | 7 +++++ modules/niu/luasrc/view/niu/network.htm | 3 +- 5 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 modules/niu/htdocs/luci-static/resources/icons32/network-wireless.png create mode 100644 modules/niu/luasrc/controller/niu/wireless.lua 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 index 0000000000000000000000000000000000000000..94e7546150239704a8005a5e8de5202485d23559 GIT binary patch literal 2373 zcmV-L3A*-)P)sVf!vxdsZ`^T^3bx+an93@_7B75^T5fdH1*7IrFK`+d8?<|G$i$V0%FK3iB`vm z&{^H0+BC?P{opv~X-9kd(f=Cbxl$XKf3r(+j|g$KaX{Lhc}E?g(Ej>8g(ZwOad9FyzuBmnk#{x1MOMODt~j z0xYVGgMw{hvDM3Q&eM+e^rJsHmUrhb`WA8Muq5i2ZX-WBd+NC*s>oS=RECbPe1yTLms&ZYR7#8kR{i@nNw{KFp*+Un_Jha zZq1V=X`kDImECG`ia~EcWM8)j0K6TMtV<17Y1hjX`ju?i=Q!tSM|=9wpB(bYC7(JI z0^pfeJ`#J{WaXJDN~|89Yj|?QQwNHgoeq~@7;VF1SGLI-o}^vzpoHQ)?PyOw`jbN* zx#UxadS3}3T&0QmyxAqy;o*vyFq<-NS9CeY#bsTeh)C8Zu0B*V17$T0+ZeqeMW44f z-_owS&>HwS*W4PNqCXA4b@Zbh?deB?OGKDshTc*5V^-(15jH&BwMeTREwHO;?Mzg--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5wIPmf*?3eg0v8m@ttR#KgyACc_4W0MgoFh5y#jz=DEt?J z^9FbezVuLJlG6GnU3ILa1%00000NkvXXu0mjf#f+yv literal 0 HcmV?d00001 diff --git a/modules/niu/luasrc/controller/niu/system.lua b/modules/niu/luasrc/controller/niu/system.lua index 2adf1d762..e9e767a1d 100644 --- a/modules/niu/luasrc/controller/niu/system.lua +++ b/modules/niu/luasrc/controller/niu/system.lua @@ -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 index 000000000..f508abad5 --- /dev/null +++ b/modules/niu/luasrc/controller/niu/wireless.lua @@ -0,0 +1,28 @@ +--[[ +LuCI - Lua Development Framework + +Copyright 2009 Steven Barth + +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 diff --git a/modules/niu/luasrc/model/cbi/niu/network/ddns1.lua b/modules/niu/luasrc/model/cbi/niu/network/ddns1.lua index 497a9c025..5fb74ac2e 100644 --- a/modules/niu/luasrc/model/cbi/niu/network/ddns1.lua +++ b/modules/niu/luasrc/model/cbi/niu/network/ddns1.lua @@ -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 diff --git a/modules/niu/luasrc/view/niu/network.htm b/modules/niu/luasrc/view/niu/network.htm index 0e057f199..f61e3e1f6 100644 --- a/modules/niu/luasrc/view/niu/network.htm +++ b/modules/niu/luasrc/view/niu/network.htm @@ -58,8 +58,7 @@ end <% if wanup then %> Uplink Address -<%=wanip%> - +<%=wanip%> <% else %> Uplink offline -- 2.25.1