NIU: Minor fixes
This commit is contained in:
parent
8b80a623c3
commit
1f83b916ac
4 changed files with 48 additions and 29 deletions
|
@ -561,7 +561,7 @@ function Delegator.get(self, name)
|
||||||
local node = self.nodes[name]
|
local node = self.nodes[name]
|
||||||
|
|
||||||
if type(node) == "string" then
|
if type(node) == "string" then
|
||||||
node = load(node)
|
node = load(node, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(node) == "table" and getmetatable(node) == nil then
|
if type(node) == "table" and getmetatable(node) == nil then
|
||||||
|
|
|
@ -46,6 +46,10 @@ local function deviceroute(self)
|
||||||
if cursor:get("wireless", "client", "device") ~= widev then
|
if cursor:get("wireless", "client", "device") ~= widev then
|
||||||
cursor:delete("wireless", "client", "network")
|
cursor:delete("wireless", "client", "network")
|
||||||
cursor:set("wireless", "client", "device", widev)
|
cursor:set("wireless", "client", "device", widev)
|
||||||
|
cursor:delete_all("wireless", "wifi-iface", function(s)
|
||||||
|
return s.device == widev and s._niu ~= "1"
|
||||||
|
end)
|
||||||
|
cursor:set("wireless", widev, "disabled", 0)
|
||||||
end
|
end
|
||||||
self:set_route("wlanwan1", "wlanwan2")
|
self:set_route("wlanwan1", "wlanwan2")
|
||||||
else
|
else
|
||||||
|
|
|
@ -13,13 +13,17 @@ You may obtain a copy of the License at
|
||||||
$Id$
|
$Id$
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
|
local iface = "ap"
|
||||||
|
local ap = true
|
||||||
|
|
||||||
|
|
||||||
local fs = require "nixio.fs"
|
local fs = require "nixio.fs"
|
||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
local cursor = require "luci.model.uci".inst
|
local cursor = require "luci.model.uci".inst
|
||||||
local state = require "luci.model.uci".inst_state
|
local state = require "luci.model.uci".inst_state
|
||||||
cursor:unload("wireless")
|
cursor:unload("wireless")
|
||||||
|
|
||||||
local device = cursor:get("wireless", "ap", "device")
|
local device = cursor:get("wireless", iface, "device")
|
||||||
local hwtype = cursor:get("wireless", device, "type")
|
local hwtype = cursor:get("wireless", device, "type")
|
||||||
|
|
||||||
local nsantenna = cursor:get("wireless", device, "antenna")
|
local nsantenna = cursor:get("wireless", device, "antenna")
|
||||||
|
@ -37,10 +41,12 @@ state:foreach("wireless", "wifi-iface",
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
m = Map("wireless", "Configure Access Point",
|
local m
|
||||||
"The private Access Point is about to be created. You only need to provide "..
|
|
||||||
"a network name and a password to finish this step and - if you like - tweak "..
|
|
||||||
"some of the advanced settings.")
|
if ap then
|
||||||
|
m = Map("wireless", translate("Configure Access Point"))
|
||||||
|
end
|
||||||
|
|
||||||
--- Device Settings ---
|
--- Device Settings ---
|
||||||
s = m:section(NamedSection, device, "wifi-device", "Device Configuration")
|
s = m:section(NamedSection, device, "wifi-device", "Device Configuration")
|
||||||
|
@ -163,7 +169,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
s = m:section(NamedSection, "ap", "wifi-iface", "Access Point Details")
|
s = m:section(NamedSection, iface, "wifi-iface", translate("Interface Details"))
|
||||||
s.addremove = false
|
s.addremove = false
|
||||||
|
|
||||||
s:tab("general", translate("General Settings"))
|
s:tab("general", translate("General Settings"))
|
||||||
|
@ -194,25 +200,31 @@ elseif hwtype == "atheros" then
|
||||||
|
|
||||||
s:taboption("expert", Flag, "wds", "Allow Bridging and Repeating (WDS)")
|
s:taboption("expert", Flag, "wds", "Allow Bridging and Repeating (WDS)")
|
||||||
|
|
||||||
hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point"))
|
if ap then
|
||||||
hidden:depends({mode="ap"})
|
hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point"))
|
||||||
hidden:depends({mode="ap-wds"})
|
hidden:depends({mode="ap"})
|
||||||
|
hidden:depends({mode="ap-wds"})
|
||||||
|
|
||||||
isolate = s:taboption("expert", Flag, "isolate", translate("Prevent communication between clients"))
|
isolate = s:taboption("expert", Flag, "isolate", translate("Prevent communication between clients"))
|
||||||
isolate:depends({mode="ap"})
|
isolate:depends({mode="ap"})
|
||||||
|
end
|
||||||
|
|
||||||
s:taboption("expert", Flag, "bursting", translate("Allow Burst Transmissions"))
|
s:taboption("expert", Flag, "bursting", translate("Allow Burst Transmissions"))
|
||||||
elseif hwtype == "broadcom" then
|
elseif hwtype == "broadcom" then
|
||||||
mode:value("wds", translate("WDS"))
|
if ap then
|
||||||
|
mode:value("wds", translate("WDS"))
|
||||||
|
|
||||||
hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point"))
|
hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point"))
|
||||||
hidden:depends({mode="ap"})
|
hidden:depends({mode="ap"})
|
||||||
hidden:depends({mode="wds"})
|
hidden:depends({mode="wds"})
|
||||||
|
|
||||||
isolate = s:taboption("expert", Flag, "isolate", translate("Prevent communication between clients"))
|
isolate = s:taboption("expert", Flag, "isolate", translate("Prevent communication between clients"))
|
||||||
isolate:depends({mode="ap"})
|
isolate:depends({mode="ap"})
|
||||||
|
end
|
||||||
elseif hwtype == "prism2" then
|
elseif hwtype == "prism2" then
|
||||||
mode:value("wds", translate("WDS"))
|
if ap then
|
||||||
|
mode:value("wds", translate("WDS"))
|
||||||
|
end
|
||||||
|
|
||||||
mp = s:taboption("expert", ListValue, "macpolicy", translate("MAC-Address Filter"))
|
mp = s:taboption("expert", ListValue, "macpolicy", translate("MAC-Address Filter"))
|
||||||
mp:value("", translate("disable"))
|
mp:value("", translate("disable"))
|
||||||
|
@ -223,9 +235,11 @@ elseif hwtype == "prism2" then
|
||||||
ml:depends({macpolicy="allow"})
|
ml:depends({macpolicy="allow"})
|
||||||
ml:depends({macpolicy="deny"})
|
ml:depends({macpolicy="deny"})
|
||||||
|
|
||||||
hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point"))
|
if ap then
|
||||||
hidden:depends({mode="ap"})
|
hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point"))
|
||||||
hidden:depends({mode="wds"})
|
hidden:depends({mode="ap"})
|
||||||
|
hidden:depends({mode="wds"})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Encryption --
|
-- Encryption --
|
||||||
|
|
|
@ -14,11 +14,12 @@ $Id$
|
||||||
local niulib = require "luci.niulib"
|
local niulib = require "luci.niulib"
|
||||||
|
|
||||||
m = Map("wireless", "Configure Private Access Point")
|
m = Map("wireless", "Configure Private Access Point")
|
||||||
s = m:section(NamedSection, "ap", "interface", "Wireless Radio Device",
|
s = m:section(NamedSection, "ap", "interface", translate("Wireless Radio Device"),
|
||||||
"Select the wireless radio device that should be used to run the access"..
|
translate(
|
||||||
" point. Note that wireless radios will not show up here if you already use"..
|
"Select the wireless radio device that should be used to run the interface."..
|
||||||
" them for connecting to the Internet and are not capable of being used as"..
|
" Note that wireless radios will not show up here if you already use"..
|
||||||
" an access point in parallel.")
|
" them for other wireless services and are not capable of being used as"..
|
||||||
|
" an access point in parallel."))
|
||||||
s.anonymous = true
|
s.anonymous = true
|
||||||
s.addremove = false
|
s.addremove = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue