2 LuCI - Lua Configuration Interface
4 Copyright 2009 Steven Barth <steven@midlink.org>
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
10 http://www.apache.org/licenses/LICENSE-2.0
14 local niulib = require "luci.niulib"
15 local cursor = require "luci.model.uci".inst
17 m = Map("wireless", translate("Configure Private Access Point"))
18 s = m:section(NamedSection, "ap", "wifi-iface", translate("Wireless Radio Device"),
20 "Select the wireless radio device that should be used to run the interface."..
21 " Note that wireless radios will not show up here if you already use"..
22 " them for other wireless services and are not capable of being used by"..
23 " more than one service simultaneously or run this specific service at all."))
27 local l = s:option(ListValue, "device", translate("Wireless Device"))
29 for _, wifi in ipairs(niulib.wifi_get_available("ap")) do
30 l:value(wifi, translate("WLAN-Adapter (%s)") % wifi)
32 l:value("none", translate("Disable Private Access Point"))
35 local extend = cursor:get("wireless", "bridge", "network")
36 and cursor:get("wireless", "bridge", "ssid")
38 if extend ~= cursor:get("wireless", "ap", "ssid") then
39 local templ = s:option(ListValue, "_cfgtpl", translate("Configuration Template"))
40 templ:depends({["!default"] = 1})
41 templ:depends({["!reverse"] = 1, device = "none"})
42 templ:value("", translate("Access Point (Current Settings)"))
43 templ:value("bridge", translate("Extend network %s") % extend)