X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fniu%2Fluasrc%2Fmodel%2Fcbi%2Fniu%2Fwireless%2Fap1.lua;h=5ce93b400035b1b774222fd98585f3e369766457;hp=a771c231f9e602c01614b82dc1da708ba76168f3;hb=bd2ddbdc92e998968f13588495e464efe191d913;hpb=c27128946b4950af78a5fd35c12a1bf7531cc1f4 diff --git a/modules/niu/luasrc/model/cbi/niu/wireless/ap1.lua b/modules/niu/luasrc/model/cbi/niu/wireless/ap1.lua index a771c231f..5ce93b400 100644 --- a/modules/niu/luasrc/model/cbi/niu/wireless/ap1.lua +++ b/modules/niu/luasrc/model/cbi/niu/wireless/ap1.lua @@ -13,13 +13,17 @@ You may obtain a copy of the License at $Id$ ]]-- +local iface = "ap" +local ap = true + + local fs = require "nixio.fs" local sys = require "luci.sys" local cursor = require "luci.model.uci".inst local state = require "luci.model.uci".inst_state 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 nsantenna = cursor:get("wireless", device, "antenna") @@ -36,11 +40,13 @@ state:foreach("wireless", "wifi-iface", tx_powers = iw.txpwrlist or { } end end) + +local m + -m = Map("wireless", "Configure Access Point", -"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 --- s = m:section(NamedSection, device, "wifi-device", "Device Configuration") @@ -51,7 +57,7 @@ s:tab("general", translate("General Settings")) ch = s:taboption("general", Value, "channel", translate("Channel")) ch:value("auto", translate("automatic")) for _, f in ipairs(chan) do - ch:value(f.channel, "%i (%.3f GHz)" %{ f.channel, f.mhz }) + ch:value(f.channel, "%i (%.3f GHz)" %{ f.channel, f.mhz / 1000 }) end @@ -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:tab("general", translate("General Settings")) @@ -179,8 +185,8 @@ encr = s:taboption("expert", ListValue, "encryption", translate("Encryption")) if hwtype == "mac80211" then - s:taboption("expert", Flag, "wds", "Allow Bridging and Repeating (WDS)") - s:taboption("expert", Flag, "powersave", "Enable Powersaving") + s:taboption("expert", Flag, "wds", translate("Enable Bridging and Repeating (WDS)")) + s:taboption("expert", Flag, "powersave", translate("Enable Powersaving")) elseif hwtype == "atheros" then -- mode:value("wds", translate("Static WDS")) @@ -191,29 +197,29 @@ elseif hwtype == "atheros" then ml = s:taboption("expert", DynamicList, "maclist", translate("MAC-List")) ml:depends({macpolicy="allow"}) ml:depends({macpolicy="deny"}) - - s:taboption("expert", Flag, "wds", "Allow Bridging and Repeating (WDS)") + + s:taboption("expert", Flag, "wds", translate("Enable Bridging and Repeating (WDS)")) - hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point")) - hidden:depends({mode="ap"}) - hidden:depends({mode="ap-wds"}) - - isolate = s:taboption("expert", Flag, "isolate", translate("Prevent communication between clients")) - isolate:depends({mode="ap"}) + if ap then + hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point")) + hidden:depends({mode="ap"}) + hidden:depends({mode="ap-wds"}) + + isolate = s:taboption("expert", Flag, "isolate", translate("Prevent communication between clients")) + isolate:depends({mode="ap"}) + end s:taboption("expert", Flag, "bursting", translate("Allow Burst Transmissions")) elseif hwtype == "broadcom" then - mode:value("wds", translate("WDS")) - - hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point")) - hidden:depends({mode="ap"}) - hidden:depends({mode="wds"}) + if ap then + hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point")) + hidden:depends({mode="ap"}) + hidden:depends({mode="wds"}) - isolate = s:taboption("expert", Flag, "isolate", translate("Prevent communication between clients")) - isolate:depends({mode="ap"}) + isolate = s:taboption("expert", Flag, "isolate", translate("Prevent communication between clients")) + isolate:depends({mode="ap"}) + end elseif hwtype == "prism2" then - mode:value("wds", translate("WDS")) - mp = s:taboption("expert", ListValue, "macpolicy", translate("MAC-Address Filter")) mp:value("", translate("disable")) mp:value("deny", translate("Allow listed only")) @@ -223,18 +229,20 @@ elseif hwtype == "prism2" then ml:depends({macpolicy="allow"}) ml:depends({macpolicy="deny"}) - hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point")) - hidden:depends({mode="ap"}) - hidden:depends({mode="wds"}) + if ap then + hidden = s:taboption("expert", Flag, "hidden", translate("Hide Access Point")) + hidden:depends({mode="ap"}) + hidden:depends({mode="wds"}) + end end -- Encryption -- - +encr.default = "wep" -- Early default encr.override_values = true encr.override_depends = true encr:value("none", "No Encryption") -encr:value("wep", "WEP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}) +encr:value("wep", "WEP", {mode="ap"}) if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then local hostapd = fs.access("/usr/sbin/hostapd") or os.getenv("LUCI_SYSROOT") @@ -242,11 +250,11 @@ if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then if hostapd then --s:taboption("expert", Flag, "_alloweap", "Allow EAP / 802.11i authentication") - encr:value("psk", "WPA", {mode="ap"}, {mode="ap-wds"}) - encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="ap-wds"}) - encr:value("psk-mixed", "WPA + WPA2", {mode="ap"}, {mode="ap-wds"}) - encr:value("psk2", "WPA2", {mode="ap"}, {mode="ap-wds"}) - encr:value("wpa2", "WPA2-EAP (802.11i)", {mode="ap"}, {mode="ap-wds"}) + encr:value("psk", "WPA", {mode="ap"}) + encr:value("wpa", "WPA-EAP", {mode="ap"}) + encr:value("psk-mixed", "WPA + WPA2", {mode="ap"}) + encr:value("psk2", "WPA2", {mode="ap"}) + encr:value("wpa2", "WPA2-EAP (802.11i)", {mode="ap"}) encr.default = "psk-mixed" end elseif hwtype == "broadcom" then