be5c475ccc1250cc5e5cd55545ccac923ca1af3f
[project/luci.git] / modules / niu / luasrc / model / cbi / niu / wireless / brdevice.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2009 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 local niulib = require "luci.niulib"
15
16 m = Map("wireless", translate("Join a local WDS network"))
17 s = m:section(NamedSection, "bridge", "wifi-iface", translate("Wireless Radio Device"),
18 translate(
19 "Select the wireless radio device that should be used to run the interface."..
20 " Note that wireless radios will not show up here if you already use"..
21 " them for other wireless services and are not capable of being used by"..
22 " more than one service simultaneously or run this specific service at all."))
23 s.anonymous = true
24 s.addremove = false
25
26 l = s:option(ListValue, "device", translate("Wireless Device"))
27
28 for _, wifi in ipairs(niulib.wifi_get_available("bridge", {atheros = true, mac80211 = true})) do
29         l:value(wifi, translate("WLAN-Adapter (%s)") % wifi)
30 end
31 l:value("none", translate("Disable Bridge"))
32
33 return m