luci/modules/admin-full/luasrc/model/cbi/admin_wifi/devices.lua

68 lines
1.8 KiB
Lua
Raw Normal View History

--[[
LuCI - Lua Configuration Interface
Copyright 2008 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$
]]--
2008-06-09 10:10:29 +00:00
m = Map("wireless", translate("devices"), translate("a_w_devices1",
"An dieser Stelle können eingebaute WLAN-Geräte konfiguriert werden."))
2008-04-11 19:03:30 +00:00
2008-06-06 18:27:59 +00:00
s = m:section(TypedSection, "wifi-device", "")
2008-04-11 19:03:30 +00:00
--s.addremove = true
2008-06-09 10:10:29 +00:00
en = s:option(Flag, "disabled", translate("enable"))
2008-04-11 19:03:30 +00:00
en.enabled = "0"
en.disabled = "1"
function en.cfgvalue(self, section)
return Flag.cfgvalue(self, section) or "0"
end
2008-06-09 10:10:29 +00:00
t = s:option(ListValue, "type", translate("type"))
2008-04-11 19:03:30 +00:00
t:value("broadcom")
t:value("atheros")
t:value("mac80211")
t:value("prism2")
--[[
require("luci.sys")
2008-04-11 19:03:30 +00:00
local c = ". /etc/functions.sh;for i in /lib/wifi/*;do . $i;done;echo $DRIVERS"
for driver in luci.util.execl(c)[1]:gmatch("[^ ]+") do
2008-04-11 19:03:30 +00:00
t:value(driver)
end
]]--
2008-06-09 10:10:29 +00:00
mode = s:option(ListValue, "mode", translate("mode"))
2008-04-11 19:03:30 +00:00
mode:value("", "standard")
mode:value("11b", "802.11b")
mode:value("11g", "802.11g")
mode:value("11a", "802.11a")
mode:value("11bg", "802.11b+g")
mode.rmempty = true
2008-06-09 10:10:29 +00:00
s:option(Value, "channel", translate("a_w_channel"))
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
s:option(Value, "txantenna", translate("a_w_txantenna")).rmempty = true
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
s:option(Value, "rxantenna", translate("a_w_rxantenna")).rmempty = true
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
s:option(Value, "distance", translate("distance"),
translate("a_w_distance1")).rmempty = true
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
s:option(Value, "diversity", translate("a_w_diversity")):depends("type", "atheros")
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
country = s:option(Value, "country", translate("a_w_countrycode"))
2008-04-11 19:03:30 +00:00
country.optional = true
country:depends("type", "broadcom")
2008-06-09 10:10:29 +00:00
maxassoc = s:option(Value, "maxassoc", translate("a_w_connlimit"))
2008-04-11 19:03:30 +00:00
maxassoc:depends("type", "broadcom")
maxassoc.optional = true
return m