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

83 lines
2.3 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("networks"), translate("a_w_networks1"))
2008-04-11 19:03:30 +00:00
2008-06-06 18:27:59 +00:00
s = m:section(TypedSection, "wifi-iface", "")
2008-04-11 19:03:30 +00:00
s.addremove = true
s.anonymous = true
2008-06-09 10:10:29 +00:00
s:option(Value, "ssid", translate("a_w_netid")).maxlength = 32
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
device = s:option(ListValue, "device", translate("device"))
luci.model.uci.foreach("wireless", "wifi-device",
function (section)
device:value(section[".name"])
end)
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
network = s:option(ListValue, "network", translate("network"), translate("a_w_network1"))
2008-04-11 19:03:30 +00:00
network:value("")
luci.model.uci.foreach("network", "interface",
function (section)
if section[".name"] ~= "loopback" then
network:value(section[".name"])
end
end)
2008-04-11 19:03:30 +00:00
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("ap", "Access Point")
mode:value("adhoc", "Ad-Hoc")
mode:value("sta", "Client")
mode:value("wds", "WDS")
s:option(Value, "bssid", "BSSID").optional = true
2008-06-09 10:10:29 +00:00
s:option(Value, "txpower", translate("a_w_txpwr"), "dbm").rmempty = true
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
s:option(Flag, "frameburst", translate("a_w_brcmburst")).optional = true
s:option(Flag, "bursting", translate("a_w_athburst")).optional = true
2008-04-14 10:58:34 +00:00
2008-06-09 10:10:29 +00:00
encr = s:option(ListValue, "encryption", translate("encryption"))
2008-04-11 19:03:30 +00:00
encr:value("none", "keine")
encr:value("wep", "WEP")
encr:value("psk", "WPA-PSK")
encr:value("wpa", "WPA-Radius")
encr:value("psk2", "WPA2-PSK")
encr:value("wpa2", "WPA2-Radius")
2008-06-09 10:10:29 +00:00
key = s:option(Value, "key", translate("key"))
2008-04-11 19:03:30 +00:00
key:depends("encryption", "wep")
key:depends("encryption", "psk")
key:depends("encryption", "wpa")
key:depends("encryption", "psk2")
key:depends("encryption", "wpa2")
key.rmempty = true
2008-06-09 10:10:29 +00:00
server = s:option(Value, "server", translate("a_w_radiussrv"))
2008-04-11 19:03:30 +00:00
server:depends("encryption", "wpa")
server:depends("encryption", "wpa2")
server.rmempty = true
2008-06-09 10:10:29 +00:00
port = s:option(Value, "port", translate("a_w_radiusport"))
2008-04-11 19:03:30 +00:00
port:depends("encryption", "wpa")
port:depends("encryption", "wpa2")
port.rmempty = true
2008-06-09 10:10:29 +00:00
s:option(Flag, "isolate", translate("a_w_apisolation"), translate("a_w_apisolation1")).optional = true
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
s:option(Flag, "hidden", translate("a_w_hideessid")).optional = true
2008-04-11 19:03:30 +00:00
return m