Preparing rewrite of WiFi configuration
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_wifi / devices.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 m = Map("wireless", translate("devices"), translate("a_w_devices1",
15 "An dieser Stelle können eingebaute WLAN-Geräte konfiguriert werden."))
16
17 s = m:section(TypedSection, "wifi-device", "")
18 --s.addremove = true
19
20 en = s:option(Flag, "disabled", translate("enable"))
21 en.enabled = "0"
22 en.disabled = "1"
23
24 function en.cfgvalue(self, section)
25 return Flag.cfgvalue(self, section) or "0"
26 end
27
28 t = s:option(DummyValue, "type", translate("type"))
29
30 mode = s:option(ListValue, "mode", translate("mode"))
31 mode:value("", "standard")
32 mode:value("11b", "802.11b")
33 mode:value("11g", "802.11g")
34 mode:value("11a", "802.11a")
35 mode:value("11bg", "802.11b+g")
36 mode.rmempty = true
37
38 s:option(Value, "channel", translate("a_w_channel"))
39
40 s:option(Value, "txantenna", translate("a_w_txantenna")).rmempty = true
41
42 s:option(Value, "rxantenna", translate("a_w_rxantenna")).rmempty = true
43
44 s:option(Value, "distance", translate("distance"),
45 translate("a_w_distance1")).rmempty = true
46
47 s:option(Value, "diversity", translate("a_w_diversity")):depends("type", "atheros")
48
49 country = s:option(Value, "country", translate("a_w_countrycode"))
50 country.optional = true
51 country:depends("type", "broadcom")
52
53 maxassoc = s:option(Value, "maxassoc", translate("a_w_connlimit"))
54 maxassoc:depends("type", "broadcom")
55 maxassoc.optional = true
56
57 return m